From 8b47afbce1f2451bc64db70be917e58f8af451f7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 19 2021 08:19:50 +0000 Subject: import libusb-0.1.5-12.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a36dc32 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libusb-compat-0.1.5.tar.bz2 diff --git a/.libusb.metadata b/.libusb.metadata new file mode 100644 index 0000000..a216b2d --- /dev/null +++ b/.libusb.metadata @@ -0,0 +1 @@ +062319276d913c753a4b1341036e6a2e42abccc9 SOURCES/libusb-compat-0.1.5.tar.bz2 diff --git a/SOURCES/0001-Link-with-znodelete-to-disallow-unloading.patch b/SOURCES/0001-Link-with-znodelete-to-disallow-unloading.patch new file mode 100644 index 0000000..4534ab7 --- /dev/null +++ b/SOURCES/0001-Link-with-znodelete-to-disallow-unloading.patch @@ -0,0 +1,51 @@ +From a9e8373030b39aadfc33af67443085df83e9e344 Mon Sep 17 00:00:00 2001 +From: Daniel Berrange +Date: Wed, 14 Aug 2013 16:00:56 +0200 +Subject: [libusb-compat PATCH] Link with -znodelete to disallow unloading + +Since libusb-0.1 did not have any init / exit function, code using the +libusb-0.1 API will not call libusb_exit. + +Now, libgphoto uses libusb and will dlopen() and dlclose() it. Unfortunately +since there is no way to ensure libusb_close() is called, when libgphoto +dlcloses the libusb.so library, the thread from libusbx.so will not be +stopped. So a thread will remain running, executing code from a memory +region that has now been freed. Crash-tastic results ensue. + +I don't see a good way to fix this from libusb or libusbx, given the need to +preserve the existing API of libusb. + +If, however, we link libusb.so using -znodelete, we will prevent it from +ever being unloaded, despite the dlclose() calls. This is not ideal, but +better than allowing it to be unloaded which is a guaranteed crash. + +Signed-off-by: Hans de Goede +--- + libusb/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libusb/Makefile.am b/libusb/Makefile.am +index 33a609a..a20fdb5 100644 +--- a/libusb/Makefile.am ++++ b/libusb/Makefile.am +@@ -5,5 +5,5 @@ libusb_la_SOURCES = core.c usbi.h + libusb_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) $(LIBUSB_1_0_CFLAGS) + libusb_la_LIBADD = $(LIBUSB_1_0_LIBS) + libusb_la_LDFLAGS = -version-info $(LT_MAJOR):$(LT_REVISION):$(LT_AGE) \ +- -release 0.1 ++ -release 0.1 -Wl,-z -Wl,nodelete + +--- libusb-compat-0.1.5.orig/libusb/Makefile.in 2013-05-21 00:40:35.000000000 +0100 ++++ libusb-compat-0.1.5.orig/libusb/Makefile.in 2013-08-13 22:20:32.831532426 +0100 +@@ -297,7 +297,7 @@ libusb_la_SOURCES = core.c usbi.h + libusb_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) $(LIBUSB_1_0_CFLAGS) + libusb_la_LIBADD = $(LIBUSB_1_0_LIBS) + libusb_la_LDFLAGS = -version-info $(LT_MAJOR):$(LT_REVISION):$(LT_AGE) \ +- -release 0.1 ++ -release 0.1 -Wl,-z -Wl,nodelete + + all: all-am + +-- +1.8.3.1 + diff --git a/SOURCES/0002-Revert-use-atexit-to-call-libusb_exit.patch b/SOURCES/0002-Revert-use-atexit-to-call-libusb_exit.patch new file mode 100644 index 0000000..65a2b1b --- /dev/null +++ b/SOURCES/0002-Revert-use-atexit-to-call-libusb_exit.patch @@ -0,0 +1,55 @@ +From eb590b4dac00a5188b93e1d6ebdd60b06f9ab3d7 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 13 Feb 2014 17:25:27 +0100 +Subject: [libusb-compat PATCH 2/2] Revert "use atexit() to call libusb_exit()" + +The use of atexit() breaks various users of libusb-compat, +see ie: https://bugzilla.redhat.com/show_bug.cgi?id=1003193 + +This reverts commit 0be16b8dd25733d242ae32b57823a9513ec21353. + +Closes libusbx/libusb-compat-0.1#2 + +Signed-off-by: Hans de Goede +--- + libusb/core.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/libusb/core.c b/libusb/core.c +index c0ccb1f..2dd1b5f 100644 +--- a/libusb/core.c ++++ b/libusb/core.c +@@ -21,7 +21,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -137,13 +136,6 @@ static void usbi_log(enum usbi_log_level level, const char *function, + fprintf(stream, "\n"); + } + +-static void _usb_finalize(void) { +- if (ctx) { +- libusb_exit(ctx); +- ctx = NULL; +- } +-} +- + API_EXPORTED void usb_init(void) + { + int r; +@@ -159,8 +151,6 @@ API_EXPORTED void usb_init(void) + /* usb_set_debug can be called before usb_init */ + if (usb_debug) + libusb_set_debug(ctx, 3); +- +- atexit(_usb_finalize); + } + } + +-- +1.8.5.3 + diff --git a/SOURCES/libusb-config-multilib.patch b/SOURCES/libusb-config-multilib.patch new file mode 100644 index 0000000..4c5ac2e --- /dev/null +++ b/SOURCES/libusb-config-multilib.patch @@ -0,0 +1,25 @@ +Resolve multilib conflict in 'libusb-config' script by removing $libdir variable entirely. + +http://fedoraproject.org/wiki/PackagingDrafts/MultilibTricks#Multiarch.2C_binaries_and_compilation_scripts + +Author: Jan Vcelak +Date: 2011-06-22 + +diff -uNPrp libusb-compat-0.1.3/libusb-config.in libusb-compat-0.1.3.multilib/libusb-config.in +--- libusb-compat-0.1.3/libusb-config.in 2009-06-23 23:45:33.000000000 +0200 ++++ libusb-compat-0.1.3.multilib/libusb-config.in 2011-06-22 09:55:59.810188470 +0200 +@@ -3,7 +3,6 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + includedir=@includedir@ +-libdir=@libdir@ + exec_prefix_set=no + + usage() +@@ -77,5 +76,5 @@ if test "$echo_cflags" = "yes"; then + echo $includes + fi + if test "$echo_libs" = "yes"; then +- echo -L$libdir -lusb ++ echo -lusb + fi diff --git a/SPECS/libusb.spec b/SPECS/libusb.spec new file mode 100644 index 0000000..a928323 --- /dev/null +++ b/SPECS/libusb.spec @@ -0,0 +1,337 @@ +Name: libusb +Epoch: 1 +Version: 0.1.5 +Release: 12%{?dist} +Summary: A library which allows userspace access to USB devices +Group: System Environment/Libraries +License: LGPLv2+ +URL: http://sourceforge.net/projects/libusb/ +Source0: http://downloads.sourceforge.net/libusb/libusb-compat-%{version}.tar.bz2 +Patch0: libusb-config-multilib.patch +Patch1: 0001-Link-with-znodelete-to-disallow-unloading.patch +Patch2: 0002-Revert-use-atexit-to-call-libusb_exit.patch +BuildRequires: libusb1-devel + +%description +This package provides a way for applications to access USB devices. +Legacy libusb-0.1 is no longer supported by upstream, therefore content of this +package was replaced by libusb-compat. It provides compatibility layer allowing +applications written for libusb-0.1 to work with libusb-1.0. + + +%package devel +Summary: Development files for libusb +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} + +%description devel +This package contains the header files, libraries and documentation needed to +develop applications that use libusb-0.1. However new applications should use +libusb-1.0 library instead of this one. + + +%prep +%setup -q -n libusb-compat-%{version} +%patch0 -p1 -b .config-multilib +%patch1 -p1 +%patch2 -p1 + + +%build +%configure --disable-static +make %{?_smp_mflags} + + +%install +%make_install +rm $RPM_BUILD_ROOT%{_libdir}/libusb.la + + +%ldconfig_scriptlets + + +%files +%doc AUTHORS COPYING ChangeLog NEWS README +%{_libdir}/libusb-0.1.so.* + +%files devel +%{_includedir}/usb.h +%{_libdir}/libusb.so +%{_libdir}/pkgconfig/libusb.pc +%{_bindir}/libusb-config + + +%changelog +* Wed Feb 07 2018 Fedora Release Engineering - 1:0.1.5-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 1:0.1.5-11 +- Switch to %%ldconfig_scriptlets + +* Thu Aug 03 2017 Fedora Release Engineering - 1:0.1.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1:0.1.5-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1:0.1.5-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1:0.1.5-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1:0.1.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 1:0.1.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1:0.1.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Feb 13 2014 Hans de Goede - 0.1.5-3 +- Revert atexit patch (rhbz#1003193) + +* Wed Aug 14 2013 Hans de Goede - 0.1.5-2 +- Link with -znodelete to fix crash on unload of dl-opened code (rhbz#996760) + +* Sun Aug 04 2013 Hans de Goede - 0.1.5-1 +- Update to 0.1.5 (#965414) +- Drop unused -static subpackage + +* Sat Aug 03 2013 Fedora Release Engineering - 1:0.1.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jan 28 2013 Jindrich Novy 0.1.4-1 +- update to 0.1.4 (#904748) +- drop upstreamed patches +- fix changelog dates + +* Mon Nov 19 2012 Nils Philippsen - 1:0.1.3-12 +- update sourceforge download URL + +* Thu Jul 19 2012 Fedora Release Engineering - 1:0.1.3-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1:0.1.3-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Jun 22 2011 Jan Vcelak 0.1.3-9 +- resolve multilib conflict in 'libusb-config' script + +* Tue Jun 21 2011 Jan Vcelak 0.1.3-8 +- add libusb-config into -devel subpackage (#713483) + +* Tue Feb 08 2011 Fedora Release Engineering - 1:0.1.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Jan 26 2011 Jan Vcelak 1:0.1.3-6 +- pkg-config file has to be in /usr/lib/pkgconfig + +* Tue Jan 25 2011 Jan Vcelak 1:0.1.3-5 +- move libraries from /usr/lib to /lib (#519716) + +* Wed Sep 29 2010 jkeating - 1:0.1.3-4 +- Rebuilt for gcc bug 634757 + +* Tue Sep 14 2010 Jan Vcelak 0.1.3-3 +- add USB access error logging (#628356) +- update README + +* Sat Aug 28 2010 Rex Dieter 1:0.1.3-2 +- fix epoch-related bustage + +* Fri Aug 27 2010 Jan Vcelak 0.1.3-1 +- legacy libusb-0.1 replaced with libusb-compat + +* Wed Jun 23 2010 Jan Vcelak 0.1.12-23 +- fixes invalid read causing segfault (#565904) + +* Sat Jul 25 2009 Fedora Release Engineering - 0.1.12-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 0.1.12-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Oct 21 2008 Jindrich Novy 0.1.12-20 +- remove ExcludeArch: s390 s390x, libusb works fine there (#467768) + +* Tue Oct 14 2008 Jindrich Novy 0.1.12-19 +- don't apply the concurrency timeout handling patch, it breaks + pilot-link (#456811) + +* Mon Oct 6 2008 Jindrich Novy 0.1.12-18 +- fix multiarch conflict in libusb-devel (#465209) + +* Sat Aug 2 2008 Jindrich Novy 0.1.12-17 +- apply patch from Graeme Gill to fix concurrency timeout + handling (#456811) + +* Fri Apr 18 2008 Jindrich Novy 0.1.12-16 +- rebuild to fix broken ppc build + +* Tue Feb 26 2008 Jindrich Novy 0.1.12-15 +- don't apply wakeups patch until it's fixed, it causes problems + with Eye-One Pro (#434950) + +* Mon Feb 25 2008 Jindrich Novy 0.1.12-14 +- manual rebuild because of gcc-4.3 (#434189) + +* Tue Feb 19 2008 Fedora Release Engineering - 0.1.12-13 +- Autorebuild for GCC 4.3 + +* Tue Dec 4 2007 Jindrich Novy 0.1.12-12 +- remove unnecessary 1ms wakeups while USB transfers are in progress, + thanks to Scott Lamb (#408131) + +* Tue Nov 6 2007 Jindrich Novy 0.1.12-11 +- fix multilib conflict in manual.ps (#342461) +- drop useless BR: gawk + +* Thu Aug 23 2007 Jindrich Novy 0.1.12-10 +- optimize usb_find_devices() and use openat() instead of open() + (#273901), thanks to Ulrich Drepper +- BR gawk + +* Thu Aug 23 2007 Jindrich Novy 0.1.12-9 +- update License +- rebuild for BuildID + +* Wed Aug 1 2007 Jindrich Novy 0.1.12-8 +- don't use uninitialized buffers on stack (#250274) + +* Thu Feb 08 2007 Jindrich Novy 0.1.12-7 +- merge review spec fixes (#226053) +- create -static subpackage to ship static libs separately +- don't use auto* stuff, drop automake, libtool deps +- BuildRequire openjade, fix Requires + +* Tue Dec 12 2006 Jindrich Novy 0.1.12-6 +- fix BuildRoot, add dist tag, rpmlint warnfixes + +* Wed Jul 12 2006 Jesse Keating - 0.1.12-5.1 +- rebuild + +* Thu Jun 08 2006 Jesse Keating 0.1.12-5 +- Add missing BR automake, libtool. +- Add missing Requires in -devel on pkgconfig + +* Thu Jun 1 2006 Jindrich Novy 0.1.12-4 +- remove .la files from libusb-devel (#172643) + +* Tue May 30 2006 Jindrich Novy 0.1.12-3 +- use pkg-config calls in libusb-config instead of hardcoded + defaults to avoid multiarch conflicts (#192714) + +* Fri May 5 2006 Jindrich Novy 0.1.12-2 +- add docbook-utils-pdf BuildRequires (#191744) + +* Mon Mar 6 2006 Jindrich Novy 0.1.12-1 +- update to 0.1.12 +- drop .format, .searchorder patches, applied upstream + +* Fri Feb 10 2006 Jesse Keating - 0.1.11-2.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 0.1.11-2.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Jan 27 2006 Jindrich Novy 0.1.11-2 +- change device search order, /dev/bus/usb is tried first, + then /proc/bus/usb, and never try /sys/bus/usb (#178994) + +* Fri Jan 20 2006 Jindrich Novy 0.1.11-1 +- 0.1.11 +- require pkgconfig, package libusb.pc +- fix printf format in linux.c so that libusb can be built with -Werror (default) + +* Mon Dec 19 2005 Tim Waugh 0.1.10a-3 +- Rebuild. + +* Fri Dec 16 2005 Jesse Keating +- rebuilt for new gcj + +* Mon Nov 21 2005 Tim Waugh 0.1.10a-2 +- Build does not require xorg-x11-devel. Fixes rebuild problem (no more + xorg-x11-devel package). + +* Wed Mar 9 2005 Tim Waugh 0.1.10a-1 +- 0.1.10a. + +* Wed Mar 2 2005 Tim Waugh 0.1.10-2 +- Rebuild for new GCC. + +* Fri Feb 11 2005 Tim Waugh 0.1.10-1 +- 0.1.10. + +* Tue Feb 1 2005 Tim Waugh 0.1.9-1 +- Build requires xorg-x11-devel. +- 0.1.9. + +* Sat Jan 08 2005 Florian La Roche +- rebuilt to get rid of legacy selinux filecontexts + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Tue May 25 2004 Tim Waugh 0.1.8-3 +- Run aclocal/autoconf to make shared libraries work again. + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Wed Feb 11 2004 Tim Waugh 0.1.8-1 +- 0.1.8. + +* Tue Jun 17 2003 Tim Waugh 0.1.7-3 +- Fixed spec file. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Mar 19 2003 Tim Waugh +- Use the CFLAGS from the environment. + +* Wed Mar 19 2003 Tim Waugh 0.1.7-1 +- 0.1.7. + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Wed Nov 20 2002 Florian La Roche +- exclude mainframe + +* Tue Jun 25 2002 Tim Waugh 0.1.6-1 +- 0.1.6. + +* Fri Jun 21 2002 Tim Powers 0.1.5-6 +- automated rebuild + +* Fri Jun 21 2002 Tim Waugh 0.1.5-5 +- Rebuild to fix broken deps. + +* Thu May 23 2002 Tim Powers 0.1.5-4 +- automated rebuild + +* Thu Apr 11 2002 Tim Waugh 0.1.5-3 +- Rebuild (fixes bug #63196). + +* Thu Feb 21 2002 Tim Waugh 0.1.5-2 +- Rebuild in new environment. + +* Thu Feb 7 2002 Tim Waugh 0.1.5-1 +- 0.1.5. + +* Fri Jan 25 2002 Tim Waugh 0.1.4-2 +- Rebuild in new environment. +- Work around tarball brokenness (doc directory was not automade). + +* Mon Oct 29 2001 Tim Waugh 0.1.4-1 +- Adapted for Red Hat Linux. +- 0.1.4. + +* Thu Mar 1 2001 Frederic Crozat 0.1.3b-1mdk +- Initial Mandrake release