Import rpm: 3b6cbc9fbe5ee192ef3b3f9048d4f4f243ace381

This commit is contained in:
James Antill 2023-02-20 01:58:19 -05:00
commit 05fbe7f04f
6 changed files with 224 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
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}

169
pyusb.spec Normal file
View File

@ -0,0 +1,169 @@
%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}
Summary: Python bindings for libusb
License: BSD
URL: http://pyusb.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.zip
BuildRequires: libusb-devel
BuildArch: noarch
%global _description\
PyUSB provides easy USB access to python. The module contains classes and\
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
%description -n python3-pyusb
PyUSB provides easy USB access to python. The module contains classes and
methods to support most USB operations.
%prep
%autosetup
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 Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.0.0-9
- Conditionalize the python2 subpackage
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Sep 05 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.0.0-7
- Cleanup packaging and fix archful provide in noarch package
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.0-6
- Python 2 binary package renamed to python2-pyusb
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-3
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Tue Jun 14 2016 Jon Ciesla <limburgher@gmail.com> - 1.0.0-1
- Latest upstream, BZ 1192561.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-0.14.b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.13.b2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.12.b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Feb 13 2015 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.11.b2
- Latest upstream, BZ 1192561.
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.10.b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0.0-0.9.b1
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Mon Nov 11 2013 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.8.b1
- Latest upstream.
- Add python3 support, spec cleanup, BZ 1022851.
- Fixed changelog.
* Fri Sep 13 2013 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.7.a3
- Latest upstream.
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.6.a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.5.a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.4.a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jan 23 2012 Tim Waugh <twaugh@redhat.com> - 1.0.0-0.3.a2
- 1.0.0-a2.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.2.a1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Jun 30 2011 Tim Waugh <twaugh@redhat.com> - 1.0.0-0.1.a1
- 1.0.0-a1 (bug #586950).
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.4.1-3
- Rebuild for Python 2.6
* Mon Jun 16 2008 Jeremy Katz <katzj@redhat.com> - 0.4.1-2
- Fix end-of-line in README
* Mon Jun 16 2008 Jeremy Katz <katzj@redhat.com> - 0.4.1-1
- Initial packaging

1
sources Normal file
View File

@ -0,0 +1 @@
SHA1 (pyusb-1.0.0.zip) = 1cc42e901b580c7396830c74c87363a789e5c0cd

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