a73e6d
%if 0%{?fedora} || 0%{?rhel} > 7
a73e6d
# Enable python3 build by default
a73e6d
%bcond_without python3
a73e6d
%else
a73e6d
%bcond_with python3
a73e6d
%endif
a73e6d
a73e6d
%if 0%{?fedora} > 31 || 0%{?rhel} > 7
a73e6d
# Disable python2 build by default
a73e6d
%bcond_with python2
a73e6d
%else
a73e6d
%bcond_without python2
a73e6d
%endif
a73e6d
a73e6d
%global srcname jwcrypto
a73e6d
a73e6d
Name:           python-%{srcname}
a73e6d
Version:        0.8
a73e6d
Release:        4%{?dist}
a73e6d
Summary:        Implements JWK, JWS, JWE specifications using python-cryptography
a73e6d
a73e6d
License:        LGPLv3+
a73e6d
URL:            https://github.com/latchset/%{srcname}
a73e6d
Source0:        https://github.com/latchset/%{srcname}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz
a73e6d
a73e6d
BuildArch:      noarch
a73e6d
%if 0%{?with_python2}
a73e6d
BuildRequires:  python2-devel
a73e6d
BuildRequires:  python2-setuptools
a73e6d
BuildRequires:  python2-cryptography >= 1.5
a73e6d
BuildRequires:  python2-pytest
a73e6d
%endif
a73e6d
a73e6d
%if 0%{?with_python3}
a73e6d
BuildRequires:  python%{python3_pkgversion}-devel
a73e6d
BuildRequires:  python%{python3_pkgversion}-setuptools
a73e6d
BuildRequires:  python%{python3_pkgversion}-cryptography >= 1.5
a73e6d
BuildRequires:  python%{python3_pkgversion}-pytest
a73e6d
%endif
a73e6d
a73e6d
%description
a73e6d
Implements JWK, JWS, JWE specifications using python-cryptography
a73e6d
a73e6d
a73e6d
%if 0%{?with_python2}
a73e6d
%package -n python2-%{srcname}
a73e6d
Summary:        Implements JWK,JWS,JWE specifications using python-cryptography
a73e6d
Requires:       python2-cryptography >= 1.5
a73e6d
%{?python_provide:%python_provide python2-%{srcname}}
a73e6d
a73e6d
%description -n python2-%{srcname}
a73e6d
Implements JWK, JWS, JWE specifications using python-cryptography
a73e6d
%endif
a73e6d
a73e6d
a73e6d
%if 0%{?with_python3}
a73e6d
%package -n python%{python3_pkgversion}-%{srcname}
a73e6d
Summary:        Implements JWK, JWS, JWE specifications using python-cryptography
a73e6d
Requires:       python%{python3_pkgversion}-cryptography >= 1.5
a73e6d
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
a73e6d
a73e6d
%description -n python%{python3_pkgversion}-%{srcname}
a73e6d
Implements JWK, JWS, JWE specifications using python-cryptography
a73e6d
%endif
a73e6d
a73e6d
a73e6d
%prep
a73e6d
%setup -q -n %{srcname}-%{version}
a73e6d
a73e6d
a73e6d
%build
a73e6d
%if 0%{?with_python2}
a73e6d
%py2_build
a73e6d
%endif
a73e6d
%if 0%{?with_python3}
a73e6d
%py3_build
a73e6d
%endif
a73e6d
a73e6d
a73e6d
%check
a73e6d
%if 0%{?with_python2}
a73e6d
%{__python2} -bb -m pytest %{srcname}/test*.py
a73e6d
%endif
a73e6d
%if 0%{?with_python3}
a73e6d
%{__python3} -bb -m pytest %{srcname}/test*.py
a73e6d
%endif
a73e6d
a73e6d
a73e6d
%install
a73e6d
%if 0%{?with_python2}
a73e6d
%py2_install
a73e6d
%endif
a73e6d
%if 0%{?with_python3}
a73e6d
%py3_install
a73e6d
%endif
a73e6d
a73e6d
rm -rf %{buildroot}%{_docdir}/%{srcname}
a73e6d
%if 0%{?with_python2}
a73e6d
rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/tests{,-cookbook}.py*
a73e6d
%endif
a73e6d
%if 0%{?with_python3}
a73e6d
rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/tests{,-cookbook}.py*
a73e6d
rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/__pycache__/tests{,-cookbook}.*.py*
a73e6d
%endif
a73e6d
a73e6d
a73e6d
%if 0%{?with_python2}
a73e6d
%files -n python2-%{srcname}
a73e6d
%doc README.md
a73e6d
%license LICENSE
a73e6d
%{python2_sitelib}/%{srcname}
a73e6d
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
a73e6d
%endif
a73e6d
a73e6d
%if 0%{?with_python3}
a73e6d
%files -n python%{python3_pkgversion}-%{srcname}
a73e6d
%doc README.md
a73e6d
%license LICENSE
a73e6d
%{python3_sitelib}/%{srcname}
a73e6d
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
a73e6d
%endif
a73e6d
a73e6d
a73e6d
%changelog
a73e6d
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-4
a73e6d
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
a73e6d
  Related: rhbz#1991688
a73e6d
a73e6d
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-3
a73e6d
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
a73e6d
a73e6d
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-2
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
a73e6d
a73e6d
* Tue Dec 01 2020 Simo Sorce <simo@redhat.com> - 0.8-1
a73e6d
- Sync with upstream release 0.8
a73e6d
a73e6d
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-9
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
a73e6d
a73e6d
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-8
a73e6d
- Rebuilt for Python 3.9
a73e6d
a73e6d
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-7
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a73e6d
a73e6d
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-6
a73e6d
- Rebuilt for Python 3.8.0rc1 (#1748018)
a73e6d
a73e6d
* Thu Aug 29 2019 Christian Heimes <cheimes@redhat.com> - 0.6.0-5
a73e6d
- Remove Python 2 subpackages from F32+
a73e6d
- Resolves: RHBZ #1746760
a73e6d
a73e6d
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-4
a73e6d
- Rebuilt for Python 3.8
a73e6d
a73e6d
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a73e6d
a73e6d
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-2
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
a73e6d
a73e6d
* Mon Nov 05 2018 Christian Heimes <cheimes@redhat.com> - 0.6.0-1
a73e6d
- New upstream release 0.6.0
a73e6d
a73e6d
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a73e6d
a73e6d
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 0.5.0-2
a73e6d
- Rebuilt for Python 3.7
a73e6d
a73e6d
* Wed Jun 27 2018 Christian Heimes <cheimes@redhat.com> - 0.5.0-1
a73e6d
- New upstream release 0.5.0
a73e6d
a73e6d
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.2-5
a73e6d
- Rebuilt for Python 3.7
a73e6d
a73e6d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-4
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a73e6d
a73e6d
* Wed Aug 02 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-3
a73e6d
- Run tests with bytes warning
a73e6d
a73e6d
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-2
a73e6d
- Modernize spec
a73e6d
a73e6d
* Tue Aug 01 2017 Christian Heimes <cheimes@redhat.com> - 0.4.2-1
a73e6d
- Upstream release 0.4.2
a73e6d
- Resolves: RHBZ #1476150
a73e6d
a73e6d
* Mon Jul 24 2017 Christian Heimes <cheimes@redhat.com> - 0.4.1-1
a73e6d
- Upstream release 0.4.1
a73e6d
a73e6d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-3
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a73e6d
a73e6d
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.3.2-2
a73e6d
- Rebuild for Python 3.6
a73e6d
a73e6d
* Wed Aug 31 2016 Simo Sorce <simo@redhat.com> - 0.3.2-1
a73e6d
- Security release 0.3.2
a73e6d
- Resolves: CVE-2016-6298
a73e6d
a73e6d
* Fri Aug 19 2016 Simo Sorce <simo@redhat.com> - 0.3.1-1
a73e6d
- Bugfix release 0.3.1
a73e6d
a73e6d
* Wed Aug 10 2016 Simo Sorce <simo@redhat.com> - 0.3.0-1
a73e6d
- New release
a73e6d
a73e6d
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-4
a73e6d
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
a73e6d
a73e6d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-3
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a73e6d
a73e6d
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-2
a73e6d
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
a73e6d
a73e6d
* Mon Aug  3 2015 Simo Sorce <simo@redhat.com> - 0.2.1-1
a73e6d
- New release
a73e6d
- Fixes some key generation issues
a73e6d
a73e6d
* Mon Jun 22 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-5
a73e6d
- Fix macro in changelog
a73e6d
- Remove the last remnants of the test suite
a73e6d
a73e6d
* Wed Jun 17 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-4
a73e6d
- Ship readme and license with python3 subpackage
a73e6d
- Move tests to %%check
a73e6d
a73e6d
* Wed Jun 17 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-3
a73e6d
- Fix F21 build error by adding buildrequire python-setuptools
a73e6d
- Move files into python3-jwcrypto subpackage
a73e6d
- Run test suite
a73e6d
- Do not install test suite
a73e6d
- Fix summary and description of python3-jwcrypto
a73e6d
a73e6d
* Tue Jun 16 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-2
a73e6d
- Enable python3 build
a73e6d
a73e6d
* Tue Jun 16 2015 Patrick Uiterwijk <puiterwijk@redhat.com> - 0.2.0-1
a73e6d
- Initial packaging