ee26c3
Name:           custodia
ee26c3
Version:        0.6.0
021e12
Release:        3%{?dist}
ee26c3
Summary:        A service to manage, retrieve and store secrets for other processes
ee26c3
ee26c3
License:        GPLv3+
ee26c3
URL:            https://github.com/latchset/%{name}
ee26c3
Source0:        https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
ee26c3
Source2:        custodia.conf
ee26c3
Source3:        custodia@.service
ee26c3
Source4:        custodia@.socket
ee26c3
Source5:        custodia.tmpfiles.conf
ee26c3
ee26c3
Patch1:	        nonfatal_deprecation.patch
ee26c3
ee26c3
BuildArch:      noarch
ee26c3
ee26c3
BuildRequires:      systemd
ee26c3
ee26c3
BuildRequires:      python%{python3_pkgversion}-devel
ee26c3
BuildRequires:      python%{python3_pkgversion}-jwcrypto >= 0.4.2
ee26c3
BuildRequires:      python%{python3_pkgversion}-requests
ee26c3
BuildRequires:      python%{python3_pkgversion}-setuptools > 18
ee26c3
BuildRequires:      python%{python3_pkgversion}-coverage
ee26c3
BuildRequires:      python%{python3_pkgversion}-pytest
ee26c3
BuildRequires:      python%{python3_pkgversion}-docutils
ee26c3
BuildRequires:      python%{python3_pkgversion}-systemd
ee26c3
ee26c3
Requires:           python%{python3_pkgversion}-custodia = %{version}-%{release}
ee26c3
ee26c3
Requires(preun):    systemd-units
ee26c3
Requires(postun):   systemd-units
ee26c3
Requires(post):     systemd-units
ee26c3
ee26c3
ee26c3
%global overview                                                           \
ee26c3
Custodia is a Secrets Service Provider, it stores or proxies access to     \
ee26c3
keys, password, and secret material in general. Custodia is built to       \
ee26c3
use the HTTP protocol and a RESTful API as an IPC mechanism over a local   \
ee26c3
Unix Socket. It can also be exposed to a network via a Reverse Proxy       \
ee26c3
service assuming proper authentication and header validation is            \
ee26c3
implemented in the Proxy.                                                  \
ee26c3
                                                                           \
ee26c3
Custodia is modular, the configuration file controls how authentication,   \
ee26c3
authorization, storage and API plugins are combined and exposed.
ee26c3
ee26c3
ee26c3
%description
ee26c3
A service to manage, retrieve and store secrets for other processes
ee26c3
ee26c3
%{overview}
ee26c3
ee26c3
%package -n python%{python3_pkgversion}-custodia
ee26c3
Summary:    Sub-package with python3 custodia modules
ee26c3
%{?python_provide:%python_provide python3-%{name}}
ee26c3
Requires:   python%{python3_pkgversion}-jwcrypto >= 0.4.2
ee26c3
Requires:   python%{python3_pkgversion}-requests
ee26c3
Requires:   python%{python3_pkgversion}-systemd
021e12
%if 0%{?rhel} && 0%{?rhel} >= 8
021e12
Requires:   platform-python-setuptools
021e12
%else
021e12
Requires:   python%{python3_pkgversion}-setuptools
021e12
%endif
ee26c3
Conflicts:  python%{python3_pkgversion}-custodia-extra < %{version}
ee26c3
Obsoletes:  python%{python3_pkgversion}-custodia-extra < %{version}
ee26c3
ee26c3
%description -n python%{python3_pkgversion}-custodia
ee26c3
Sub-package with python custodia modules
ee26c3
ee26c3
%{overview}
ee26c3
ee26c3
ee26c3
%prep
ee26c3
%autosetup -p1
ee26c3
ee26c3
ee26c3
%build
ee26c3
%py3_build
ee26c3
ee26c3
ee26c3
%check
ee26c3
# don't download packages
ee26c3
export PIP_INDEX_URL=http://host.invalid./
ee26c3
# Don't try to download dnspython3. The package is provided by python%{python3_pkgversion}-dns
ee26c3
export PIP_NO_DEPS=yes
ee26c3
# Ignore all install packages to enforce installation of sdist. Otherwise tox
ee26c3
# may pick up this package from global site-packages instead of source dist.
ee26c3
export PIP_IGNORE_INSTALLED=yes
ee26c3
ee26c3
# Test custodia in a virtual environment
ee26c3
%{__python3} -m venv --system-site-packages testenv
ee26c3
testenv/bin/pip install .
ee26c3
testenv/bin/python -m pytest --capture=no --strict --skip-servertests
ee26c3
ee26c3
ee26c3
%install
ee26c3
mkdir -p %{buildroot}/%{_sbindir}
ee26c3
mkdir -p %{buildroot}/%{_mandir}/man7
ee26c3
mkdir -p %{buildroot}/%{_defaultdocdir}/custodia
ee26c3
mkdir -p %{buildroot}/%{_defaultdocdir}/custodia/examples
ee26c3
mkdir -p %{buildroot}/%{_sysconfdir}/custodia
ee26c3
mkdir -p %{buildroot}/%{_unitdir}
ee26c3
mkdir -p %{buildroot}/%{_tmpfilesdir}
ee26c3
mkdir -p %{buildroot}/%{_localstatedir}/lib/custodia
ee26c3
mkdir -p %{buildroot}/%{_localstatedir}/log/custodia
ee26c3
mkdir -p %{buildroot}/%{_localstatedir}/run/custodia
ee26c3
ee26c3
install -m 644 -t "%{buildroot}/%{_mandir}/man7" man/custodia.7
ee26c3
install -m 644 -t "%{buildroot}/%{_defaultdocdir}/custodia" README API.md
ee26c3
install -m 644 -t "%{buildroot}/%{_defaultdocdir}/custodia/examples" custodia.conf
ee26c3
install -m 600 %{SOURCE2} %{buildroot}%{_sysconfdir}/custodia
ee26c3
install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}
ee26c3
install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}
ee26c3
install -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/custodia.conf
ee26c3
ee26c3
%py3_install
ee26c3
mv %{buildroot}/%{_bindir}/custodia %{buildroot}/%{_sbindir}/custodia
ee26c3
cp %{buildroot}/%{_sbindir}/custodia %{buildroot}/%{_sbindir}/custodia-3
ee26c3
cp %{buildroot}/%{_bindir}/custodia-cli %{buildroot}/%{_bindir}/custodia-cli-3
ee26c3
ee26c3
ee26c3
%pre
ee26c3
getent group custodia >/dev/null || groupadd -r custodia
ee26c3
getent passwd custodia >/dev/null || \
ee26c3
    useradd -r -g custodia -d / -s /sbin/nologin \
ee26c3
    -c "User for custodia" custodia
ee26c3
exit 0
ee26c3
ee26c3
ee26c3
%post
ee26c3
%systemd_post custodia@\*.socket
ee26c3
%systemd_post custodia@\*.service
ee26c3
ee26c3
ee26c3
%preun
ee26c3
%systemd_preun custodia@\*.socket
ee26c3
%systemd_preun custodia@\*.service
ee26c3
ee26c3
ee26c3
%postun
ee26c3
%systemd_postun custodia@\*.socket
ee26c3
%systemd_postun custodia@\*.service
ee26c3
ee26c3
ee26c3
%files
ee26c3
%doc README API.md
ee26c3
%doc %{_defaultdocdir}/custodia/examples/custodia.conf
ee26c3
%license LICENSE
ee26c3
%{_mandir}/man7/custodia*
ee26c3
%{_sbindir}/custodia
ee26c3
%{_bindir}/custodia-cli
ee26c3
%dir %attr(0700,custodia,custodia) %{_sysconfdir}/custodia
ee26c3
%config(noreplace) %attr(600,custodia,custodia) %{_sysconfdir}/custodia/custodia.conf
ee26c3
%attr(644,root,root)  %{_unitdir}/custodia@.socket
ee26c3
%attr(644,root,root)  %{_unitdir}/custodia@.service
ee26c3
%dir %attr(0700,custodia,custodia) %{_localstatedir}/lib/custodia
ee26c3
%dir %attr(0700,custodia,custodia) %{_localstatedir}/log/custodia
ee26c3
%dir %attr(0755,custodia,custodia) %{_localstatedir}/run/custodia
ee26c3
%{_tmpfilesdir}/custodia.conf
ee26c3
ee26c3
%files -n python%{python3_pkgversion}-custodia
ee26c3
%license LICENSE
ee26c3
%{python3_sitelib}/%{name}
ee26c3
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info
ee26c3
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}-nspkg.pth
ee26c3
%{_sbindir}/custodia-3
ee26c3
%{_bindir}/custodia-cli-3
ee26c3
ee26c3
ee26c3
%changelog
021e12
* Fri Nov 16 2018 Lumír Balhar <lbalhar@redhat.com> - 0.6.0-3
021e12
- Require platform-python-setuptools instead of python3-setuptools
021e12
- Resolves: rhbz#1650508
021e12
ee26c3
* Fri Jun 29 2018 Christian Heimes <cheimes@redhat.com> - 0.6.0-2
ee26c3
- Don't turn deprecation warnings into fatal errors
ee26c3
ee26c3
* Mon Jun 25 2018 Christian Heimes <cheimes@redhat.com> - 0.6.0-1
ee26c3
- New upstream release Custodia 0.6.0
ee26c3
- Run all tests again
ee26c3
- Remove etcd support and python3-custodia-extra
ee26c3
- Remove unnecesary conflict with old FreeIPA
ee26c3
ee26c3
* Wed Jun 20 2018 Petr Viktorin <pviktori@redhat.com> - 0.5.0-12
ee26c3
- Remove the Python 2 subpackage
ee26c3
- Skip a test that fails on a different logging/error message
ee26c3
- In %%check, use pytest directly rather than tox
ee26c3
ee26c3
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.0-11
ee26c3
- Escape macros in %%changelog
ee26c3
ee26c3
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-10
ee26c3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ee26c3
ee26c3
* Mon Aug 07 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-9
ee26c3
- freeipa 4.4.4-2.fc26 and newer are compatible with custodia 0.5
ee26c3
- Fix dependency to python2-jwcrypto >= 0.4.2
ee26c3
ee26c3
* Wed Aug 02 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-8
ee26c3
- Add PIP_IGNORE_INSTALLED
ee26c3
ee26c3
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-7
ee26c3
- Modernize spec
ee26c3
ee26c3
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-6
ee26c3
- Require latest python-jwcrypto with Python 3 fix
ee26c3
- Use python2 prefix for all Python 2 dependencies
ee26c3
ee26c3
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-5
ee26c3
- Add custodia user and named systemd instances
ee26c3
ee26c3
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-4
ee26c3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ee26c3
ee26c3
* Tue Jun 20 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-3
ee26c3
- Add systemd build requirement for tmpfilesdir and unitdir macros
ee26c3
ee26c3
* Mon Jun 19 2017 Christian Heimes <cheimes@redhat.com> - 0.5.0-2
ee26c3
- Skip etcd store on PPC64
ee26c3
- Add missing pre/post install hooks for systemd service
ee26c3
- Custodia 0.5 is compatible with FreeIPA 4.4.5 and newer
ee26c3
- Drop custodia user from tmpfiles.d conf
ee26c3
ee26c3
* Tue May 16 2017 Simo Sorce <simo@redhat.com> - 0.5.0-1
ee26c3
- New Custodia version
ee26c3
- Drop checks on sha512sum, these checks are already done by dist-git
ee26c3
ee26c3
* Tue Apr 11 2017 Christian Heimes <cheimes@redhat.com> - 0.3.1-3
ee26c3
- Run Python 3 tests with correct Python version
ee26c3
ee26c3
* Fri Apr 07 2017 Christian Heimes <cheimes@redhat.com> - 0.3.1-2
ee26c3
- Add conflict with FreeIPA < 4.5
ee26c3
ee26c3
* Mon Mar 27 2017 Christian Heimes <cheimes@redhat.com> - 0.3.1-1
ee26c3
- Upstream release 0.3.1
ee26c3
ee26c3
* Thu Mar 16 2017 Christian Heimes <cheimes@redhat.com> - 0.3.0-3
ee26c3
- Provide custodia-2 and custodia-3 scripts
ee26c3
ee26c3
* Thu Mar 02 2017 Christian Heimes <cheimes@redhat.com> - 0.3.0-2
ee26c3
- Run Custodia daemon with Python 3
ee26c3
- Resolves: Bug 1426737 - custodia: Provide a Python 3 subpackage
ee26c3
ee26c3
* Wed Mar 01 2017 Christian Heimes <cheimes@redhat.com> - 0.3.0-1
ee26c3
- Update to custodia 0.3.0
ee26c3
- Run tests with global site packages
ee26c3
- Add tmpfiles.d config for /run/custodia
ee26c3
ee26c3
* Wed Feb 22 2017 Christian Heimes <cheimes@redhat.com> - 0.2.0-4
ee26c3
- Add missing runtime requirement on python[23]-systemd.
ee26c3
- Drop unnecesary build dependency on python%%{python3_pkgversion}-configparser.
ee26c3
- Fix tests, don't try to download dnspython3.
ee26c3
ee26c3
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
ee26c3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ee26c3
ee26c3
* Thu Dec 22 2016 Miro Hrončok <mhroncok@redhat.com> - 0.2.0-2
ee26c3
- Rebuild for Python 3.6
ee26c3