3f9132
%if 0%{?fedora} || 0%{?rhel} > 7
3f9132
# Enable python3 build by default
3f9132
%bcond_without python3
3f9132
%else
3f9132
%bcond_with python3
3f9132
%endif
3f9132
3f9132
%if 0%{?rhel} > 7
3f9132
# Disable python2 build by default
3f9132
%bcond_with python2
3f9132
%else
3f9132
%bcond_without python2
3f9132
%endif
3f9132
3f9132
%global srcname jwcrypto
3f9132
3f9132
Name:           python-%{srcname}
3f9132
Version:        0.5.0
3f9132
Release:        1%{?dist}
3f9132
Summary:        Implements JWK, JWS, JWE specifications using python-cryptography
3f9132
3f9132
License:        LGPLv3+
3f9132
URL:            https://github.com/latchset/%{srcname}
3f9132
Source0:        https://github.com/latchset/%{srcname}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz
3f9132
3f9132
BuildArch:      noarch
3f9132
%if %{with python2}
3f9132
BuildRequires:  python2-devel
3f9132
BuildRequires:  python2-setuptools
3f9132
BuildRequires:  python2-cryptography >= 1.5
3f9132
BuildRequires:  python2-pytest
3f9132
%endif
3f9132
%if %{with python3}
3f9132
BuildRequires:  python%{python3_pkgversion}-devel
3f9132
BuildRequires:  python%{python3_pkgversion}-setuptools
3f9132
BuildRequires:  python%{python3_pkgversion}-cryptography >= 1.5
3f9132
BuildRequires:  python%{python3_pkgversion}-pytest
3f9132
%endif
3f9132
3f9132
%description
3f9132
Implements JWK, JWS, JWE specifications using python-cryptography
3f9132
3f9132
%if %{with python2}
3f9132
%package -n python2-%{srcname}
3f9132
Summary:        Implements JWK,JWS,JWE specifications using python-cryptography
3f9132
Requires:       python2-cryptography >= 1.5
3f9132
%{?python_provide:%python_provide python2-%{srcname}}
3f9132
3f9132
%description -n python2-%{srcname}
3f9132
Implements JWK, JWS, JWE specifications using python-cryptography
3f9132
%endif
3f9132
3f9132
%if %{with python3}
3f9132
%package -n python%{python3_pkgversion}-%{srcname}
3f9132
Summary:        Implements JWK, JWS, JWE specifications using python-cryptography
3f9132
Requires:       python%{python3_pkgversion}-cryptography >= 1.5
3f9132
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
3f9132
3f9132
%description -n python%{python3_pkgversion}-%{srcname}
3f9132
Implements JWK, JWS, JWE specifications using python-cryptography
3f9132
%endif
3f9132
3f9132
3f9132
%prep
3f9132
%setup -q -n %{srcname}-%{version}
3f9132
3f9132
3f9132
%build
3f9132
%if %{with python2}
3f9132
%py2_build
3f9132
%endif
3f9132
%if %{with python3}
3f9132
%py3_build
3f9132
%endif
3f9132
3f9132
3f9132
%check
3f9132
%if %{with python2}
3f9132
%{__python2} -bb -m pytest %{srcname}/test*.py
3f9132
%endif
3f9132
%if %{with python3}
3f9132
%{__python3} -bb -m pytest %{srcname}/test*.py
3f9132
%endif
3f9132
3f9132
3f9132
%install
3f9132
%if %{with python2}
3f9132
%py2_install
3f9132
rm -rf %{buildroot}%{_docdir}/%{srcname}
3f9132
rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/tests{,-cookbook}.py*
3f9132
%endif
3f9132
%if %{with python3}
3f9132
%py3_install
3f9132
rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/tests{,-cookbook}.py*
3f9132
rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/__pycache__/tests{,-cookbook}.*.py*
3f9132
%endif
3f9132
rm -rf %{buildroot}/usr/share/doc/jwcrypto
3f9132
3f9132
%if %{with python2}
3f9132
%files -n python2-%{srcname}
3f9132
%doc README.md
3f9132
%license LICENSE
3f9132
%{python2_sitelib}/%{srcname}
3f9132
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
3f9132
%endif
3f9132
3f9132
%if %{with python3}
3f9132
%files -n python%{python3_pkgversion}-%{srcname}
3f9132
%doc README.md
3f9132
%license LICENSE
3f9132
%{python3_sitelib}/%{srcname}
3f9132
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
3f9132
%endif
3f9132
3f9132
3f9132
%changelog
3f9132
* Thu Jun 28 2018 Christian Heimes <cheimes@redhat.com> - 0.5.0-1
3f9132
- New upstream release 0.5.0
3f9132
- Fixes Coverity scan issue
3f9132
3f9132
* Mon Apr 16 2018 Christian Heimes <cheimes@redhat.com> - 0.4.2-5
3f9132
- Drop Python 2 subpackages from RHEL 8, fixes RHBZ#1567152
3f9132
3f9132
* Thu Nov 23 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-4
3f9132
- Build Python 3 package on RHEL > 7, fixes RHBZ#1516813
3f9132
3f9132
* Wed Aug 02 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-3
3f9132
- Run tests with bytes warning
3f9132
3f9132
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-2
3f9132
- Modernize spec
3f9132
3f9132
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-1
3f9132
- Upstream release 0.4.2
3f9132
- Resolves: RHBZ #1476150
3f9132
3f9132
* Mon Jul 24 2017 Christian Heimes <cheimes@redhat.com> - 0.4.1-1
3f9132
- Upstream release 0.4.1
3f9132
3f9132
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-3
3f9132
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
3f9132
3f9132
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.3.2-2
3f9132
- Rebuild for Python 3.6
3f9132
3f9132
* Wed Aug 31 2016 Simo Sorce <simo@redhat.com> - 0.3.2-1
3f9132
- Security release 0.3.2
3f9132
- Resolves: CVE-2016-6298
3f9132
3f9132
* Fri Aug 19 2016 Simo Sorce <simo@redhat.com> - 0.3.1-1
3f9132
- Bugfix release 0.3.1
3f9132
3f9132
* Wed Aug 10 2016 Simo Sorce <simo@redhat.com> - 0.3.0-1
3f9132
- New release
3f9132
3f9132
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-4
3f9132
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
3f9132
3f9132
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-3
3f9132
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3f9132
3f9132
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-2
3f9132
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
3f9132
3f9132
* Mon Aug  3 2015 Simo Sorce <simo@redhat.com> - 0.2.1-1
3f9132
- New release
3f9132
- Fixes some key generation issues
3f9132
3f9132
* Mon Jun 22 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-5
3f9132
- Fix macro in changelog
3f9132
- Remove the last remnants of the test suite
3f9132
3f9132
* Wed Jun 17 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-4
3f9132
- Ship readme and license with python3 subpackage
3f9132
- Move tests to %%check
3f9132
3f9132
* Wed Jun 17 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-3
3f9132
- Fix F21 build error by adding buildrequire python-setuptools
3f9132
- Move files into python3-jwcrypto subpackage
3f9132
- Run test suite
3f9132
- Do not install test suite
3f9132
- Fix summary and description of python3-jwcrypto
3f9132
3f9132
* Tue Jun 16 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-2
3f9132
- Enable python3 build
3f9132
3f9132
* Tue Jun 16 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-1
3f9132
- Initial packaging