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