## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 5; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond mingw %[0%{?fedora} && !0%{?flatpak}] %bcond linux 0 %if %{without linux} %global debug_package %{nil} %endif Summary: Library for accessing USB devices Name: libusb1 Version: 1.0.29 Release: %autorelease Source0: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2 Source1: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2.asc Source2: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc68187379b23de9efc46651e2c80ff56c6830a0e#/%{name}.keyring License: LGPL-2.1-or-later URL: http://libusb.info Epoch: 1 # Upstream Patches Patch0002: 0002-examples-hotplugtest-Allow-multiple-devices-attachin.patch Patch0003: 0003-examples-hotplugtest-Close-old-device-only-if-new-on.patch Patch0004: 0004-darwin-Fix-last-param-to-QueryInterface-to-be-LPVOID.patch Patch0005: 0005-darwin-Introduce-temporary-variable-so-we-can-take-t.patch Patch0006: 0006-libusbi.h-darwin-Split-recursive-struct-declarations.patch Patch0007: 0007-core-Remove-some-unnecessary-consts.patch Patch0008: 0008-descriptor-Warn-on-invalid-langid-descriptor.patch Patch0009: 0009-example-hotplugtest-Ignore-unavailable-devices-1425.patch Patch0010: 0010-tests-stress_mt-ignore-errors-in-threads-for-checkin.patch Patch0011: 0011-CI-Add-MSYS2-Clang64-AArch64-workflow.patch Patch0012: 0012-windows-disable-warning-C5287-operands-are-different.patch Patch0013: 0013-Add-Windows-Github-actions.patch Patch0014: 0014-Windows-Github-actions-specify-supported-architectur.patch Patch0015: 0015-windows-Remove-winsock-include-from-libusb.h.patch Patch0016: 0016-windows-hotplug-implementation.patch Patch0017: 0017-Fix-warnings-when-building-without-logging-and-asser.patch Patch0018: 0018-Reintroduce-RAW_IO-support-in-WinUSB-backend.patch Patch0019: 0019-Added-libusb_get_device_string-which-works-with-a-cl.patch Patch0021: 0021-Clarify-return-value-of-usbi_mutex_trylock-with-name.patch Patch0022: 0022-libusbi.h-reorder-struct-fields-so-mutex-appears-bef.patch Patch0023: 0023-Fixed-clang-tidy-readability-redundant-casting-warni.patch Patch0024: 0024-Fixed-clang-tidy-readability-math-missing-parenthese.patch Patch0025: 0025-Fixed-memory-leak-in-an-error-path.patch Patch0026: 0026-Updated-.clang-tidy-config-file-to-enable-disable-so.patch Patch0027: 0027-darwin-Add-new-windows_hotplug-files-to-Xcode-projec.patch Patch0028: 0028-darwin-use-threads_posix.h-wrapper-functions.patch Patch0029: 0029-android-Fix-intermittent-open-failure-in-get_usbfs_f.patch Patch0030: 0030-fix-pthread-wrapping-to-use-correct-types.patch Patch0031: 0031-core-Add-new-function-libusb_get_session_data.patch Patch0032: 0032-macOS-Fix-for-libusb_get_port_numbers-on-macOS-26.patch Patch0033: 0033-windows-Fix-Compilation-with-Microsoft-Visual-Studio.patch Patch0034: 0034-linux-change-usbi_handle_disconnect-signature-to-tak.patch Patch0035: 0035-libusbi.h-move-mutex-declarations-before-the-things-.patch Patch0036: 0036-tests-fuzz-BOS-device-cap-parsers-fuzzer-USB-2.0-ext.patch Patch0037: 0037-CI-linux-ASan-UBSan-hardening-staged-install-DESTDIR.patch BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel BuildRequires: make BuildRequires: gcc BuildRequires: gnupg2 # libusbx was removed in F34 Provides: libusbx = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: libusbx < %{version}-%{release} %if %{with mingw} BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-gcc-c++ BuildRequires: mingw64-filesystem >= 95 BuildRequires: mingw64-gcc-c++ # mingw-libusbx was removed in F42 Provides: mingw-libusbx = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: mingw-libusbx < %{version}-%{release} %endif %description This package provides a way for applications to access USB devices. libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD, Haiku and Solaris userspace. libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. %if %{with linux} %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: libusbx-devel = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: libusbx-devel < %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package devel-doc Summary: Development files for %{name} Requires: libusb1-devel = %{?epoch:%{epoch}:}%{version}-%{release} Provides: libusbx-devel-doc = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: libusbx-devel-doc < %{version}-%{release} BuildArch: noarch %description devel-doc This package contains API documentation for %{name}. %package tests-examples Summary: Tests and examples for %{name} # The fxload example is GPLv2+, the rest is LGPLv2+, like libusb itself. License: LGPLv2+ and GPLv2+ Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: libusbx-tests-examples = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: libusbx-tests-examples < %{version}-%{release} %description tests-examples This package contains tests and examples for %{name}. %endif %if %{with mingw} %package -n mingw32-%{name} Summary: MinGW Windows %{name} library Provides: mingw32-libusbx = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: mingw32-libusbx < %{version}-%{release} %description -n mingw32-%{name} MinGW Windows %{name} library. %package -n mingw64-%{name} Summary: MinGW Windows %{name} library Provides: mingw64-libusbx = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: mingw64-libusbx < %{version}-%{release} %description -n mingw64-%{name} MinGW Windows %{name} library. %endif %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup -p1 -n libusb-%{version} chmod -x examples/*.c mkdir -p m4 sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am autoscan aclocal autoconf automake --add-missing %build %if %{with linux} mkdir %{_target_os} pushd %{_target_os} %define _configure ../configure %configure --disable-static --enable-examples-build %{make_build} pushd doc make docs popd pushd tests make popd popd %endif %if %{with mingw} # MinGW build %mingw_configure --disable-static --enable-windows-hotplug %mingw_make_build %endif %install %if %{with linux} pushd %{_target_os} %{make_install} mkdir -p $RPM_BUILD_ROOT%{_bindir} install -m 755 tests/.libs/init_context $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context install -m 755 tests/.libs/set_option $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option install -m 755 tests/.libs/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress install -m 755 tests/.libs/stress_mt $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress_mt install -m 755 tests/.libs/umockdev $RPM_BUILD_ROOT%{_bindir}/libusb-test-umockdev install -m 755 examples/.libs/testlibusb \ $RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb # Some examples are very device-specific / require specific hw and miss --help # So we only install a subset of more generic / useful examples for i in fxload listdevs xusb; do install -m 755 examples/.libs/$i \ $RPM_BUILD_ROOT%{_bindir}/libusb-example-$i done rm $RPM_BUILD_ROOT%{_libdir}/*.la popd %endif %if %{with mingw} %mingw_make_install %endif %check %if %{with linux} pushd %{_target_os} LD_LIBRARY_PATH=libusb/.libs ldd $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-umockdev LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs popd %endif %ldconfig_scriptlets %if %{with linux} %files %license COPYING %doc AUTHORS README ChangeLog %{_libdir}/*.so.* %files devel %{_includedir}/libusb-1.0 %{_libdir}/*.so %{_libdir}/pkgconfig/libusb-1.0.pc %files devel-doc %doc %{_target_os}/doc/api-1.0 examples/*.c %files tests-examples %{_bindir}/libusb-example-fxload %{_bindir}/libusb-example-listdevs %{_bindir}/libusb-example-xusb %{_bindir}/libusb-test-init_context %{_bindir}/libusb-test-set_option %{_bindir}/libusb-test-stress %{_bindir}/libusb-test-stress_mt %{_bindir}/libusb-test-umockdev %{_bindir}/libusb-test-libusb %endif %if %{with mingw} %files -n mingw32-libusb1 %license COPYING %doc AUTHORS README ChangeLog %{mingw32_bindir}/libusb-1.0.dll %{mingw32_includedir}/libusb-1.0 %{mingw32_libdir}/*.dll.a %{mingw32_libdir}/pkgconfig/libusb-1.0.pc %files -n mingw64-libusb1 %license COPYING %doc AUTHORS README ChangeLog %{mingw64_bindir}/libusb-1.0.dll %{mingw64_includedir}/libusb-1.0 %{mingw64_libdir}/*.dll.a %{mingw64_libdir}/pkgconfig/libusb-1.0.pc %endif %changelog ## START: Generated by rpmautospec * Tue Oct 28 2025 Tomas Chang - 1.0.29-5 - Apply upstream patches of Windows Hotplug Implementation to MinGW builds * Fri Aug 29 2025 Kate Hsuan - 1.0.29-4 - Revert "Add patches to skip uninitialized devices" (rhbz#2390535) * Mon Aug 11 2025 Benjamin Berg - 1.0.29-3 - Add patches to skip uninitialized devices * Tue Aug 05 2025 Yaakov Selkowitz - 1.0.29-2 - Always regenerate autotools * Tue Aug 05 2025 Kate Hsuan - 1.0.29-1 - Update to the upstream version 1.0.29 and migrate to tmt test * Thu Jul 24 2025 Fedora Release Engineering - 1.0.28-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Thu Mar 27 2025 Kate Hsuan - 1.0.28-2 - Fix the automake 1.17 issue for the versions less than f43 and rhel11 * Wed Mar 26 2025 LuK1337 - 1.0.28-1 - Update to 1.0.28 * Wed Mar 26 2025 LuK1337 - 1.0.27-10 - Verify source code with GPG * Thu Jan 30 2025 Marc-André Lureau - 1.0.27-9 - Provides/Obsoletes mingw-libusbx * Mon Jan 20 2025 Fedora Release Engineering - 1.0.27-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Fri Jan 17 2025 Fedora Release Engineering - 1.0.27-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Mon Jan 13 2025 Yaakov Selkowitz - 1.0.27-6 - Fix ELN build * Fri Jan 10 2025 Kate Hsuan - 1.0.27-5 - Fix the build failure with automake-1.17 * Tue Oct 22 2024 Jean THOMAS - 1.0.27-4 - Add MinGW builds * Thu Jul 18 2024 Fedora Release Engineering - 1.0.27-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Wed May 08 2024 Kate Hsuan - 1.0.27-2 - Build the test code without a rpath * Mon Mar 04 2024 Kate Hsuan - 1.0.27-1 - Update to 1.0.27 - Update to 1.0.27 - Add tests, including init_context, set_option, and stress_mt * Thu Jan 25 2024 Fedora Release Engineering - 1.0.26-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 1.0.26-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Sep 19 2023 Miroslav Suchý - 1.0.26-4 - Migrate to SPDX license * Thu Jul 20 2023 Fedora Release Engineering - 1.0.26-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Thu Jan 19 2023 Fedora Release Engineering - 1.0.26-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Sep 30 2022 Kate Hsuan 1.0.26-1 - Update to 1.0.26 * Wed Feb 02 2022 Benjamin Berg 1.0.25-1 - Update to 1.0.25 * Thu Jan 20 2022 Fedora Release Engineering - 1.0.24-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Thu Jul 22 2021 Fedora Release Engineering - 1.0.24-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Jan 19 18:47:55 CET 2021 Benjamin Berg - 1.0.24-3 - New libusb1 package replacing libusbx Resolves: #1918269 ## END: Generated by rpmautospec