Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

Name:           custodia
Version:        0.1.0
Release:        6%{?dist}
Summary:        A service to manage, retrieve and store secrets for other processes.

License:        GPLv3+
URL:            https://github.com/latchset/%{name}
Source0:        https://github.com/latchset/%{name}/releases/download/v%{version}/custodia-%{version}.tar.gz
Source1:        https://github.com/latchset/%{name}/releases/download/v%{version}/custodia-%{version}.tar.gz.sha512sum.txt

BuildArch:      noarch

BuildRequires:      python-devel
BuildRequires:      python-setuptools
BuildRequires:      python-jwcrypto
BuildRequires:      python-tox
BuildRequires:      python-coverage
BuildRequires:      pytest
Requires:           python-jwcrypto
Requires:           python-custodia

%if 0%{?with_python3}
BuildRequires:      python3-devel
BuildRequires:      python3-setuptools
BuildRequires:      python3-jwcrypto
BuildRequires:      python3-coverage
BuildRequires:      python3-tox
BuildRequires:      python3-pytest
%endif

Patch01: 0001-Allow-tox-to-use-locally-installed-packages.patch

%description
A service to manage, retrieve and store secrets for other processes.

%package -n python-custodia
Summary:    Subpackage with python custodia modules
Requires:   python-jwcrypto

%description -n python-custodia
Subpackage with python custodia modules

%if 0%{?with_python3}
%package -n python3-custodia
Summary:    Subpackage with python3 custodia modules
Requires:   python3-jwcrypto

%description -n python3-custodia
Subpackage with python custodia modules
%endif

%prep
grep `sha512sum %{SOURCE0}` %{SOURCE1} || (echo "Checksum invalid!" && exit 1)
%autosetup

%build
%{__python2} setup.py build
%if 0%{?with_python3}
%{__python3} setup.py build
%endif


%check
mkdir docs/source/_static
tox -e py27
#%if 0%{?with_python3}
#tox -e py34
#%endif


%install
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
mv %{buildroot}/usr/share/doc/custodia _doc_staging
rm -rf %{buildroot}%{python2_sitelib}/tests
mkdir -p %{buildroot}/%{_sbindir}
mv %{buildroot}/%{_bindir}/custodia %{buildroot}/%{_sbindir}/custodia
%if 0%{?with_python3}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
rm -rf %{buildroot}/usr/share/doc/custodia
rm -rf %{buildroot}%{python3_sitelib}/tests
rm -rf %{buildroot}/%{_bindir}/custodia
%endif


%files
%doc README API.md _doc_staging/*
%license LICENSE
%{_mandir}/man7/custodia*
%{_sbindir}/custodia

%files -n python-custodia
%license LICENSE
%{python2_sitelib}/%{name}/*
%{python2_sitelib}/%{name}*.egg-info

%if 0%{?with_python3}
%files -n python3-custodia
%license LICENSE
%{python3_sitelib}/%{name}/*
%{python3_sitelib}/%{name}*.egg-info
%endif


%changelog
* Wed Mar 01 2017 Christian Heimes <cheimes@redhat.com> - 0.1.0-6
- tox is now provided by python3-tox

* Wed Mar 01 2017 Christian Heimes <cheimes@redhat.com> - 0.1.0-5
- Don't package tests
- Resolves: Bug 1418796

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.0-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Aug 17 2015 Simo Sorce <simo@redhat.com> - 0.1.0-1
- Initial packaging