From 6952413693a520bfd86cdb0bc2f16a0347740923 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 12:25:11 +0000 Subject: [PATCH 01/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 758eaec57920708baedd333bf082b09c7db9e66f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Tue, 19 Sep 2023 03:54:03 +0000 Subject: [PATCH 02/23] Migrate to SPDX license This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 --- libusb1.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libusb1.spec b/libusb1.spec index 7c112f7..5566b32 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -3,7 +3,7 @@ Name: libusb1 Version: 1.0.26 Release: %autorelease Source0: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2 -License: LGPLv2+ +License: LGPL-2.1-or-later URL: http://libusb.info BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel From 31b51b7c839698911feec65a64a4b1ee5f749391 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 05:38:03 +0000 Subject: [PATCH 03/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 1dcfc6520a691b620bcfe7e0b4ba5c5703e0f528 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 03:51:42 +0000 Subject: [PATCH 04/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 07032b3e9cef208a9aac794a416b04b7e0567e7c Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 4 Mar 2024 15:04:45 +0800 Subject: [PATCH 05/23] Update to 1.0.27 - Update to 1.0.27 - Add tests, including init_context, set_option, and stress_mt --- .gitignore | 1 + libusb1.spec | 17 +++++++++++++++-- sources | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 255da81..a91d702 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /libusb-1.0.24.tar.bz2 /libusb-1.0.25.tar.bz2 /libusb-1.0.26.tar.bz2 +/libusb-1.0.27.tar.bz2 diff --git a/libusb1.spec b/libusb1.spec index 5566b32..fb13dca 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -1,6 +1,6 @@ Summary: Library for accessing USB devices Name: libusb1 -Version: 1.0.26 +Version: 1.0.27 Release: %autorelease Source0: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2 License: LGPL-2.1-or-later @@ -9,6 +9,7 @@ BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel BuildRequires: make BuildRequires: gcc +BuildRequires: patchelf # libusbx was removed in F34 Provides: libusbx = %{version}-%{release} Obsoletes: libusbx < %{version}-%{release} @@ -75,8 +76,15 @@ popd %install %{make_install} +patchelf --remove-rpath tests/init_context +patchelf --remove-rpath tests/set_option +patchelf --remove-rpath tests/stress +patchelf --remove-rpath tests/stress_mt mkdir -p $RPM_BUILD_ROOT%{_bindir} -install -m 755 tests/.libs/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +install -m 755 tests/init_context $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context +install -m 755 tests/set_option $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option +install -m 755 tests/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +install -m 755 tests/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 @@ -91,6 +99,8 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la %check 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 @@ -117,7 +127,10 @@ LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs %{_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 diff --git a/sources b/sources index 3b509af..959d93c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libusb-1.0.26.tar.bz2) = fcdb85c98f21639668693c2fd522814d440972d65883984c4ae53d0555bdbdb7e8c7a32199cd4b01113556a1eb5be7841b750cc73c9f6bda79bfe1af80914e71 +SHA512 (libusb-1.0.27.tar.bz2) = 42abbbcf2564f86cc2f05826aeefa6beb03c9f89dc9fe05bdfa351caa3dbd07713ce193daadecf29557604dd3cbc770c8031a78e1ad0a8df3627c3f551d28ff0 From 840da56fff6c5a794b77e93c9e91d7b08c23d9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Tue, 19 Sep 2023 03:54:03 +0000 Subject: [PATCH 06/23] Migrate to SPDX license This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 --- libusb1.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libusb1.spec b/libusb1.spec index 7c112f7..5566b32 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -3,7 +3,7 @@ Name: libusb1 Version: 1.0.26 Release: %autorelease Source0: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2 -License: LGPLv2+ +License: LGPL-2.1-or-later URL: http://libusb.info BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel From 222fd18a6cd78f795e0ba44f7de1c15a7f985956 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 4 Mar 2024 15:04:45 +0800 Subject: [PATCH 07/23] Update to 1.0.27 - Update to 1.0.27 - Add tests, including init_context, set_option, and stress_mt --- .gitignore | 1 + libusb1.spec | 17 +++++++++++++++-- sources | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 255da81..a91d702 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /libusb-1.0.24.tar.bz2 /libusb-1.0.25.tar.bz2 /libusb-1.0.26.tar.bz2 +/libusb-1.0.27.tar.bz2 diff --git a/libusb1.spec b/libusb1.spec index 5566b32..fb13dca 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -1,6 +1,6 @@ Summary: Library for accessing USB devices Name: libusb1 -Version: 1.0.26 +Version: 1.0.27 Release: %autorelease Source0: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2 License: LGPL-2.1-or-later @@ -9,6 +9,7 @@ BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel BuildRequires: make BuildRequires: gcc +BuildRequires: patchelf # libusbx was removed in F34 Provides: libusbx = %{version}-%{release} Obsoletes: libusbx < %{version}-%{release} @@ -75,8 +76,15 @@ popd %install %{make_install} +patchelf --remove-rpath tests/init_context +patchelf --remove-rpath tests/set_option +patchelf --remove-rpath tests/stress +patchelf --remove-rpath tests/stress_mt mkdir -p $RPM_BUILD_ROOT%{_bindir} -install -m 755 tests/.libs/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +install -m 755 tests/init_context $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context +install -m 755 tests/set_option $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option +install -m 755 tests/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +install -m 755 tests/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 @@ -91,6 +99,8 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la %check 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 @@ -117,7 +127,10 @@ LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs %{_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 diff --git a/sources b/sources index 3b509af..959d93c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libusb-1.0.26.tar.bz2) = fcdb85c98f21639668693c2fd522814d440972d65883984c4ae53d0555bdbdb7e8c7a32199cd4b01113556a1eb5be7841b750cc73c9f6bda79bfe1af80914e71 +SHA512 (libusb-1.0.27.tar.bz2) = 42abbbcf2564f86cc2f05826aeefa6beb03c9f89dc9fe05bdfa351caa3dbd07713ce193daadecf29557604dd3cbc770c8031a78e1ad0a8df3627c3f551d28ff0 From 8ea613411939e224d9432f88f77c75980ce083e2 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Wed, 8 May 2024 11:09:02 +0800 Subject: [PATCH 08/23] Build the test code without a rpath --- libusb1.spec | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libusb1.spec b/libusb1.spec index fb13dca..f5f609a 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -9,7 +9,6 @@ BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel BuildRequires: make BuildRequires: gcc -BuildRequires: patchelf # libusbx was removed in F34 Provides: libusbx = %{version}-%{release} Obsoletes: libusbx < %{version}-%{release} @@ -61,6 +60,7 @@ This package contains tests and examples for %{name}. %autosetup -p1 -n libusb-%{version} chmod -x examples/*.c mkdir -p m4 +sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am %build @@ -76,15 +76,11 @@ popd %install %{make_install} -patchelf --remove-rpath tests/init_context -patchelf --remove-rpath tests/set_option -patchelf --remove-rpath tests/stress -patchelf --remove-rpath tests/stress_mt mkdir -p $RPM_BUILD_ROOT%{_bindir} -install -m 755 tests/init_context $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context -install -m 755 tests/set_option $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option -install -m 755 tests/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress -install -m 755 tests/stress_mt $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress_mt +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 From 60468ae8bb863271ed40c54372c27cab3f05780c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 15:22:46 +0000 Subject: [PATCH 09/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 2e36c0bb649e4f10aa79b40e4fc1ee4934ad6975 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Thu, 17 Oct 2024 18:31:06 +0200 Subject: [PATCH 10/23] Add MinGW builds --- libusb1.spec | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/libusb1.spec b/libusb1.spec index f5f609a..ad65625 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -1,3 +1,5 @@ +%bcond mingw %[0%{?fedora} && !0%{?flatpak}] + Summary: Library for accessing USB devices Name: libusb1 Version: 1.0.27 @@ -13,6 +15,13 @@ BuildRequires: gcc Provides: libusbx = %{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++ +%endif + %description This package provides a way for applications to access USB devices. @@ -55,6 +64,19 @@ Obsoletes: libusbx-tests-examples < %{version}-%{release} %description tests-examples This package contains tests and examples for %{name}. +%if %{with mingw} +%package -n mingw32-%{name} +Summary: MinGW Windows %{name} library + +%description -n mingw32-%{name} +MinGW Windows %{name} library. + +%package -n mingw64-%{name} +Summary: MinGW Windows %{name} library + +%description -n mingw64-%{name} +MinGW Windows %{name} library. +%endif %prep %autosetup -p1 -n libusb-%{version} @@ -64,6 +86,9 @@ sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am %build +mkdir %{_target_os} +pushd %{_target_os} +%define _configure ../configure %configure --disable-static --enable-examples-build %{make_build} pushd doc @@ -72,9 +97,17 @@ popd pushd tests make popd +popd + +%if %{with mingw} +# MinGW build +%mingw_configure --disable-static +%mingw_make_build +%endif %install +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 @@ -91,9 +124,15 @@ for i in fxload listdevs xusb; do $RPM_BUILD_ROOT%{_bindir}/libusb-example-$i done rm $RPM_BUILD_ROOT%{_libdir}/*.la +popd + +%if %{with mingw} +%mingw_make_install +%endif %check +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 @@ -101,6 +140,7 @@ 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 %ldconfig_scriptlets @@ -117,7 +157,7 @@ LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs %{_libdir}/pkgconfig/libusb-1.0.pc %files devel-doc -%doc doc/api-1.0 examples/*.c +%doc %{_target_os}/doc/api-1.0 examples/*.c %files tests-examples %{_bindir}/libusb-example-fxload @@ -130,6 +170,23 @@ LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs %{_bindir}/libusb-test-umockdev %{_bindir}/libusb-test-libusb +%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 %autochangelog From 31c1f013c137aec6e02c7865a447eea2674a6ec3 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 10 Jan 2025 11:34:56 +0800 Subject: [PATCH 11/23] Fix the build failure with automake-1.17 Reran autoconf, aclocal, and automake to ensure the configure works with automake-1.17. Resolves: #2335712 --- libusb1.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libusb1.spec b/libusb1.spec index ad65625..d3fb530 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -83,6 +83,12 @@ MinGW Windows %{name} library. chmod -x examples/*.c mkdir -p m4 sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am +%if 0%{fedora} >= 42 +autoscan +aclocal +autoconf +automake --add-missing +%endif %build From abbe292d8bb8893e3046ccf041804fb63a5b80c1 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 13 Jan 2025 11:00:27 -0500 Subject: [PATCH 12/23] Fix ELN build Possibly undefined macros must be ?-prefixed, and ELN (the future RHEL 11) is tracking rawhide and also has automake 1.17. --- libusb1.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libusb1.spec b/libusb1.spec index d3fb530..a87829a 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -83,7 +83,7 @@ MinGW Windows %{name} library. chmod -x examples/*.c mkdir -p m4 sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am -%if 0%{fedora} >= 42 +%if 0%{?fedora} >= 42 || 0%{?rhel} >= 11 autoscan aclocal autoconf From 8756bdd70118a82d24c90eddf6fd2a8792f893b3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 14:46:08 +0000 Subject: [PATCH 13/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From fbcadef2f4e518f48bf44391742fbb2b7a4963a1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 20 Jan 2025 08:12:49 +0000 Subject: [PATCH 14/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 6c14dc730329a5ea22febdd3a064c5626d8e2765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 30 Jan 2025 14:45:14 +0400 Subject: [PATCH 15/23] Provides/Obsoletes mingw-libusbx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- libusb1.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libusb1.spec b/libusb1.spec index a87829a..d206ad7 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -20,6 +20,9 @@ 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 = %{version}-%{release} +Obsoletes: mingw-libusbx < %{version}-%{release} %endif %description @@ -67,12 +70,16 @@ This package contains tests and examples for %{name}. %if %{with mingw} %package -n mingw32-%{name} Summary: MinGW Windows %{name} library +Provides: mingw32-libusbx = %{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 = %{version}-%{release} +Obsoletes: mingw64-libusbx < %{version}-%{release} %description -n mingw64-%{name} MinGW Windows %{name} library. From 3af863595299934e476811046ddd09713ec06928 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 26 Mar 2025 14:08:58 +0100 Subject: [PATCH 16/23] Verify source code with GPG --- .gitignore | 1 + libusb1.keyring | 117 ++++++++++++++++++++++++++++++++++++++++++++++++ libusb1.spec | 4 ++ sources | 1 + 4 files changed, 123 insertions(+) create mode 100644 libusb1.keyring diff --git a/.gitignore b/.gitignore index a91d702..41386a3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /libusb-1.0.25.tar.bz2 /libusb-1.0.26.tar.bz2 /libusb-1.0.27.tar.bz2 +/libusb-1.0.27.tar.bz2.asc diff --git a/libusb1.keyring b/libusb1.keyring new file mode 100644 index 0000000..b2ed3c3 --- /dev/null +++ b/libusb1.keyring @@ -0,0 +1,117 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Comment: Hostname: +Version: Hockeypuck 2.2 + +xsFNBF7yPL0BEADQc/2dx8H7a7r1SGYph5hmkszs0O9V/43m8XhNnbnFraXjmbEv +xm2wE6AuR301mjAqYSt/mphmH54z4GBbgmLBrK8TGdhlK0K11PeSudRN4jsLs+U3 +ErtkAHODmzyg7QiW3GWudP/lJQRSqNBoadeOdOsKMoJxm7T2a9fyyf8FR/FfShjv +NB62jSWq0x0WnglI/V/ZOi/mOnqoggCoWXLzwqbKasicvfNsTPJIsjiu24US6mif +nRllMWr/6aHyCOX6+x6PsQ35NF5C5B7b0c1fY7zU/UiM/JBF4HDf7jltzTIjHjho +jTwcEkCVmunW+jSwjsLcr/zkOsu1re0W/VJJNXOhSnNUDpM7t9FeSfJ0LGlXYnGI +5ZUCQ8w4RcKmkHYhepCjDVWYkCmxmTgO7LaAXZ5S0GeOoSDsvHNHYywAXNmB6A0s +3kv/8i3wT8K1w9972eYW+NA6T7BfdbNk/EKxZQ74eezpRWDDPEl/zehoHQoPO3m1 +N2b06nnSKLv263IJAPdpLPUJowYdWnv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dSkGiRs9KNPpmBY2PldkkA9IX1L5/TvcPR +mvzTnVVTlycj5N8bMrU4uIBxU3FwozpyNIfjQxRYXMe5GOU2eqtVYtxgeN7wqGZ8 +dFzovMtHTKPPhEJ8uFSd//npnP6QMZgQA53Heaif9EbyrXJBlzRTPfGvr61XyNQk +5p5PG8RVrp3CdwEGZrYEkh5U4WR+C7SPZccMApzKGcb3 +=sExt +-----END PGP PUBLIC KEY BLOCK----- diff --git a/libusb1.spec b/libusb1.spec index d206ad7..ccfffb1 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -5,12 +5,15 @@ Name: libusb1 Version: 1.0.27 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 BuildRequires: systemd-devel doxygen libtool BuildRequires: umockdev-devel BuildRequires: make BuildRequires: gcc +BuildRequires: gnupg2 # libusbx was removed in F34 Provides: libusbx = %{version}-%{release} Obsoletes: libusbx < %{version}-%{release} @@ -86,6 +89,7 @@ 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 diff --git a/sources b/sources index 959d93c..2f3574c 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (libusb-1.0.27.tar.bz2) = 42abbbcf2564f86cc2f05826aeefa6beb03c9f89dc9fe05bdfa351caa3dbd07713ce193daadecf29557604dd3cbc770c8031a78e1ad0a8df3627c3f551d28ff0 +SHA512 (libusb-1.0.27.tar.bz2.asc) = b7ba04e284a8c8296ab1ae69eec7a65f00771519d1d661b196caba65ef08666997fd34061217f415b6cdcc9dbd34935762c3c2fa8abc4328a60202d94000f682 From 200675a582de8930ee3723d38ac157c3850924c8 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 26 Mar 2025 14:12:07 +0100 Subject: [PATCH 17/23] Update to 1.0.28 --- .gitignore | 2 ++ libusb1.spec | 2 +- sources | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 41386a3..32cc235 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /libusb-1.0.26.tar.bz2 /libusb-1.0.27.tar.bz2 /libusb-1.0.27.tar.bz2.asc +/libusb-1.0.28.tar.bz2 +/libusb-1.0.28.tar.bz2.asc diff --git a/libusb1.spec b/libusb1.spec index ccfffb1..f561179 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -2,7 +2,7 @@ Summary: Library for accessing USB devices Name: libusb1 -Version: 1.0.27 +Version: 1.0.28 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 diff --git a/sources b/sources index 2f3574c..ff2dc84 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libusb-1.0.27.tar.bz2) = 42abbbcf2564f86cc2f05826aeefa6beb03c9f89dc9fe05bdfa351caa3dbd07713ce193daadecf29557604dd3cbc770c8031a78e1ad0a8df3627c3f551d28ff0 -SHA512 (libusb-1.0.27.tar.bz2.asc) = b7ba04e284a8c8296ab1ae69eec7a65f00771519d1d661b196caba65ef08666997fd34061217f415b6cdcc9dbd34935762c3c2fa8abc4328a60202d94000f682 +SHA512 (libusb-1.0.28.tar.bz2) = 0f4efa6b54e6195d2e5446652c2dc07358583e205d63bf438c4409511b8637d1700a71268c40499755747827d23cc730d9122267386f847bf781993c045c519f +SHA512 (libusb-1.0.28.tar.bz2.asc) = 3ba1a91d0cf70a8e419df684c0465d9ef149a568286a42ce8606ed2ac574e35a5eb05ae71bb4549652b489e77dd337b4e28f9d27e20b7dc5f5ead73eb3217e85 From 3d48eee863315966220e83cafe6e958fa119bb96 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Thu, 27 Mar 2025 15:16:45 +0800 Subject: [PATCH 18/23] Fix the automake 1.17 issue for the versions less than f43 and rhel11 Since automake 1.17 is in f43 and recent f42 and libusb1 1.0.28 is released with automake 1.17, automake has to be rerun in %prep for versions less than f43 to get the correct build scripts. --- libusb1.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libusb1.spec b/libusb1.spec index f561179..41f06f3 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -94,7 +94,7 @@ MinGW Windows %{name} library. chmod -x examples/*.c mkdir -p m4 sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am -%if 0%{?fedora} >= 42 || 0%{?rhel} >= 11 +%if (0%{?fedora} && 0%{?fedora} < 43) || (0%{?rhel} && 0%{?rhel} < 11) autoscan aclocal autoconf From 48b605aa370a50c50cd975a5f7c99553928afb31 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 20:31:14 +0000 Subject: [PATCH 19/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 1029314e654c68b560610bf1fc6a0764aa1a596c Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 5 Aug 2025 13:58:32 +0800 Subject: [PATCH 20/23] Update to the upstream version 1.0.29 and migrate to tmt test 1. Update to upstream version 1.0.29. 2. Migrate the test to tmt. Resolves: #2382956 #2385130 --- .fmf/version | 1 + .gitignore | 2 ++ libusb1.spec | 4 ++-- plans/integration.fmf | 11 +++++++++++ sources | 4 ++-- tests/integration/main.fmf | 6 ++++++ tests/{ => integration}/run.sh | 0 tests/tests.yml | 13 ------------- 8 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/integration.fmf create mode 100644 tests/integration/main.fmf rename tests/{ => integration}/run.sh (100%) delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 32cc235..415c8df 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ /libusb-1.0.27.tar.bz2.asc /libusb-1.0.28.tar.bz2 /libusb-1.0.28.tar.bz2.asc +/libusb-1.0.29.tar.bz2 +/libusb-1.0.29.tar.bz2.asc diff --git a/libusb1.spec b/libusb1.spec index 41f06f3..6c2f458 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -2,7 +2,7 @@ Summary: Library for accessing USB devices Name: libusb1 -Version: 1.0.28 +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 @@ -94,7 +94,7 @@ MinGW Windows %{name} library. chmod -x examples/*.c mkdir -p m4 sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am -%if (0%{?fedora} && 0%{?fedora} < 43) || (0%{?rhel} && 0%{?rhel} < 11) +%if (0%{?fedora} && 0%{?fedora} < 44) || (0%{?rhel} && 0%{?rhel} < 11) autoscan aclocal autoconf diff --git a/plans/integration.fmf b/plans/integration.fmf new file mode 100644 index 0000000..2bb7504 --- /dev/null +++ b/plans/integration.fmf @@ -0,0 +1,11 @@ +summary: Basic smoke test +discover: + how: fmf +prepare: + - name: packages + how: install + package: + - glibc-common + - libusb1-tests-examples +execute: + how: tmt diff --git a/sources b/sources index ff2dc84..b3dcd4d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libusb-1.0.28.tar.bz2) = 0f4efa6b54e6195d2e5446652c2dc07358583e205d63bf438c4409511b8637d1700a71268c40499755747827d23cc730d9122267386f847bf781993c045c519f -SHA512 (libusb-1.0.28.tar.bz2.asc) = 3ba1a91d0cf70a8e419df684c0465d9ef149a568286a42ce8606ed2ac574e35a5eb05ae71bb4549652b489e77dd337b4e28f9d27e20b7dc5f5ead73eb3217e85 +SHA512 (libusb-1.0.29.tar.bz2) = 04f8bda8197c9ecf52709609b8fbfea762fd82ddb5cde153a7630b0e8ed557d42da8cbc44f2f593aa22fdd0762e16716300565d67adb0c5240d7f3723321f690 +SHA512 (libusb-1.0.29.tar.bz2.asc) = 57e12d3a58d8ac418e28f6d83a7cb8c0268ed5d2752707796aa5bf1f8bcf2a8083aa664d36ffcdcc96da62153afa792728662fa8230be9e2865d4a37003e199d diff --git a/tests/integration/main.fmf b/tests/integration/main.fmf new file mode 100644 index 0000000..486f50b --- /dev/null +++ b/tests/integration/main.fmf @@ -0,0 +1,6 @@ +summary: + Test for libusb1 +test: bash ./run.sh + + + diff --git a/tests/run.sh b/tests/integration/run.sh similarity index 100% rename from tests/run.sh rename to tests/integration/run.sh diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 57b120c..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- hosts: localhost - roles: - # Running these tests does not require the sources - - role: standard-test-basic - tags: - - atomic - - classic - tests: - - test: - dir: . - run: run.sh - From 378cca96bd54eb3e369d50470b641b6b9c7419c4 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 5 Aug 2025 10:18:38 -0400 Subject: [PATCH 21/23] Always regenerate autotools Since we're modifying a Makefile.am, the corresponding Makefile.in will have to be regenerated, and we should never rely on any release having matching autotools versions. --- libusb1.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/libusb1.spec b/libusb1.spec index 6c2f458..256a12d 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -94,12 +94,10 @@ MinGW Windows %{name} library. chmod -x examples/*.c mkdir -p m4 sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am -%if (0%{?fedora} && 0%{?fedora} < 44) || (0%{?rhel} && 0%{?rhel} < 11) autoscan aclocal autoconf automake --add-missing -%endif %build From 3c2e5bfcc55851d96c3beae4a1c3c0d01ea02a86 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 11 Aug 2025 18:21:04 +0200 Subject: [PATCH 22/23] Add patches to skip uninitialized devices Otherwise there is a race condition if libusb enumerates the devices while udev is processing the event. Resolves: #2346771 --- ...v-remove-UMOCKDEV_HOTPLUG-workaround.patch | 77 +++++++++++ ...return-initialized-devices-during-en.patch | 120 ++++++++++++++++++ libusb1.spec | 4 + 3 files changed, 201 insertions(+) create mode 100644 0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch create mode 100644 0002-linux_udev-only-return-initialized-devices-during-en.patch diff --git a/0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch b/0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch new file mode 100644 index 0000000..2bbe1bd --- /dev/null +++ b/0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch @@ -0,0 +1,77 @@ +From 76bbaf23ac3f1c91c93e82a6c0947c66fb246edc Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Thu, 20 Mar 2025 22:38:39 +0100 +Subject: [PATCH 1/2] tests/umockdev: remove UMOCKDEV_HOTPLUG workaround + +umockdev 0.17.7 is old enough to rely on it for testing. Remove the +workaround as it might not be compatible with the follow up changes. + +Signed-off-by: Benjamin Berg +--- + configure.ac | 8 ++------ + tests/umockdev.c | 7 ------- + 2 files changed, 2 insertions(+), 13 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9b519234..abdbf0de 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -209,14 +209,10 @@ linux) + AC_CHECK_HEADER([libudev.h], [], [AC_MSG_ERROR([udev support requested but libudev header not installed])]) + AC_CHECK_LIB([udev], [udev_new], [], [AC_MSG_ERROR([udev support requested but libudev not installed])]) + +- # We can build umockdev tests (if available) ++ # We can build umockdev tests (if available); need 0.17.7 because hotplug was racy before + m4_ifdef([PKG_PROG_PKG_CONFIG],[ + PKG_PROG_PKG_CONFIG +- PKG_CHECK_MODULES([UMOCKDEV], [umockdev-1.0 >= 0.16.0], [ac_have_umockdev=yes], [ac_have_umockdev=no]) +- PKG_CHECK_MODULES([UMOCKDEV_HOTPLUG], [umockdev-1.0 >= 0.17.7], [ac_umockdev_hotplug=yes], [ac_umockdev_hotplug=no]) +- if test $ac_umockdev_hotplug = yes; then +- AC_DEFINE([UMOCKDEV_HOTPLUG], [1], [UMockdev hotplug code is not racy]) +- fi ++ PKG_CHECK_MODULES([UMOCKDEV], [umockdev-1.0 >= 0.17.7], [ac_have_umockdev=yes], [ac_have_umockdev=no]) + ], []) + else + AC_CHECK_HEADERS([asm/types.h]) +diff --git a/tests/umockdev.c b/tests/umockdev.c +index a2d457ee..f979ed8f 100644 +--- a/tests/umockdev.c ++++ b/tests/umockdev.c +@@ -971,7 +971,6 @@ hotplug_count_arrival_cb(libusb_context *ctx, + return 0; + } + +-#ifdef UMOCKDEV_HOTPLUG + static int LIBUSB_CALL + hotplug_count_removal_cb(libusb_context *ctx, + libusb_device *device, +@@ -987,7 +986,6 @@ hotplug_count_removal_cb(libusb_context *ctx, + + return 0; + } +-#endif + + static void + test_hotplug_enumerate(UMockdevTestbedFixture * fixture, UNUSED_DATA) +@@ -1041,7 +1039,6 @@ test_hotplug_enumerate(UMockdevTestbedFixture * fixture, UNUSED_DATA) + static void + test_hotplug_add_remove(UMockdevTestbedFixture * fixture, UNUSED_DATA) + { +-#ifdef UMOCKDEV_HOTPLUG + libusb_device **devs = NULL; + libusb_hotplug_callback_handle handle_add; + libusb_hotplug_callback_handle handle_remove; +@@ -1111,10 +1108,6 @@ test_hotplug_add_remove(UMockdevTestbedFixture * fixture, UNUSED_DATA) + + libusb_hotplug_deregister_callback(fixture->ctx, handle_add); + libusb_hotplug_deregister_callback(fixture->ctx, handle_remove); +-#else +- (void) fixture; +- g_test_skip("UMockdev is too old to test hotplug"); +-#endif + } + + int +-- +2.50.1 + diff --git a/0002-linux_udev-only-return-initialized-devices-during-en.patch b/0002-linux_udev-only-return-initialized-devices-during-en.patch new file mode 100644 index 0000000..fbc91c1 --- /dev/null +++ b/0002-linux_udev-only-return-initialized-devices-during-en.patch @@ -0,0 +1,120 @@ +From 04f1e292af11aa9b5faef4338d36716396beff1a Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Thu, 20 Mar 2025 22:49:52 +0100 +Subject: [PATCH 2/2] linux_udev: only return initialized devices during + enumeration + +The udev enumerator can return devices for which udev has not finished +processing its rules. As udev has not finished handling its rules, the +application may not yet be permitted to open the device. + +For these devices a hotplug event will happen later on when udev sends +the "add" event. + +Change the enumerator to only return initialized devices when udev is +running. There is no nice API to check whether this is the case, so just +do the same access() call that udev_queue_get_udev_is_active() would +also do. + +Also add a umockdev test for this specific corner case. Note that other +tests need to be updated to work around poor umockdev emulation of the +udev behaviour. umockdev never writes udev database entries to its +/run/udev/data, which means that devices are only considered initialized +when an event has been received. + +Signed-off-by: Benjamin Berg +--- + libusb/os/linux_udev.c | 5 +++++ + tests/umockdev.c | 25 +++++++++++++++++++++++-- + 2 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c +index 9ec9eb17..fad4f2ca 100644 +--- a/libusb/os/linux_udev.c ++++ b/libusb/os/linux_udev.c +@@ -278,6 +278,11 @@ int linux_udev_scan_devices(struct libusb_context *ctx) + return LIBUSB_ERROR_OTHER; + } + ++ /* Only return initialized devices if udev is running. If it is not ++ * running, devices will never be marked as "initialized". ++ */ ++ if (access("/run/udev/control", F_OK) == 0) ++ udev_enumerate_add_match_is_initialized(enumerator); + udev_enumerate_add_match_subsystem(enumerator, "usb"); + udev_enumerate_add_match_property(enumerator, "DEVTYPE", "usb_device"); + udev_enumerate_scan_devices(enumerator); +diff --git a/tests/umockdev.c b/tests/umockdev.c +index f979ed8f..f09611f1 100644 +--- a/tests/umockdev.c ++++ b/tests/umockdev.c +@@ -409,6 +409,8 @@ test_fixture_add_canon(UMockdevTestbedFixture * fixture) + "E: DRIVER=usb\n" + "E: BUSNUM=001\n" + "E: DEVNUM=001\n" ++ "E: MAJOR=189\n" ++ "E: MINOR=128\n" + "E: DEVNAME=/dev/bus/usb/001/001\n" + "E: DEVTYPE=usb_device\n" + "A: bConfigurationValue=1\\n\n" +@@ -429,8 +431,7 @@ static void + test_fixture_setup_libusb(UMockdevTestbedFixture * fixture, int devcount) + { + libusb_device **devs = NULL; +- +- libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); ++ struct timeval zero_tv = { 0 }; + + /* Suppress global log messages completely + * (though, in some tests it might be interesting to check there are no real ones). +@@ -440,6 +441,11 @@ test_fixture_setup_libusb(UMockdevTestbedFixture * fixture, int devcount) + g_assert_cmpint(libusb_get_device_list(fixture->ctx, &devs), ==, devcount); + libusb_free_device_list(devs, TRUE); + libusb_set_log_cb (fixture->ctx, log_handler, LIBUSB_LOG_CB_CONTEXT); ++ ++ /* Get the udev "add" event out of the way, part of the workaround that ++ * umockdev does no create udev DB files. ++ */ ++ libusb_handle_events_timeout(fixture->ctx, &zero_tv); + } + + static void +@@ -464,6 +470,8 @@ test_fixture_setup_empty(UMockdevTestbedFixture * fixture, UNUSED_DATA) + { + test_fixture_setup_common(fixture); + ++ libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); ++ + test_fixture_setup_libusb(fixture, 0); + } + +@@ -472,6 +480,14 @@ test_fixture_setup_with_canon(UMockdevTestbedFixture * fixture, UNUSED_DATA) + { + test_fixture_setup_common(fixture); + ++ /* As of umockev 0.19.1 (and probably later) no entries in ++ * /run/udev/data are created. i.e. udev does not have a database, ++ * which means libudev will only consider devices as "initialized" if ++ * it received the uevent and does not need to read the database file. ++ * Creating the context first means the uevent will be received. ++ */ ++ libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); ++ + test_fixture_add_canon(fixture); + + test_fixture_setup_libusb(fixture, 1); +@@ -574,6 +590,11 @@ test_implicit_default(UMockdevTestbedFixture * fixture, UNUSED_DATA) + clear_libusb_log(fixture, LIBUSB_LOG_LEVEL_INFO); + + libusb_init_context(/*ctx=*/NULL, /*options=*/NULL, /*num_options=*/0); ++ /* Work around the missing udev DB in umockdev by sending a "add" ++ * notification. It is fine if this umockdev quirk changes in the ++ * future. ++ */ ++ umockdev_testbed_uevent(fixture->testbed, "/sys/devices/usb1", "add"); + g_assert_cmpint(libusb_get_device_list(NULL, &devs), ==, 1); + libusb_exit(NULL); + +-- +2.50.1 + diff --git a/libusb1.spec b/libusb1.spec index 256a12d..b934c1f 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -18,6 +18,10 @@ BuildRequires: gnupg2 Provides: libusbx = %{version}-%{release} Obsoletes: libusbx < %{version}-%{release} +Patch01: 0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch +Patch02: 0002-linux_udev-only-return-initialized-devices-during-en.patch + + %if %{with mingw} BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-gcc-c++ From 4a3bd6f9ecaa4e74bda93b1ad449fd51f00adf7b Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 29 Aug 2025 10:43:28 +0800 Subject: [PATCH 23/23] Revert "Add patches to skip uninitialized devices" (rhbz#2390535) The fix brought a regression to mess storage so revert the fix and then trying to find the better fixes. This reverts commit 3c2e5bfcc55851d96c3beae4a1c3c0d01ea02a86. --- ...v-remove-UMOCKDEV_HOTPLUG-workaround.patch | 77 ----------- ...return-initialized-devices-during-en.patch | 120 ------------------ libusb1.spec | 4 - 3 files changed, 201 deletions(-) delete mode 100644 0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch delete mode 100644 0002-linux_udev-only-return-initialized-devices-during-en.patch diff --git a/0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch b/0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch deleted file mode 100644 index 2bbe1bd..0000000 --- a/0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 76bbaf23ac3f1c91c93e82a6c0947c66fb246edc Mon Sep 17 00:00:00 2001 -From: Benjamin Berg -Date: Thu, 20 Mar 2025 22:38:39 +0100 -Subject: [PATCH 1/2] tests/umockdev: remove UMOCKDEV_HOTPLUG workaround - -umockdev 0.17.7 is old enough to rely on it for testing. Remove the -workaround as it might not be compatible with the follow up changes. - -Signed-off-by: Benjamin Berg ---- - configure.ac | 8 ++------ - tests/umockdev.c | 7 ------- - 2 files changed, 2 insertions(+), 13 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 9b519234..abdbf0de 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -209,14 +209,10 @@ linux) - AC_CHECK_HEADER([libudev.h], [], [AC_MSG_ERROR([udev support requested but libudev header not installed])]) - AC_CHECK_LIB([udev], [udev_new], [], [AC_MSG_ERROR([udev support requested but libudev not installed])]) - -- # We can build umockdev tests (if available) -+ # We can build umockdev tests (if available); need 0.17.7 because hotplug was racy before - m4_ifdef([PKG_PROG_PKG_CONFIG],[ - PKG_PROG_PKG_CONFIG -- PKG_CHECK_MODULES([UMOCKDEV], [umockdev-1.0 >= 0.16.0], [ac_have_umockdev=yes], [ac_have_umockdev=no]) -- PKG_CHECK_MODULES([UMOCKDEV_HOTPLUG], [umockdev-1.0 >= 0.17.7], [ac_umockdev_hotplug=yes], [ac_umockdev_hotplug=no]) -- if test $ac_umockdev_hotplug = yes; then -- AC_DEFINE([UMOCKDEV_HOTPLUG], [1], [UMockdev hotplug code is not racy]) -- fi -+ PKG_CHECK_MODULES([UMOCKDEV], [umockdev-1.0 >= 0.17.7], [ac_have_umockdev=yes], [ac_have_umockdev=no]) - ], []) - else - AC_CHECK_HEADERS([asm/types.h]) -diff --git a/tests/umockdev.c b/tests/umockdev.c -index a2d457ee..f979ed8f 100644 ---- a/tests/umockdev.c -+++ b/tests/umockdev.c -@@ -971,7 +971,6 @@ hotplug_count_arrival_cb(libusb_context *ctx, - return 0; - } - --#ifdef UMOCKDEV_HOTPLUG - static int LIBUSB_CALL - hotplug_count_removal_cb(libusb_context *ctx, - libusb_device *device, -@@ -987,7 +986,6 @@ hotplug_count_removal_cb(libusb_context *ctx, - - return 0; - } --#endif - - static void - test_hotplug_enumerate(UMockdevTestbedFixture * fixture, UNUSED_DATA) -@@ -1041,7 +1039,6 @@ test_hotplug_enumerate(UMockdevTestbedFixture * fixture, UNUSED_DATA) - static void - test_hotplug_add_remove(UMockdevTestbedFixture * fixture, UNUSED_DATA) - { --#ifdef UMOCKDEV_HOTPLUG - libusb_device **devs = NULL; - libusb_hotplug_callback_handle handle_add; - libusb_hotplug_callback_handle handle_remove; -@@ -1111,10 +1108,6 @@ test_hotplug_add_remove(UMockdevTestbedFixture * fixture, UNUSED_DATA) - - libusb_hotplug_deregister_callback(fixture->ctx, handle_add); - libusb_hotplug_deregister_callback(fixture->ctx, handle_remove); --#else -- (void) fixture; -- g_test_skip("UMockdev is too old to test hotplug"); --#endif - } - - int --- -2.50.1 - diff --git a/0002-linux_udev-only-return-initialized-devices-during-en.patch b/0002-linux_udev-only-return-initialized-devices-during-en.patch deleted file mode 100644 index fbc91c1..0000000 --- a/0002-linux_udev-only-return-initialized-devices-during-en.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 04f1e292af11aa9b5faef4338d36716396beff1a Mon Sep 17 00:00:00 2001 -From: Benjamin Berg -Date: Thu, 20 Mar 2025 22:49:52 +0100 -Subject: [PATCH 2/2] linux_udev: only return initialized devices during - enumeration - -The udev enumerator can return devices for which udev has not finished -processing its rules. As udev has not finished handling its rules, the -application may not yet be permitted to open the device. - -For these devices a hotplug event will happen later on when udev sends -the "add" event. - -Change the enumerator to only return initialized devices when udev is -running. There is no nice API to check whether this is the case, so just -do the same access() call that udev_queue_get_udev_is_active() would -also do. - -Also add a umockdev test for this specific corner case. Note that other -tests need to be updated to work around poor umockdev emulation of the -udev behaviour. umockdev never writes udev database entries to its -/run/udev/data, which means that devices are only considered initialized -when an event has been received. - -Signed-off-by: Benjamin Berg ---- - libusb/os/linux_udev.c | 5 +++++ - tests/umockdev.c | 25 +++++++++++++++++++++++-- - 2 files changed, 28 insertions(+), 2 deletions(-) - -diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c -index 9ec9eb17..fad4f2ca 100644 ---- a/libusb/os/linux_udev.c -+++ b/libusb/os/linux_udev.c -@@ -278,6 +278,11 @@ int linux_udev_scan_devices(struct libusb_context *ctx) - return LIBUSB_ERROR_OTHER; - } - -+ /* Only return initialized devices if udev is running. If it is not -+ * running, devices will never be marked as "initialized". -+ */ -+ if (access("/run/udev/control", F_OK) == 0) -+ udev_enumerate_add_match_is_initialized(enumerator); - udev_enumerate_add_match_subsystem(enumerator, "usb"); - udev_enumerate_add_match_property(enumerator, "DEVTYPE", "usb_device"); - udev_enumerate_scan_devices(enumerator); -diff --git a/tests/umockdev.c b/tests/umockdev.c -index f979ed8f..f09611f1 100644 ---- a/tests/umockdev.c -+++ b/tests/umockdev.c -@@ -409,6 +409,8 @@ test_fixture_add_canon(UMockdevTestbedFixture * fixture) - "E: DRIVER=usb\n" - "E: BUSNUM=001\n" - "E: DEVNUM=001\n" -+ "E: MAJOR=189\n" -+ "E: MINOR=128\n" - "E: DEVNAME=/dev/bus/usb/001/001\n" - "E: DEVTYPE=usb_device\n" - "A: bConfigurationValue=1\\n\n" -@@ -429,8 +431,7 @@ static void - test_fixture_setup_libusb(UMockdevTestbedFixture * fixture, int devcount) - { - libusb_device **devs = NULL; -- -- libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); -+ struct timeval zero_tv = { 0 }; - - /* Suppress global log messages completely - * (though, in some tests it might be interesting to check there are no real ones). -@@ -440,6 +441,11 @@ test_fixture_setup_libusb(UMockdevTestbedFixture * fixture, int devcount) - g_assert_cmpint(libusb_get_device_list(fixture->ctx, &devs), ==, devcount); - libusb_free_device_list(devs, TRUE); - libusb_set_log_cb (fixture->ctx, log_handler, LIBUSB_LOG_CB_CONTEXT); -+ -+ /* Get the udev "add" event out of the way, part of the workaround that -+ * umockdev does no create udev DB files. -+ */ -+ libusb_handle_events_timeout(fixture->ctx, &zero_tv); - } - - static void -@@ -464,6 +470,8 @@ test_fixture_setup_empty(UMockdevTestbedFixture * fixture, UNUSED_DATA) - { - test_fixture_setup_common(fixture); - -+ libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); -+ - test_fixture_setup_libusb(fixture, 0); - } - -@@ -472,6 +480,14 @@ test_fixture_setup_with_canon(UMockdevTestbedFixture * fixture, UNUSED_DATA) - { - test_fixture_setup_common(fixture); - -+ /* As of umockev 0.19.1 (and probably later) no entries in -+ * /run/udev/data are created. i.e. udev does not have a database, -+ * which means libudev will only consider devices as "initialized" if -+ * it received the uevent and does not need to read the database file. -+ * Creating the context first means the uevent will be received. -+ */ -+ libusb_init_context(/*ctx=*/&fixture->ctx, /*options=*/NULL, /*num_options=*/0); -+ - test_fixture_add_canon(fixture); - - test_fixture_setup_libusb(fixture, 1); -@@ -574,6 +590,11 @@ test_implicit_default(UMockdevTestbedFixture * fixture, UNUSED_DATA) - clear_libusb_log(fixture, LIBUSB_LOG_LEVEL_INFO); - - libusb_init_context(/*ctx=*/NULL, /*options=*/NULL, /*num_options=*/0); -+ /* Work around the missing udev DB in umockdev by sending a "add" -+ * notification. It is fine if this umockdev quirk changes in the -+ * future. -+ */ -+ umockdev_testbed_uevent(fixture->testbed, "/sys/devices/usb1", "add"); - g_assert_cmpint(libusb_get_device_list(NULL, &devs), ==, 1); - libusb_exit(NULL); - --- -2.50.1 - diff --git a/libusb1.spec b/libusb1.spec index b934c1f..256a12d 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -18,10 +18,6 @@ BuildRequires: gnupg2 Provides: libusbx = %{version}-%{release} Obsoletes: libusbx < %{version}-%{release} -Patch01: 0001-tests-umockdev-remove-UMOCKDEV_HOTPLUG-workaround.patch -Patch02: 0002-linux_udev-only-return-initialized-devices-during-en.patch - - %if %{with mingw} BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-gcc-c++