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