ceb876
%{!?_licensedir:%global license %%doc}
ceb876
ceb876
%global srcname yubico
ceb876
ceb876
%if 0%{?rhel} > 7
ceb876
# Disable python2 build by default
ceb876
%bcond_with python2
ceb876
%else
ceb876
%bcond_without python2
ceb876
%endif
ceb876
ceb876
Name:           python-%{srcname}
ceb876
Version:        1.3.2
301f82
Release:        9.1%{?dist}
ceb876
Summary:        Pure-python library for interacting with Yubikeys
ceb876
ceb876
License:        BSD
ceb876
URL:            https://github.com/Yubico/%{name}
ceb876
Source0:        https://github.com/Yubico/%{name}/archive/%{name}-%{version}.tar.gz
ceb876
Patch0:         python-yubico-py3.patch
ceb876
ceb876
BuildArch:      noarch
ceb876
ceb876
%if %{with python2}
ceb876
BuildRequires:  python2-devel
ceb876
BuildRequires:  python2-setuptools
ceb876
BuildRequires:  python2-nose
ceb876
BuildRequires:  python2-pyusb
ceb876
%endif # with python2
ceb876
ceb876
BuildRequires:  python3-devel
ceb876
BuildRequires:  python3-setuptools
ceb876
BuildRequires:  python3-nose
ceb876
BuildRequires:  python3-pyusb
ceb876
ceb876
%description
ceb876
Pure-python library for interacting with Yubikeys
ceb876
ceb876
%if %{with python2}
ceb876
%package -n python2-%{srcname}
ceb876
Summary:        Pure-python library for interacting with Yubikeys
ceb876
Requires:       pyusb
ceb876
Obsoletes:      python-yubico < %{version}-%{release}
ceb876
ceb876
%{?python_provide:%python_provide python2-%{srcname}}
ceb876
ceb876
%description -n python2-%{srcname}
ceb876
Pure-python library for interacting with Yubikeys. For Python 2.
ceb876
%endif # with python2
ceb876
ceb876
%package -n python3-%{srcname}
ceb876
Summary:        Pure-python library for interacting with Yubikeys
ceb876
Requires:       python3-pyusb
ceb876
ceb876
%{?python_provide:%python_provide python3-%{srcname}}
ceb876
ceb876
%description -n python3-%{srcname}
ceb876
Pure-python library for interacting with Yubikeys. For Python 3.
ceb876
ceb876
ceb876
%prep
ceb876
%autosetup -n %{name}-%{name}-%{version} -p1
ceb876
ceb876
ceb876
%build
ceb876
%if %{with python2}
ceb876
%py2_build
ceb876
%endif # with python2
ceb876
%py3_build
ceb876
ceb876
ceb876
%install
ceb876
%if %{with python2}
ceb876
%py2_install
ceb876
%endif # with python2
ceb876
%py3_install
ceb876
ceb876
ceb876
%check
ceb876
%if %{with python2}
ceb876
nosetests-%{python2_version} -e test_challenge_response -e test_serial -e test_status
ceb876
%endif # with python2
ceb876
nosetests-%{python3_version} -e test_challenge_response -e test_serial -e test_status
ceb876
ceb876
%if %{with python2}
ceb876
%files -n python2-%{srcname}
ceb876
%license COPYING
ceb876
%doc NEWS README
ceb876
%{python2_sitelib}/*
ceb876
%endif # with python2
ceb876
ceb876
%files -n python3-%{srcname}
ceb876
%license COPYING
ceb876
%doc NEWS README
ceb876
%{python3_sitelib}/*
ceb876
ceb876
ceb876
%changelog
301f82
* Thu Jun 16 2022 Florence Blanc-Renaud <frenaud@redhat.com> - 1.3.2-9.1
301f82
- Rebuilt to fix NVR issue (#2097803)
301f82
ceb876
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.3.2-9
ceb876
- Conditionalize the python2 subpackage
ceb876
ceb876
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-8
ceb876
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ceb876
ceb876
* Thu Aug 24 2017 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.2-7
ceb876
- Backport an upstream python3 fix (#1484862)
ceb876
ceb876
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-6
ceb876
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ceb876
ceb876
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-5
ceb876
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ceb876
ceb876
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.3.2-4
ceb876
- Rebuild for Python 3.6
ceb876
ceb876
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-3
ceb876
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ceb876
ceb876
* Wed May 11 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.2-2
ceb876
- Add missing provide for python-yubico
ceb876
- Add missing obsoletes for python-yubico
ceb876
ceb876
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.2-1
ceb876
- Cleanup obsolete conditions (like RHEL 6)
ceb876
- Update to v1.3.2
ceb876
ceb876
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-6
ceb876
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ceb876
ceb876
* Mon Jan 11 2016 Will Thompson <will@willthompson.co.uk> - 1.2.3-5
ceb876
- Add python3-pyusb dependency to python3 subpackage (#1278210)
ceb876
ceb876
* Mon Jan 11 2016 Ville Skyttä <ville.skytta@iki.fi>
ceb876
- Ship COPYING as %%license where applicable
ceb876
ceb876
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
ceb876
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
ceb876
ceb876
* Mon Jul 20 2015 Miro Hrončok <mhroncok@redhat.com> - 1.2.3-3
ceb876
- Add Python 3 subpackage (#1244237)
ceb876
ceb876
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-2
ceb876
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ceb876
ceb876
* Mon Mar 23 2015 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.3-1
ceb876
- Upstream 1.2.3
ceb876
- Require pyusb during building when running tests
ceb876
ceb876
* Mon Jun 23 2014 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-3
ceb876
- Enable build on EL6.
ceb876
ceb876
* Sat Jun 21 2014 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-2
ceb876
- Run upstream tests during build.
ceb876
ceb876
* Thu Jun 19 2014 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-1
ceb876
- Initial release.