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