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