diff --git a/python-yubico-1.3.2.tar.gz b/python-yubico-1.3.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e06cb5606e8a3c2899afe6752538955a27f05c87 Binary files /dev/null and b/python-yubico-1.3.2.tar.gz differ diff --git a/python-yubico-py3.patch b/python-yubico-py3.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a6588ab7d163fd1ff7ced92c348e5cdc1419f86 --- /dev/null +++ b/python-yubico-py3.patch @@ -0,0 +1,22 @@ +From 7e6e424ed579c53a0767ba71eb47345ae1e472ca Mon Sep 17 00:00:00 2001 +From: minus +Date: Sat, 12 Mar 2016 12:18:44 +0100 +Subject: [PATCH] fixed Python 3 compatibility for Yubikey 4 + +--- + yubico/yubikey_4_usb_hid.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/yubico/yubikey_4_usb_hid.py b/yubico/yubikey_4_usb_hid.py +index 31c6f5d..b44bb90 100644 +--- a/yubico/yubikey_4_usb_hid.py ++++ b/yubico/yubikey_4_usb_hid.py +@@ -104,7 +104,7 @@ def _read_capabilities(self): + frame = yubikey_frame.YubiKeyFrame(command=SLOT.YK4_CAPABILITIES) + self._device._write(frame) + response = self._device._read_response() +- r_len = ord(response[0]) ++ r_len = yubico_util.ord_byte(response[0]) + + # 1 byte length, 2 byte CRC. + if not yubico_util.validate_crc16(response[:r_len+3]): diff --git a/python-yubico.spec b/python-yubico.spec new file mode 100644 index 0000000000000000000000000000000000000000..801315fe0500dda3e1855ca91d26fcc66ffbe438 --- /dev/null +++ b/python-yubico.spec @@ -0,0 +1,55 @@ +%{!?_licensedir:%global license %%doc} + +Name: python-yubico +Version: 1.3.2 +Release: 11 +Summary: Python package for talking to YubiKeys +License: BSD +URL: https://github.com/Yubico/python-yubico +Source0: https://github.com/Yubico/python-yubico/archive/python-yubico-%{version}.tar.gz +Patch0000: python-yubico-py3.patch +BuildArch: noarch +obsoletes: python-yubico < %{version}-%{release} +%{?python_provide:%python_provide python2-yubico} +BuildRequires: pyusb python3-devel python3-setuptools python3-nose python3-pyusb + +%description +Python package for talking to YubiKeys + +%package -n python3-yubico +Summary: Python package for talking to YubiKeys +Requires: python3-pyusb + +%{?python_provide:%python_provide python3-yubico} + +%description -n python3-yubico +Python package for talking to YubiKeys. For Python 3. + +%package -n python3-yubico-help +Summary: Docs for python3-yubico + +%description -n python3-yubico-help +Docs for python2-yubico + +%prep +%autosetup -n python-yubico-python-yubico-%{version} -p1 + +%build +%py3_build + +%install +%py3_install + +%check +nosetests-%{python3_version} -e test_challenge_response -e test_serial -e test_status + +%files -n python3-yubico +%doc COPYING +%{python3_sitelib}/* + +%files -n python3-yubico-help +%doc NEWS README + +%changelog +* Tue Apr 14 2020 huanghaitao - 1.3.2-11 +- Package init diff --git a/python-yubico.yaml b/python-yubico.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8dfac2ec9010d25c03b1fccea5aab877744e4b0f --- /dev/null +++ b/python-yubico.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: Yubico/python-yubico +tag_prefix: ^ +seperator: .