2019-02-22 09:38:27 +01:00
|
|
|
# Attention: Before you can build this package, you must install venvctrl package through pip:
|
|
|
|
|
# pip install venvctrl
|
|
|
|
|
|
2019-02-22 17:25:12 +01:00
|
|
|
# Globals
|
|
|
|
|
%global __os_install_post %{nil}
|
|
|
|
|
# prevents the building of /usr/lib/.build-id directories and files:
|
|
|
|
|
# this only happens, if you are using python virtualenv
|
|
|
|
|
%global _build_id_links none
|
2019-06-16 09:36:33 +02:00
|
|
|
# don't check for rpath:
|
|
|
|
|
%global __arch_install_post /usr/lib/rpm/check-buildroot
|
2019-02-22 17:25:12 +01:00
|
|
|
|
2019-02-22 09:38:27 +01:00
|
|
|
# Macros
|
2020-11-01 10:47:45 +01:00
|
|
|
%define pyversion 3.9
|
2019-02-22 09:38:27 +01:00
|
|
|
%define name polemarch
|
|
|
|
|
%define shortname polemarch
|
|
|
|
|
%define namebase polemarch
|
|
|
|
|
%define user polemarch
|
2019-02-22 11:36:09 +01:00
|
|
|
%define datad poledata
|
2020-11-01 10:47:45 +01:00
|
|
|
%define version 1.8.1
|
|
|
|
|
%define release 1
|
2019-02-22 09:38:27 +01:00
|
|
|
%define __prelink_undo_cmd %{nil}
|
|
|
|
|
%define _binaries_in_noarch_packages_terminate_build 0
|
|
|
|
|
%define unmangled_version %{version}
|
|
|
|
|
|
|
|
|
|
Name: %{name}
|
|
|
|
|
Version: %{version}
|
|
|
|
|
Release: %{release}%{?dist}
|
|
|
|
|
Summary: Infrastructure Heat Service for orchestration infrastructure by ansible.
|
|
|
|
|
Group: Application/System
|
|
|
|
|
Vendor: VST Consulting <sergey.k@vstconsulting.net>
|
|
|
|
|
License: AGPL-3+
|
|
|
|
|
AutoReq: No
|
|
|
|
|
AutoProv: No
|
|
|
|
|
Source0: %name-%version.tar.gz
|
|
|
|
|
Source1: %name-settings
|
|
|
|
|
Source2: %name-redis-patch.sh
|
2019-05-03 15:06:29 +02:00
|
|
|
Source3: %name-mysql-patch.sh
|
2020-05-15 07:21:51 +02:00
|
|
|
# compiled binary tree:
|
|
|
|
|
Source10: %name-bin-%{version}.tgz
|
2019-02-22 09:38:27 +01:00
|
|
|
Patch0: %name-python3.patch
|
2019-05-04 16:22:21 +02:00
|
|
|
Patch1: %name-venvctrl.patch
|
2019-02-22 09:38:27 +01:00
|
|
|
|
|
|
|
|
# Note: these two packages must not be installed by distribution (fedora): python3-pyyaml, python3-blockdiag-devel
|
|
|
|
|
# Build fails, if these two packages are installed!
|
2019-06-16 09:36:33 +02:00
|
|
|
BuildRequires: python3, openssl-devel, libyaml-devel, python3-mysql
|
2019-02-22 09:38:27 +01:00
|
|
|
BuildRequires: python3-sphinxcontrib-blockdiag, python3-virtualenv, openldap-devel
|
2020-05-15 14:48:21 +02:00
|
|
|
BuildRequires: python3-amqp, python3-vine, python3-billiard, python3-celery, python3-kombu
|
|
|
|
|
BuildRequires: python3-redis, python3-Cython, python3-django-timezone-field, python3-markdown2
|
|
|
|
|
BuildRequires: python3-netaddr, python3-ldap, python3-smmap
|
2020-05-18 06:06:46 +02:00
|
|
|
BuildRequires: nodejs-has-yarn, yarnpkg, nodejs >= 10.0
|
2019-05-12 11:20:14 +02:00
|
|
|
Requires: python3, openssl-devel, libxcrypt-compat
|
2019-05-03 15:06:29 +02:00
|
|
|
Requires: python3-virtualenv, python3-mysql, python3-PyMySQL
|
2019-02-22 09:38:27 +01:00
|
|
|
Requires: git
|
|
|
|
|
Requires: libyaml-devel
|
|
|
|
|
Requires: krb5-devel, krb5-libs, openldap-devel
|
|
|
|
|
Requires: mailcap
|
2019-05-12 11:20:14 +02:00
|
|
|
Requires: python3-redis >= 3.2.0, python3-django-redis >= 4.0.0, redis >= 5.0.0
|
2020-05-15 07:21:51 +02:00
|
|
|
Requires: python3-gitdb, python3-GitPython
|
2020-05-15 14:48:21 +02:00
|
|
|
Requires: python3-amqp, python3-vine, python3-billiard, python3-celery, python3-kombu
|
|
|
|
|
Requires: python3-redis, python3-Cython, python3-django-timezone-field, python3-markdown2
|
|
|
|
|
Requires: python3-netaddr, python3-ldap, python3-smmap
|
2019-02-22 09:38:27 +01:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Polemarch is service for orchestration infrastructure by ansible.
|
|
|
|
|
Simply WEB gui for orchestration infrastructure by ansible playbooks.
|
|
|
|
|
|
2019-02-22 11:36:09 +01:00
|
|
|
%prep
|
|
|
|
|
%setup -q -n %name-%version
|
2019-12-06 23:13:56 +01:00
|
|
|
#patch0 -b python3-patch
|
2020-05-15 07:21:51 +02:00
|
|
|
%patch1 -b venvctrl-patch
|
2019-02-22 09:38:27 +01:00
|
|
|
|
|
|
|
|
%install
|
2020-05-15 07:21:51 +02:00
|
|
|
#/usr/bin/make BUILD_DIR=%{buildroot}
|
|
|
|
|
# Install binary package (compiling does not work here! You need to compile it first!)
|
2020-05-15 14:48:21 +02:00
|
|
|
# cd BUILD/polemarch-1.7.3
|
|
|
|
|
# /usr/bin/patch --no-backup-if-mismatch -p0 -b --suffix ~/rpmbuild/SOURCES/venvctrl-patch --fuzz=0
|
|
|
|
|
# /usr/bin/make BUILD_DIR=/root/rpmbuild/BUILDROOT/polemarch
|
|
|
|
|
# cd /root/rpmbuild/BUILDROOT/polemarch
|
|
|
|
|
# tar czf ~/rpmbuild/SOURCES/polemarch-bin-1.7.3.tgz .
|
2020-05-15 07:21:51 +02:00
|
|
|
# don't forget to replace version and release number!
|
|
|
|
|
tar xzf %{S:10} -C %{buildroot}
|
|
|
|
|
/usr/bin/install %{S:1} %{buildroot}%{_sysconfdir}/%{namebase}/settings.ini
|
2019-02-22 11:36:09 +01:00
|
|
|
# fix for python3 redis access:
|
2019-02-22 09:38:27 +01:00
|
|
|
bash %{S:2}
|
2019-05-03 15:06:29 +02:00
|
|
|
# fix or workaround for mysqlclient version check:
|
|
|
|
|
bash %{S:3}
|
2019-02-22 11:36:09 +01:00
|
|
|
# fix for fedora rundir config:
|
|
|
|
|
mv %{buildroot}/var/run %{buildroot}/
|
|
|
|
|
# create additional directories:
|
|
|
|
|
install -d %{buildroot}/%{_var}/log/%{name}
|
|
|
|
|
install -d %{buildroot}/opt/%{datad}
|
2020-05-15 07:21:51 +02:00
|
|
|
ln -s %{python3_sitearch}/MySQLdb %{buildroot}/opt/polemarch/lib/python%{pyversion}/site-packages/MySQLdb
|
|
|
|
|
ln -s %{python3_sitelib}/pymysql %{buildroot}/opt/polemarch/lib/python%{pyversion}/site-packages/pymysql
|
|
|
|
|
# remove compiled git python package, which are not working on Fedora 32 and pyton3.8
|
|
|
|
|
rm -rf %{buildroot}/opt/polemarch/lib/python%{pyversion}/site-packages/git
|
|
|
|
|
ln -s %{python3_sitelib}/git %{buildroot}/opt/polemarch/lib/python%{pyversion}/site-packages/git
|
|
|
|
|
rm -rf %{buildroot}/opt/polemarch/lib/python%{pyversion}/site-packages/gitdb
|
|
|
|
|
ln -s %{python3_sitelib}/gitdb %{buildroot}/opt/polemarch/lib/python%{pyversion}/site-packages/gitdb
|
2019-11-01 11:07:08 +01:00
|
|
|
# remove buildroot path in opt/polemarch/bin/activate.xsh:
|
|
|
|
|
sed -i -e 's|/root/rpmbuild/BUILDROOT/polemarch.*x86_64||' %{buildroot}/opt/polemarch/bin/activate.xsh
|
2020-11-01 10:47:45 +01:00
|
|
|
# remove .gitignore file:
|
|
|
|
|
rm -f %{buildroot}/opt/polemarch/.gitignore
|
2019-02-22 09:38:27 +01:00
|
|
|
|
2019-02-22 10:13:19 +01:00
|
|
|
%pre
|
|
|
|
|
getent group %{user} >/dev/null || \
|
|
|
|
|
groupadd -r %{user}
|
|
|
|
|
getent passwd %{user} >/dev/null || \
|
2019-02-22 19:22:04 +01:00
|
|
|
useradd -r -g %{user} -d /opt/%{user} \
|
2019-02-22 10:13:19 +01:00
|
|
|
-s /sbin/nologin -c "%{user} user" %{user}
|
|
|
|
|
exit 0
|
|
|
|
|
|
2019-02-22 09:38:27 +01:00
|
|
|
%post
|
2019-02-22 10:13:19 +01:00
|
|
|
%systemd_post %{name}.service
|
2019-03-09 00:42:05 +01:00
|
|
|
sudo -u %{user} /opt/%{name}/bin/%{shortname}ctl migrate
|
2019-02-22 09:38:27 +01:00
|
|
|
|
|
|
|
|
%preun
|
2019-02-22 10:13:19 +01:00
|
|
|
%systemd_preun %{name}.service
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%systemd_postun_with_restart %{name}.service
|
2019-02-22 09:38:27 +01:00
|
|
|
|
2019-02-22 11:36:09 +01:00
|
|
|
%files
|
|
|
|
|
%defattr(-,%{user},%{user},-)
|
|
|
|
|
%dir %attr(-,%{user},%{user}) /opt/%{namebase}
|
|
|
|
|
%dir %attr(-,%{user},%{user}) /opt/%{datad}
|
|
|
|
|
%dir %attr(-,%{user},%{user}) %{_var}/log/%{namebase}
|
|
|
|
|
%attr(-,%{user},%{user}) /opt/%{namebase}/bin/*
|
|
|
|
|
%attr(-,%{user},%{user}) /opt/%{namebase}/lib/*
|
|
|
|
|
/opt/%{namebase}/lib64
|
2020-11-01 10:47:45 +01:00
|
|
|
/opt/%{namebase}/*.cfg
|
2019-02-22 11:36:09 +01:00
|
|
|
%dir %{_sysconfdir}/%{namebase}
|
|
|
|
|
%{_rundir}/%{namebase}
|
|
|
|
|
%{_var}/lock/%{namebase}
|
|
|
|
|
%attr(755,%{user},%{user}) %{_sysconfdir}/systemd/system/%{shortname}.service
|
|
|
|
|
%attr(755,root,root) %{_sysconfdir}/tmpfiles.d/%{namebase}.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{namebase}/settings.ini
|
2019-02-22 11:59:13 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/%{namebase}/settings.ini.template
|
2019-02-22 09:38:27 +01:00
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
|
|
|
|
|
[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/*
|
|
|
|
|
|
|
|
|
|
%changelog
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sat Oct 31 2020 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
|
|
|
|
- Update to 1.8.1 version, first build on Fedora 33 and python 3.9.
|
|
|
|
|
|
|
|
|
|
* Fri Aug 14 2020 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2020-08-14 10:34:36 +02:00
|
|
|
- Update to 1.8.0 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Mon May 18 2020 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2020-05-18 06:06:46 +02:00
|
|
|
- Build dependencies added (nodejs and yarn).
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri May 15 2020 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2020-05-15 14:48:21 +02:00
|
|
|
- Update to 1.7.6 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sun May 3 2020 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2020-05-15 07:21:51 +02:00
|
|
|
- Fixes for Fedora 32 installation. Git and gitdb packages are now symlinked.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Jan 17 2020 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2020-01-17 12:22:50 +01:00
|
|
|
- Update to 1.6.2 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Mon Dec 30 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-12-30 10:58:04 +01:00
|
|
|
- Update to 1.6.1 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sun Dec 15 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-12-30 10:58:04 +01:00
|
|
|
- Update to 1.6.0 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Dec 6 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-12-06 23:13:56 +01:00
|
|
|
- Update to 1.5.1 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sat Nov 9 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-11-16 19:15:20 +01:00
|
|
|
- Changes for Fedora 31.
|
|
|
|
|
- mysqlcient symlink added.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sat Sep 21 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-09-21 13:45:31 +02:00
|
|
|
- Update to 1.4.4 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sun Sep 15 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-09-15 12:15:00 +02:00
|
|
|
- Update to 1.4.3 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Aug 16 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-08-16 08:18:20 +02:00
|
|
|
- Update to 1.4.1 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sat Jul 13 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-07-13 07:51:26 +02:00
|
|
|
- Update to 1.3.1 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sun Jun 16 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-06-16 09:36:33 +02:00
|
|
|
- Update to 1.2.1 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Mon Jun 10 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-06-16 09:36:33 +02:00
|
|
|
- Update to 1.2.0 version, python 3 is required now.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sun May 12 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-05-12 11:20:14 +02:00
|
|
|
- Dependency for libxcrypt-compat added.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri May 3 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-05-03 15:06:29 +02:00
|
|
|
- Workaround for mysql DB version failure.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Sun Apr 28 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-05-03 15:06:29 +02:00
|
|
|
- Update to latest 1.1.4 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Mar 22 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-03-22 11:45:54 +01:00
|
|
|
- Update to latest 1.1.3 version.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Mar 8 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-03-09 00:42:05 +01:00
|
|
|
- Do migrate alltimes postinstall script.
|
|
|
|
|
- Upgrade to latest 1.1.2 version.
|
|
|
|
|
- redis-py patch for version 3.2.0 which is required but not resolved.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Feb 22 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-02-22 19:40:14 +01:00
|
|
|
- Some fixes for post script.
|
|
|
|
|
|
2020-11-01 10:47:45 +01:00
|
|
|
* Fri Feb 22 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
|
2019-02-22 09:38:27 +01:00
|
|
|
- First setup for Fedora 29
|
|
|
|
|
|