Compare commits

...

No commits in common. "c8s-stream-DL1" and "c9s" have entirely different histories.

7 changed files with 112 additions and 42 deletions

10
.gitignore vendored
View File

@ -1 +1,9 @@
SOURCES/pyusb-1.0.0.zip
/tests/artifacts/
pyusb-0.4.1.tar.gz
/pyusb-1.0.0-a1.tar.gz
/pyusb-1.0.0a2.tar.gz
/pyusb-1.0.0a3.tar.gz
/pyusb-1.0.0b1.zip
/pyusb-1.0.0b2.zip
/pyusb-1.0.0.zip
/pyusb-1.0.2.tar.gz

View File

@ -1 +0,0 @@
1cc42e901b580c7396830c74c87363a789e5c0cd SOURCES/pyusb-1.0.0.zip

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# recipients: abokovoy, frenaud, kaleem, ftrivino, cheimes
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,17 +1,10 @@
%if 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
Name: pyusb
Version: 1.0.0
Release: 9.1%{?dist}
Version: 1.0.2
Release: 13%{?dist}
Summary: Python bindings for libusb
License: BSD
URL: http://pyusb.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.zip
URL: https://github.com/pyusb/pyusb/
Source0: https://github.com/pyusb/pyusb/archive/pyusb-%{version}.tar.gz
BuildRequires: libusb-devel
BuildArch: noarch
@ -21,22 +14,11 @@ methods to support most USB operations.
%description %_description
%if %{with python2}
%package -n python2-pyusb
Summary: %summary
%{?python_provide:%python_provide python2-pyusb}
BuildRequires: python2-devel
# Remove before F30
Provides: pyusb = %{version}-%{release}
Obsoletes: pyusb < %{version}-%{release}
%description -n python2-pyusb %_description
%endif # with python2
%package -n python3-pyusb
Summary: %summary
%{?python_provide:%python_provide python3-pyusb}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%description -n python3-pyusb
PyUSB provides easy USB access to python. The module contains classes and
@ -47,35 +29,62 @@ methods to support most USB operations.
sed -i -e 's/\r//g' README.rst
%build
%if %{with python2}
%py2_build
%endif # with python2
%py3_build
%install
%if %{with python2}
%py2_install
%endif # with python2
%py3_install
%if %{with python2}
%files -n python2-pyusb
%license LICENSE
%doc README.rst
%{python2_sitelib}/*
%endif # with python2
%files -n python3-pyusb
%license LICENSE
%doc README.rst
%{python3_sitelib}/*
%changelog
* Thu Jun 16 2022 Florence Blanc-Renaud <frenaud@redhat.com> - 1.0.0-9.1
- Rebuilt to fix the NVR issue (#2094880)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.2-13
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.0.0-9
- Conditionalize the python2 subpackage
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.2-12
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jun 23 2020 Gwyn Ciesla <gwync@protonmail.com> - 1.0.2-9
- BR python3-setuptools
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.0.2-8
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Oct 21 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.0.2-6
- Drop Python 2.
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.2-5
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Sun Aug 18 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.2-4
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Aug 10 2018 Gwyn Ciesla <limburgher@gmail.com> - 1.0.2-1
- 1.0.2
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-9
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (pyusb-1.0.2.tar.gz) = 6a264b796e17612004196a7a526a7c6df99feac9062f8354540221016411a78a65d413731aea2fc1206ed5ea2b84787078898b9ca3754164f1dfe2a9878b75a5

33
tests/test_ipa_yubico_api.py Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/python3
"""Simple test for APIs used by python-yubico
"""
import logging
import usb.core
import usb.legacy
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
def main():
for d in usb.core.find(find_all=True):
usb_device = usb.legacy.Device(d)
# import pdb; pdb.set_trace()
log.info(vars(usb_device))
assert usb_device.idVendor
assert usb_device.idProduct
usb_conf = usb_device.configurations[0]
log.info(vars(usb_conf))
usb_int = usb_conf.interfaces[0][0]
try:
usb_handle = usb_device.open()
assert usb_handle.controlMsg.__call__
usb_handle.releaseInterface()
except usb.core.USBError:
log.info("Unable to open USB device")
log.info("PASS")
if __name__ == "__main__":
main()

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-source
- role: standard-test-basic
required_packages:
- python3-pyusb
tests:
- test_ipa_yubico_api:
dir: "tests"
run: ./test_ipa_yubico_api.py