diff --git a/custodia.spec b/custodia.spec index 7e7888e..8475d7e 100644 --- a/custodia.spec +++ b/custodia.spec @@ -1,11 +1,18 @@ %if 0%{?fedora} %global with_python3 1 -%global python3_tox $(python3 -c 'import sys; print("py{0.major}{0.minor}".format(sys.version_info))') +%endif + +# Workaround for python-etcd issue on PPC64. Although it's a noarch package +# it depends on etcd for testing. Go does not support PPC64 yet. +%ifarch ppc64 +%global with_etcd 0 +%else +%global with_etcd 1 %endif Name: custodia Version: 0.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A service to manage, retrieve and store secrets for other processes License: GPLv3+ @@ -25,7 +32,9 @@ BuildRequires: python2-setuptools >= 18 BuildRequires: python2-coverage BuildRequires: python-tox >= 2.3.1 BuildRequires: python2-pytest +%if %{?with_etcd} BuildRequires: python2-python-etcd +%endif BuildRequires: python-docutils BuildRequires: python2-configparser BuildRequires: python2-systemd @@ -38,7 +47,9 @@ BuildRequires: python3-setuptools > 18 BuildRequires: python3-coverage BuildRequires: python3-tox >= 2.3.1 BuildRequires: python3-pytest +%if %{?with_etcd} BuildRequires: python3-python-etcd +%endif BuildRequires: python3-docutils BuildRequires: python3-systemd %endif @@ -49,10 +60,14 @@ Requires: python3-custodia = %{version}-%{release} Requires: python2-custodia = %{version}-%{release} %endif -# FreeIPA 4.3 and 4.4 are not compatible with custodia because the custodia -# script now runs under Python 3. -Conflicts: freeipa-server-common < 4.5 -Conflicts: ipa-server-common < 4.5 +Requires(preun): systemd-units +Requires(postun): systemd-units +Requires(post): systemd-units + +# FreeIPA 4.3 and 4.4 up to 4.4.4 are not compatible with custodia because +# the custodia script now runs under Python 3. FreeIPA 4.4.5 has a workaround. +Conflicts: freeipa-server-common <= 4.4.4 +Conflicts: ipa-server-common < 4.4.4 %global overview \ Custodia is a Secrets Service Provider, it stores or proxies access to \ @@ -87,7 +102,7 @@ Sub-package with python custodia modules %{overview} - +%if %{?with_etcd} %package -n python2-custodia-extra Summary: Sub-package with python2 custodia extra modules Requires: python2-python-etcd @@ -98,6 +113,7 @@ Sub-package with python2 custodia extra modules (etcdstore) %{overview} +%endif # with_etcd %if 0%{?with_python3} %package -n python3-custodia @@ -113,7 +129,7 @@ Sub-package with python custodia modules %{overview} - +%if %{?with_etcd} %package -n python3-custodia-extra Summary: Sub-package with python3 custodia extra modules Requires: python3-python-etcd @@ -124,7 +140,8 @@ Sub-package with python3 custodia extra modules (etcdstore) %{overview} -%endif +%endif # with_etcd +%endif # with_python3 %prep @@ -144,9 +161,9 @@ export PIP_INDEX_URL=http://host.invalid./ # Don't try to download dnspython3. The package is provided by python3-dns export PIP_NO_DEPS=yes -tox --sitepackages -e py27 -- --skip-servertests +tox --sitepackages -e py%{python2_version_nodots} -- --skip-servertests %if 0%{?with_python3} -tox --sitepackages -e %{python3_tox} -- --skip-servertests +tox --sitepackages -e py%{python3_version_nodots} -- --skip-servertests %endif @@ -182,6 +199,21 @@ cp %{buildroot}/%{_bindir}/custodia-cli %{buildroot}/%{_bindir}/custodia-cli-3 %endif +%post +%systemd_post custodia.socket +%systemd_post custodia.service + + +%preun +%systemd_preun custodia.socket +%systemd_preun custodia.service + + +%postun +%systemd_postun custodia.socket +%systemd_postun custodia.service + + %files %doc README API.md %doc %{_defaultdocdir}/custodia/examples/custodia.conf @@ -204,9 +236,11 @@ cp %{buildroot}/%{_bindir}/custodia-cli %{buildroot}/%{_bindir}/custodia-cli-3 %{_sbindir}/custodia-2 %{_bindir}/custodia-cli-2 +%if %{?with_etcd} %files -n python2-custodia-extra %license LICENSE %{python2_sitelib}/custodia/store/etcdstore.py* +%endif # with_etcd %if 0%{?with_python3} %files -n python3-custodia @@ -217,14 +251,22 @@ cp %{buildroot}/%{_bindir}/custodia-cli %{buildroot}/%{_bindir}/custodia-cli-3 %{_sbindir}/custodia-3 %{_bindir}/custodia-cli-3 +%if %{?with_etcd} %files -n python3-custodia-extra %license LICENSE %{python3_sitelib}/custodia/store/etcdstore.py %{python3_sitelib}/custodia/store/__pycache__/etcdstore.* -%endif +%endif # with_etcd +%endif # with_python3 %changelog +* Mon Jun 19 2017 Christian Heimes - 0.5.0-2 +- Skip etcd store on PPC64 +- Add missing pre/post install hooks for systemd service +- Custodia 0.5 is compatible with FreeIPA 4.4.5 and newer +- Drop custodia user from tmpfiles.d conf + * Tue May 16 2017 Simo Sorce - 0.5.0-1 - New Custodia version - Drop checks on sha512sum, these checks are already done by dist-git diff --git a/custodia.tmpfiles.conf b/custodia.tmpfiles.conf index cacc039..9ab7d5f 100644 --- a/custodia.tmpfiles.conf +++ b/custodia.tmpfiles.conf @@ -1 +1 @@ -d /run/custodia 0755 custodia custodia +d /run/custodia 0755