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