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