Bug 997880 - RFE: Switch to use libusbx instead of libusb
Summary: RFE: Switch to use libusbx instead of libusb
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libgphoto2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-16 11:14 UTC by Daniel Berrangé
Modified: 2013-08-16 13:56 UTC (History)
3 users (show)

Fixed In Version: libgphoto2-2.5.2-4.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-16 13:56:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2013-08-16 11:14:42 UTC
Description of problem:
I recently identified a flaw in libusb which was causing libgphoto to crash after dlclose() of the libusb.so library

  https://bugzilla.redhat.com/show_bug.cgi?id=996760

While a workaround has been done in libusb to prevent the crash, this isn't an ideal solution. It would be better if libgphoto2 just used  libusbx instead, which has new APIs which allow it to avoid the problem scenario entirely.

It appears that libgphoto2 already has support for libusb1 / libusbx - all that is required is to update the BuildRequires in the specfile.

diff --git a/libgphoto2.spec b/libgphoto2.spec
index 241d49d..0d8109b 100644
--- a/libgphoto2.spec
+++ b/libgphoto2.spec
@@ -13,7 +13,7 @@ Patch1:         gphoto2-pkgcfg.patch
 Patch2:         gphoto2-storage.patch
 Patch3:         gphoto2-ixany.patch
 Patch4:         gphoto2-device-return.patch
-BuildRequires:  libusb1-devel, libusb-devel >= 0.1.5
+BuildRequires:  libusbx-devel
 BuildRequires:  lockdev-devel
 BuildRequires:  libexif-devel
 BuildRequires:  libjpeg-devel
@@ -35,7 +35,6 @@ however, such as gtkam for example.
 Summary:        Headers and links to compile against the libgphoto2 library
 Group:          Development/Libraries
 Requires:       %{name}%{?_isa} = %{version}-%{release}
-Requires:       libusb-devel >= 0.1.5, libexif-devel
 Obsoletes:      gphoto2-devel < 2.4.0-11
 Provides:       gphoto2-devel = %{version}-%{release}
 

Note the 'Requires' in the devel RPM here is not required. The header files in the libgphoto-devel RPM don't #include any libusb or libexif header files


$ rpm -ql libgphoto2-devel | grep include | xargs grep '#include' | grep -v '<gphoto2'
grep: /usr/include/gphoto2: Is a directory
/usr/include/gphoto2/gphoto2-context.h:#include <stdarg.h>
/usr/include/gphoto2/gphoto2-file.h:#include <time.h>
/usr/include/gphoto2/gphoto2-file.h:#include <stdint.h>
/usr/include/gphoto2/gphoto2-filesys.h:#include <time.h>
/usr/include/gphoto2/gphoto2-filesys.h:#include <stdint.h>
/usr/include/gphoto2/gphoto2-port-log.h:#include <stdarg.h>
/usr/include/gphoto2/gphoto2-port.h:#include <os2.h>


so I suggest dropping that Requires line from the devel package.

Version-Release number of selected component (if applicable):
libgphoto2-2.5.2-1.fc19

How reproducible:
N/a

Steps to Reproduce:
1. N/a
2.
3.

Actual results:
/usr/lib/libgphoto2_port/0.10.0/usb.so  exists and dep on libusb RPM


Expected results:
Only /usr/lib/libgphoto2_port/0.10.0/usb1.so exists and no dep on libusb RPM

Additional info:

Comment 1 Tim Waugh 2013-08-16 13:56:03 UTC
Thanks. Fixed in:
  libgphoto2-2.5.2-4.fc19
  libgphoto2-2.5.2-4.fc20


Note You need to log in before you can comment on or make changes to this bug.