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