98e020
%if 0%{?rhel} != 0 && 0%{?rhel} <= 6
98e020
%{!?__python2: %global __python2 /usr/bin/python2}
98e020
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
98e020
%endif
98e020
98e020
Name:           python-yubico
98e020
Version:        1.2.3
98e020
Release:        1%{?dist}
98e020
Summary:        Pure-python library for interacting with Yubikeys
98e020
98e020
License:        BSD
98e020
URL:            https://github.com/Yubico/python-yubico
98e020
Source0:        https://github.com/Yubico/python-yubico/archive/%{name}-%{version}.tar.gz
98e020
98e020
BuildArch:      noarch
98e020
BuildRequires:  python2-devel
98e020
BuildRequires:  python-setuptools
98e020
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
98e020
BuildRequires:  python-nose
98e020
BuildRequires:  pyusb
98e020
%endif
98e020
Requires:       pyusb
98e020
98e020
%description
98e020
Pure-python library for interacting with Yubikeys
98e020
98e020
%prep
98e020
%setup -q -n %{name}-%{name}-%{version}
98e020
98e020
98e020
%build
98e020
sed -i 's|setup_requires=|tests_require=|' setup.py
98e020
%{__python2} setup.py build
98e020
98e020
98e020
%install
98e020
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
98e020
98e020
98e020
%files
98e020
%doc COPYING NEWS README
98e020
%{python2_sitelib}/*
98e020
98e020
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
98e020
%check
98e020
# Exclude tests that require a physical yubikey attached.
98e020
nosetests -e test_challenge_response -e test_serial -e test_status
98e020
%endif
98e020
98e020
%changelog
98e020
* Mon Mar 23 2015 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.3-1
98e020
- Upstream 1.2.3
98e020
- Require pyusb during building when running tests
98e020
98e020
* Mon Jun 23 2014 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-3
98e020
- Enable build on EL6.
98e020
98e020
* Sat Jun 21 2014 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-2
98e020
- Run upstream tests during build.
98e020
98e020
* Thu Jun 19 2014 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-1
98e020
- Initial release.