Polemarch is now working again in vesion 1.1.2

This commit is contained in:
2019-03-09 00:42:05 +01:00
parent dd45742a6e
commit 2e1b2593b2
2 changed files with 114 additions and 6 deletions

View File

@@ -13,7 +13,7 @@
%define namebase polemarch %define namebase polemarch
%define user polemarch %define user polemarch
%define datad poledata %define datad poledata
%define version 1.1.0 %define version 1.1.2
%define release 1 %define release 1
%define __prelink_undo_cmd %{nil} %define __prelink_undo_cmd %{nil}
%define _binaries_in_noarch_packages_terminate_build 0 %define _binaries_in_noarch_packages_terminate_build 0
@@ -31,6 +31,7 @@ AutoProv: No
Source0: %name-%version.tar.gz Source0: %name-%version.tar.gz
Source1: %name-settings Source1: %name-settings
Source2: %name-redis-patch.sh Source2: %name-redis-patch.sh
Source3: %name-redis-client.patch
Patch0: %name-python3.patch Patch0: %name-python3.patch
# Note: these two packages must not be installed by distribution (fedora): python3-pyyaml, python3-blockdiag-devel # 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: libyaml-devel
Requires: krb5-devel, krb5-libs, openldap-devel Requires: krb5-devel, krb5-libs, openldap-devel
Requires: mailcap Requires: mailcap
Requires: python3-redis, python3-django-redis, redis Requires: python3-redis >= 3.2.0, python3-django-redis, redis
%description %description
Polemarch is service for orchestration infrastructure by ansible. Polemarch is service for orchestration infrastructure by ansible.
@@ -63,6 +64,9 @@ mv %{buildroot}/var/run %{buildroot}/
# create additional directories: # create additional directories:
install -d %{buildroot}/%{_var}/log/%{name} install -d %{buildroot}/%{_var}/log/%{name}
install -d %{buildroot}/opt/%{datad} install -d %{buildroot}/opt/%{datad}
pushd %{buildroot}
patch -p0 < %{S:3}
popd
%pre %pre
getent group %{user} >/dev/null || \ getent group %{user} >/dev/null || \
@@ -74,10 +78,7 @@ exit 0
%post %post
%systemd_post %{name}.service %systemd_post %{name}.service
# only migrate, if it is an update, at first installation, no database is available sudo -u %{user} /opt/%{name}/bin/%{shortname}ctl migrate
if [ $1 -eq 2 ]; then
su - %{user} -c "/opt/%{name}/bin/%{shortname}ctl migrate"
fi
%preun %preun
%systemd_preun %{name}.service %systemd_preun %{name}.service
@@ -107,6 +108,11 @@ fi
[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/* [ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/*
%changelog %changelog
* Fri Mar 8 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
- 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 <daniel.steiner@daniel-steiner.org> * Fri Feb 22 2019 Daniel Steiner <daniel.steiner@daniel-steiner.org>
- Some fixes for post script. - Some fixes for post script.

View File

@@ -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 <daniel.steiner@daniel-steiner.org>
- First Redis setup for Fedora 29.