cd1b8a
Summary:        Library for accessing USB devices
cd1b8a
Name:           libusbx
311d97
Version:        1.0.23
311d97
Release:        4%{?dist}
cd1b8a
# upstream libusbx has merged back with libusb and is now called libusb again
cd1b8a
# but we already have a libusb package for the old libusb-compat-0.1, renaming
cd1b8a
# that to libusb-compat while at the same time giving this its name is a bit
cd1b8a
# tricky, lets stick with the libusbx name for now
cd1b8a
Source0:        https://github.com/libusb/libusb/archive/v%{version}/libusb-%{version}.tar.gz
311d97
Patch0001:      0001-fix-constant-not-in-range-of-enumerated-type.patch
311d97
Patch0002:      0002-Doxygen-add-libusb_wrap_sys_device-in-the-API-list.patch
311d97
Patch0003:      0003-Linux-backend-fix-ressource-leak.patch
311d97
Patch0004:      0004-Linux-Improved-system-out-of-memory-handling.patch
311d97
Patch0005:      0005-linux_udev-silently-ignore-bind-action.patch
311d97
Patch0006:      0006-Add-Null-POSIX-backend.patch
311d97
Patch0007:      0007-core-fix-build-warning-on-newer-versions-of-gcc.patch
311d97
Patch0008:      0008-core-Fix-libusb_get_max_iso_packet_size-for-superspe.patch
311d97
Patch0009:      0009-core-Do-not-attempt-to-destroy-a-default-context-tha.patch
311d97
Patch0010:      0010-linux_usbfs-Wait-until-all-URBs-have-been-reaped-bef.patch
311d97
311d97
# Downstream only - a simple fix for a covscan issue.
311d97
Patch1000:      1000-Downstream-fix-covscan-issue-close-fd-called-twice.patch
311d97
311d97
cd1b8a
License:        LGPLv2+
cd1b8a
Group:          System Environment/Libraries
cd1b8a
URL:            http://libusb.info
cd1b8a
BuildRequires:  systemd-devel doxygen libtool
cd1b8a
Provides:       libusb1 = %{version}-%{release}
cd1b8a
Obsoletes:      libusb1 <= 1.0.9
cd1b8a
cd1b8a
%description
cd1b8a
This package provides a way for applications to access USB devices.
cd1b8a
cd1b8a
Libusbx is a fork of the original libusb, which is a fully API and ABI
cd1b8a
compatible drop in for the libusb-1.0.9 release. The libusbx fork was
cd1b8a
started by most of the libusb-1.0 developers, after the original libusb
cd1b8a
project did not produce a new release for over 18 months.
cd1b8a
cd1b8a
Note that this library is not compatible with the original libusb-0.1 series,
cd1b8a
if you need libusb-0.1 compatibility install the libusb package.
cd1b8a
cd1b8a
cd1b8a
%package        devel
cd1b8a
Summary:        Development files for %{name}
cd1b8a
Group:          Development/Libraries
cd1b8a
Requires:       %{name}%{?_isa} = %{version}-%{release}
cd1b8a
Provides:       libusb1-devel = %{version}-%{release}
cd1b8a
Obsoletes:      libusb1-devel <= 1.0.9
cd1b8a
cd1b8a
%description    devel
cd1b8a
The %{name}-devel package contains libraries and header files for
cd1b8a
developing applications that use %{name}.
cd1b8a
cd1b8a
cd1b8a
%package devel-doc
cd1b8a
Summary:        Development files for %{name}
cd1b8a
Group:          Development/Libraries
cd1b8a
Provides:       libusb1-devel-doc = %{version}-%{release}
cd1b8a
Obsoletes:      libusb1-devel-doc <= 1.0.9
cd1b8a
BuildArch:      noarch
cd1b8a
cd1b8a
%description devel-doc
cd1b8a
This package contains API documentation for %{name}.
cd1b8a
cd1b8a
311d97
%package        tests-examples
311d97
Summary:        Tests and examples for %{name}
311d97
Requires:       %{name}%{?_isa} = %{version}-%{release}
311d97
311d97
%description tests-examples
311d97
This package contains tests and examples for %{name}.
311d97
311d97
cd1b8a
%prep
311d97
%autosetup -S git_am -n libusb-%{version}
311d97
chmod -x examples/*.c
cd1b8a
mkdir -p m4
cd1b8a
autoreconf -ivf
cd1b8a
cd1b8a
cd1b8a
%build
cd1b8a
%configure --disable-static --enable-examples-build
cd1b8a
make %{?_smp_mflags}
cd1b8a
pushd doc
cd1b8a
make docs
cd1b8a
popd
311d97
pushd tests
311d97
make
311d97
popd
cd1b8a
cd1b8a
cd1b8a
%install
cd1b8a
%make_install
311d97
mkdir -p $RPM_BUILD_ROOT%{_bindir}
311d97
install -m 755 tests/.libs/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress
311d97
install -m 755 examples/.libs/testlibusb \
311d97
    $RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb
311d97
# Some examples are very device-specific / require specific hw and miss --help
311d97
# So we only install a subset of more generic / useful examples
311d97
for i in fxload listdevs xusb; do
311d97
    install -m 755 examples/.libs/$i \
311d97
        $RPM_BUILD_ROOT%{_bindir}/libusb-example-$i
311d97
done
cd1b8a
rm $RPM_BUILD_ROOT%{_libdir}/*.la
cd1b8a
cd1b8a
311d97
%check
311d97
LD_LIBRARY_PATH=libusb/.libs ldd $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress
311d97
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress
311d97
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb
311d97
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs
311d97
311d97
cd1b8a
%ldconfig_scriptlets
cd1b8a
cd1b8a
cd1b8a
%files
cd1b8a
%license COPYING
311d97
%doc AUTHORS README.md ChangeLog
cd1b8a
%{_libdir}/*.so.*
cd1b8a
cd1b8a
%files devel
cd1b8a
%{_includedir}/libusb-1.0
cd1b8a
%{_libdir}/*.so
cd1b8a
%{_libdir}/pkgconfig/libusb-1.0.pc
cd1b8a
cd1b8a
%files devel-doc
cd1b8a
%doc doc/html examples/*.c
cd1b8a
311d97
%files tests-examples
311d97
%{_bindir}/libusb-example-fxload
311d97
%{_bindir}/libusb-example-listdevs
311d97
%{_bindir}/libusb-example-xusb
311d97
%{_bindir}/libusb-test-stress
311d97
%{_bindir}/libusb-test-libusb
311d97
cd1b8a
cd1b8a
%changelog
311d97
* Wed Aug 12 2020 Victor Toso <victortoso@redhat.com> - 1.0.23-4
311d97
- Install README.md as README is only a symlink to .md
311d97
  Resolves: rhbz#1849682
311d97
311d97
* Fri Jun 26 2020 Uri Lublin <uril@redhat.com> - 1.0.23-3
311d97
- Fix covscan warning
311d97
  Related: rhbz#1825941
311d97
311d97
* Thu May 14 2020 Victor Toso <victortoso@redhat.com> - 1.0.23-2
311d97
- Cherry pick a few fixes since 1.0.23 release
311d97
- Related: rhbz#1825941
311d97
311d97
* Tue May 05 2020 Victor Toso <victortoso@redhat.com> - 1.0.23-1
311d97
- Update to 1.0.23
311d97
- Resolves: rhbz#1825941
311d97
311d97
* Mon Feb 17 2020 Hans de Goede <hdegoede@redhat.com> - 1.0.22-2
311d97
- Add tests-examples subpackage for use by gating tests
311d97
- Resolves: rhbz#1681769
311d97
cd1b8a
* Wed Aug 22 2018 Victor Toso <victortoso@redhat.com> - 1.0.22-1
cd1b8a
- Update to 1.0.22
cd1b8a
- Resolves: rhbz#1620092
cd1b8a
cd1b8a
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.21-6
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
cd1b8a
cd1b8a
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.21-5
cd1b8a
- Switch to %%ldconfig_scriptlets
cd1b8a
cd1b8a
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.21-4
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
cd1b8a
cd1b8a
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.21-3
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cd1b8a
cd1b8a
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.21-2
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cd1b8a
cd1b8a
* Wed Oct 26 2016 Hans de Goede <hdegoede@redhat.com> - 1.0.21-1
cd1b8a
- Update to the final 1.0.21 upstream release
cd1b8a
cd1b8a
* Wed Aug 10 2016 Hans de Goede <hdegoede@redhat.com> - 1.0.21-0.2.rc2
cd1b8a
- Update to 1.0.21-rc2 upstream release
cd1b8a
- Add a bunch of locking fixes which are pending upstream
cd1b8a
cd1b8a
* Tue Feb 23 2016 Hans de Goede <hdegoede@redhat.com> - 1.0.21-0.1.git448584a
cd1b8a
- Update to a pre 1.0.21 git snapshot to bring in libusb_interrupt_event_handler
cd1b8a
  which chromium needs (rhbz#1270324)
cd1b8a
cd1b8a
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.20-2
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
cd1b8a
cd1b8a
* Thu Sep 24 2015 Hans de Goede <hdegoede@redhat.com> - 1.0.20-1
cd1b8a
- Update to 1.0.20 (rhbz#1262817)
cd1b8a
cd1b8a
* Tue Jun 16 2015 Peter Robinson <pbrobinson@fedoraproject.org> 1.0.19-3
cd1b8a
- Use %%license
cd1b8a
cd1b8a
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.19-2
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
cd1b8a
cd1b8a
* Fri Jun 13 2014 Hans de Goede <hdegoede@redhat.com> - 1.0.19-1
cd1b8a
- Update to 1.0.19 final
cd1b8a
cd1b8a
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.19-0.3.rc2
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
cd1b8a
cd1b8a
* Fri May 30 2014 Hans de Goede <hdegoede@redhat.com> - 1.0.19-0.2.rc2
cd1b8a
- Update to 1.0.19-rc2
cd1b8a
cd1b8a
* Mon May 19 2014 Hans de Goede <hdegoede@redhat.com> - 1.0.19-0.1.rc1
cd1b8a
- Update to 1.0.19-rc1
cd1b8a
cd1b8a
* Sat Mar  8 2014 Hans de Goede <hdegoede@redhat.com> - 1.0.18-1
cd1b8a
- Update to 1.0.18 release (rhbz#1058000)
cd1b8a
cd1b8a
* Fri Sep  6 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.17-1
cd1b8a
- Update to 1.0.17 final release
cd1b8a
cd1b8a
* Wed Aug 28 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.17-0.1.rc1
cd1b8a
- New upstream 1.0.17-rc1 release
cd1b8a
cd1b8a
* Tue Jul 30 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.16-3
cd1b8a
- Fix another libusb_exit deadlock (rhbz#985484)
cd1b8a
cd1b8a
* Fri Jul 19 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.16-2
cd1b8a
- Fix libusb_exit sometimes (race) deadlocking on exit (rhbz#985484)
cd1b8a
cd1b8a
* Thu Jul 11 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.16-1
cd1b8a
- New upstream 1.0.16 final release
cd1b8a
cd1b8a
* Sat Jul  6 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.16-0.2.rc3
cd1b8a
- New upstream 1.0.16-rc3 release
cd1b8a
cd1b8a
* Mon Jul  1 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.16-0.1.rc2
cd1b8a
- New upstream 1.0.16-rc2 release
cd1b8a
cd1b8a
* Fri Apr 19 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.15-2
cd1b8a
- Replace tarbal with upstream re-spun tarbal which fixes line-ending and
cd1b8a
  permission issues
cd1b8a
cd1b8a
* Wed Apr 17 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.15-1
cd1b8a
- Upgrade to 1.0.15 (rhbz#952575)
cd1b8a
cd1b8a
* Tue Apr  2 2013 Hans de Goede <hdegoede@redhat.com> - 1.0.14-3
cd1b8a
- Drop devel-doc Requires from the devel package (rhbz#947297)
cd1b8a
cd1b8a
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.14-2
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
cd1b8a
cd1b8a
* Wed Sep 26 2012 Hans de Goede <hdegoede@redhat.com> - 1.0.14-1
cd1b8a
- Upgrade to 1.0.14
cd1b8a
cd1b8a
* Mon Sep 24 2012 Hans de Goede <hdegoede@redhat.com> - 1.0.13-1
cd1b8a
- Upgrade to 1.0.13
cd1b8a
cd1b8a
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.11-3
cd1b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
cd1b8a
cd1b8a
* Wed May 23 2012 Hans de Goede <hdegoede@redhat.com> - 1.0.11-2
cd1b8a
- Fix URL to actually point to libusbx
cd1b8a
- Improve description to explain the relation between libusbx and libusb
cd1b8a
- Build the examples (to test linking, they are not packaged)
cd1b8a
cd1b8a
* Tue May 22 2012 Hans de Goede <hdegoede@redhat.com> - 1.0.11-1
cd1b8a
- New libusbx package, replacing libusb1
cd1b8a
- Switching to libusbx upstream as that actually does releases (hurray)
cd1b8a
- Drop all patches (all upstream)
cd1b8a
- Drop -static subpackage (there are no packages using it)