From e800a5399555a81e019002dead5e7bb871e29655 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Fri, 22 Feb 2019 09:38:27 +0100 Subject: [PATCH] First try for polemarch rpm. Not tested yet --- fedora/SPECS/polemarch.spec | 92 +++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 fedora/SPECS/polemarch.spec diff --git a/fedora/SPECS/polemarch.spec b/fedora/SPECS/polemarch.spec new file mode 100644 index 0000000..8d183d4 --- /dev/null +++ b/fedora/SPECS/polemarch.spec @@ -0,0 +1,92 @@ +# 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},-) +/opt/polemarch +/etc/%{namebase} +/var/log/%{namebase} +/var/run/%{namebase} +/var/lock/%{namebase} +%attr(755,root,root) /etc/systemd/system/%{shortname}.service +%attr(755,root,root) /etc/tmpfiles.d/%{namebase}.conf +%config(noreplace) %{_sysconfdir}/%{namebase}/settings.ini + +%pre +id -u %{user} || useradd %{user} +id -g %{user} || groupadd %{user} + +%install +make BUILD_DIR=%{buildroot} +install %{S:1} %{buildroot}%{_sysconfdir}/%{namebase}/settings.ini +bash %{S:2} + +%post +su - %{user} -c "/opt/%{name}/bin/%{shortname}ctl migrate" +/usr/bin/systemctl daemon-reload +/usr/bin/systemctl enable %{shortname}.service + +%preun +/usr/bin/systemctl disable %{shortname}.service > /dev/null 2>&1 +if [ "$1" = "0" ]; then + service %{shortname} stop >/dev/null 2>&1 +fi + +%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 +