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