# Attention: Before you can build this package, you must install venvctrl package through pip: # pip install venvctrl # Macros %define name polemarch %define shortname polemarch %define namebase polemarch %define user polemarch %define version 1.1.0 %define release 0 %define __prelink_undo_cmd %{nil} %define _binaries_in_noarch_packages_terminate_build 0 %define unmangled_version %{version} # Globals %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') # Tags Name: %{name} Version: %{version} Release: %{release}%{?dist} Summary: Infrastructure Heat Service for orchestration infrastructure by ansible. Group: Application/System Vendor: VST Consulting License: AGPL-3+ AutoReq: No AutoProv: No Source0: %name-%version.tar.gz Source1: %name-settings Source2: %name-redis-patch.sh Patch0: %name-python3.patch # Note: these two packages must not be installed by distribution (fedora): python3-pyyaml, python3-blockdiag-devel # Build fails, if these two packages are installed! BuildRequires: python3, openssl-devel, libyaml-devel BuildRequires: python3-sphinxcontrib-blockdiag, python3-virtualenv, openldap-devel Requires: python3, openssl-devel Requires: python3-virtualenv Requires: git Requires: libyaml-devel Requires: krb5-devel, krb5-libs, openldap-devel Requires: mailcap Requires: python3-redis, python3-django-redis, redis %description Polemarch is service for orchestration infrastructure by ansible. Simply WEB gui for orchestration infrastructure by ansible playbooks. # Blocks %files %defattr(-,%{user},%{user},-) %dir /opt/polemarch %{_sysconfdir}/%{namebase} %{_var}/log/%{namebase} %{_rundir}/%{namebase} %{_var}/lock/%{namebase} %attr(755,root,root) %{_sysconfdir}/systemd/system/%{shortname}.service %attr(755,root,root) %{_sysconfdir}/tmpfiles.d/%{namebase}.conf %config(noreplace) %{_sysconfdir}/%{namebase}/settings.ini %install make BUILD_DIR=%{buildroot} install %{S:1} %{buildroot}%{_sysconfdir}/%{namebase}/settings.ini bash %{S:2} %pre getent group %{user} >/dev/null || \ groupadd -r %{user} getent passwd %{user} >/dev/null || \ useradd -r -g %{user} -d %{user} \ -s /sbin/nologin -c "%{user} user" %{user} exit 0 %post %systemd_post %{name}.service # only migrate, if it is an update if [ $2 -eq 1 ]; then su - %{user} -c "/opt/%{name}/bin/%{shortname}ctl migrate" fi %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %prep %setup -q -n %name-%version %patch0 -b python3-patch %clean [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} [ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/* %changelog * Fri Feb 22 2019 Daniel Steiner - First setup for Fedora 29