Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/custodia.git#6a6c3413f2c30dd42a01dacb64e27234bf080e84
This commit is contained in:
DistroBaker 2021-01-20 16:04:29 +00:00
parent 0405306c3d
commit ea9079fb0e

View File

@ -1,22 +1,8 @@
%if 0%{?fedora} || 0%{?rhel} > 7
# Enable python3 build by default
%bcond_without python3
%else
%bcond_with python3
%endif
%if 0%{?fedora} > 29 || 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
%{!?python3_pkgversion:%global python3_pkgversion 3}
Name: custodia
Version: 0.6.0
Release: 13%{?dist}
Release: 14%{?dist}
Summary: A service to manage, retrieve and store secrets for other processes
License: GPLv3+
@ -34,36 +20,15 @@ BuildArch: noarch
BuildRequires: systemd
%if 0%{?with_python2}
BuildRequires: python2-devel
BuildRequires: python2-jwcrypto >= 0.4.2
BuildRequires: python2-requests
BuildRequires: python2-setuptools >= 18
BuildRequires: python2-coverage
BuildRequires: python2-pytest
BuildRequires: python2-docutils
BuildRequires: python2-configparser
BuildRequires: python2-systemd
BuildRequires: tox >= 2.3.1
%endif
%if 0%{?with_python3}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-jwcrypto >= 0.4.2
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-setuptools > 18
BuildRequires: python%{python3_pkgversion}-coverage
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-docutils
BuildRequires: python%{python3_pkgversion}-systemd
%endif
%if 0%{?with_python3}
Requires: python%{python3_pkgversion}-custodia = %{version}-%{release}
%else
Requires: python2-custodia = %{version}-%{release}
%endif
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): systemd-units
@ -86,24 +51,6 @@ A service to manage, retrieve and store secrets for other processes
%{overview}
%if 0%{?with_python2}
%package -n python2-custodia
Summary: Sub-package with python2 custodia modules
%{?python_provide:%python_provide python2-%{name}}
Requires: python2-configparser
Requires: python2-jwcrypto >= 0.4.2
Requires: python2-requests
Requires: python2-setuptools
Requires: python2-systemd
Conflicts: python2-custodia-extra < %{version}
%description -n python2-custodia
Sub-package with python custodia modules
%{overview}
%endif
%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-custodia
Summary: Sub-package with python3 custodia modules
%{?python_provide:%python_provide python3-%{name}}
@ -118,20 +65,13 @@ Sub-package with python custodia modules
%{overview}
%endif # with_python3
%prep
%autosetup -p1
%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build
%endif
%check
@ -143,16 +83,10 @@ export PIP_NO_DEPS=yes
# may pick up this package from global site-packages instead of source dist.
export PIP_IGNORE_INSTALLED=yes
%if 0%{?with_python2}
tox --sitepackages -e py%{python2_version_nodots} -- --skip-servertests
%endif
%if 0%{?with_python3}
# Test custodia in a virtual environment
%{__python3} -m venv --system-site-packages testenv
testenv/bin/pip install .
testenv/bin/python -m pytest --capture=no --strict --skip-servertests
%endif
%install
@ -167,20 +101,10 @@ mkdir -p %{buildroot}/%{_localstatedir}/lib/custodia
mkdir -p %{buildroot}/%{_localstatedir}/log/custodia
mkdir -p %{buildroot}/%{_localstatedir}/run/custodia
%if 0%{?with_python2}
%py2_install
mv %{buildroot}/%{_bindir}/custodia %{buildroot}/%{_sbindir}/custodia
cp %{buildroot}/%{_sbindir}/custodia %{buildroot}/%{_sbindir}/custodia-2
cp %{buildroot}/%{_bindir}/custodia-cli %{buildroot}/%{_bindir}/custodia-cli-2
%endif
%if 0%{?with_python3}
# overrides /usr/bin/custodia-cli and /usr/sbin/custodia with Python 3 shebang
%py3_install
mv %{buildroot}/%{_bindir}/custodia %{buildroot}/%{_sbindir}/custodia
cp %{buildroot}/%{_sbindir}/custodia %{buildroot}/%{_sbindir}/custodia-3
cp %{buildroot}/%{_bindir}/custodia-cli %{buildroot}/%{_bindir}/custodia-cli-3
%endif
install -m 644 -t "%{buildroot}/%{_mandir}/man7" man/custodia.7
install -m 644 -t "%{buildroot}/%{_defaultdocdir}/custodia" README API.md
@ -191,7 +115,6 @@ install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/custodia.conf
%pre
getent group custodia >/dev/null || groupadd -r custodia
getent passwd custodia >/dev/null || \
@ -231,17 +154,6 @@ exit 0
%dir %attr(0755,custodia,custodia) %{_localstatedir}/run/custodia
%{_tmpfilesdir}/custodia.conf
%if 0%{?with_python2}
%files -n python2-custodia
%license LICENSE
%{python2_sitelib}/%{name}
%{python2_sitelib}/%{name}-%{version}-py%{python2_version}.egg-info
%{python2_sitelib}/%{name}-%{version}-py%{python2_version}-nspkg.pth
%{_sbindir}/custodia-2
%{_bindir}/custodia-cli-2
%endif
%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-custodia
%license LICENSE
%{python3_sitelib}/%{name}
@ -250,10 +162,12 @@ exit 0
%{_sbindir}/custodia-3
%{_bindir}/custodia-cli-3
%endif # with_python3
%changelog
* Wed Jan 20 14:50:26 CET 2021 Christian Heimes <cheimes@redhat.com> - 0.6.0-14
- Remove Python 2 packaging
- Remove unused dependency on python3-coverage
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild