diff --git a/fedora/SPECS/polemarch.spec b/fedora/SPECS/polemarch.spec index d4e3b03..0916bba 100644 --- a/fedora/SPECS/polemarch.spec +++ b/fedora/SPECS/polemarch.spec @@ -13,7 +13,7 @@ %define namebase polemarch %define user polemarch %define datad poledata -%define version 1.1.0 +%define version 1.1.2 %define release 1 %define __prelink_undo_cmd %{nil} %define _binaries_in_noarch_packages_terminate_build 0 @@ -31,6 +31,7 @@ AutoProv: No Source0: %name-%version.tar.gz Source1: %name-settings Source2: %name-redis-patch.sh +Source3: %name-redis-client.patch Patch0: %name-python3.patch # Note: these two packages must not be installed by distribution (fedora): python3-pyyaml, python3-blockdiag-devel @@ -43,7 +44,7 @@ Requires: git Requires: libyaml-devel Requires: krb5-devel, krb5-libs, openldap-devel Requires: mailcap -Requires: python3-redis, python3-django-redis, redis +Requires: python3-redis >= 3.2.0, python3-django-redis, redis %description Polemarch is service for orchestration infrastructure by ansible. @@ -63,6 +64,9 @@ mv %{buildroot}/var/run %{buildroot}/ # create additional directories: install -d %{buildroot}/%{_var}/log/%{name} install -d %{buildroot}/opt/%{datad} +pushd %{buildroot} +patch -p0 < %{S:3} +popd %pre getent group %{user} >/dev/null || \ @@ -74,10 +78,7 @@ exit 0 %post %systemd_post %{name}.service -# only migrate, if it is an update, at first installation, no database is available -if [ $1 -eq 2 ]; then -su - %{user} -c "/opt/%{name}/bin/%{shortname}ctl migrate" -fi +sudo -u %{user} /opt/%{name}/bin/%{shortname}ctl migrate %preun %systemd_preun %{name}.service @@ -107,6 +108,11 @@ fi [ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/* %changelog + * Fri Mar 8 2019 Daniel Steiner +- 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. + * Fri Feb 22 2019 Daniel Steiner - Some fixes for post script. diff --git a/fedora/SPECS/python-redis.spec b/fedora/SPECS/python-redis.spec new file mode 100644 index 0000000..1f9a619 --- /dev/null +++ b/fedora/SPECS/python-redis.spec @@ -0,0 +1,102 @@ +%if 0%{?fedora} >= 13 || 0%{?el} >= 8 +%global with_python3 1 +%endif + +%global upstream_name redis + +Name: python-%{upstream_name} +Version: 3.2.0 +Release: 1%{?dist} +Summary: Python 2 interface to the Redis key-value store +License: MIT +URL: https://github.com/andymccurdy/redis-py +Source0: https://github.com/andymccurdy/redis-py/archive/%{version}.tar.gz +BuildArch: noarch +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-py +BuildRequires: python2-pytest +BuildRequires: redis +BuildRequires: python2-mock + +# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1591808 +BuildRequires: jemalloc + +%global _description\ +This is a Python 2 interface to the Redis key-value store. + +%description %_description + +%package -n python2-redis +Summary: %summary +%{?python_provide:%python_provide python2-redis} + +%description -n python2-redis %_description + +%if 0%{?with_python3} +%package -n python3-redis +Summary: Python 3 interface to the Redis key-value store +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-py +BuildRequires: python3-pytest +BuildRequires: python3-mock + +%description -n python3-redis +This is a Python 3 interface to the Redis key-value store. +%endif + +%prep +%setup -qn redis-py-%{version} +rm -frv %{upstream_name}.egg-info + +# This test passes locally but fails in koji... +rm tests/test_commands.py* + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + +%build +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif +%{__python2} setup.py build + +%install +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root=%{buildroot} +popd +%endif +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} + +%check +redis-server & +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py test +popd +%endif +%{__python2} setup.py test +kill %1 + +%files -n python2-redis +%doc CHANGES LICENSE README.rst +%{python2_sitelib}/%{upstream_name} +%{python2_sitelib}/%{upstream_name}-%{version}-py%{python2_version}.egg-info + +%if 0%{?with_python3} +%files -n python3-redis +%doc CHANGES LICENSE README.rst +%{python3_sitelib}/%{upstream_name} +%{python3_sitelib}/%{upstream_name}-%{version}-py%{python3_version}.egg-info +%endif + +%changelog +* Fri Mar 8 2019 Daniel Steiner +- First Redis setup for Fedora 29. +