Bug 823886

Summary: Review Request: libusbx - Library for accessing USB devices
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: Package ReviewAssignee: Oron Peled <oron>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: elad, notting, oron, package-review, the.ridikulus.rat
Target Milestone: ---Flags: oron: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-23 19:30:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hans de Goede 2012-05-22 11:36:09 UTC
Spec URL: http://people.fedoraproject.org/~jwrdegoede/libusbx.spec
SRPM URL: http://people.fedoraproject.org/~jwrdegoede/libusbx-1.0.11-1.fc15.src.rpm
Description:
This package provides a way for applications to access USB devices. Note that
this library is not compatible with the original libusb-0.1 series.

Note this is a *rename* Review Request, libusbx is a replacement for libusb1. libusbx is actually a fork of
libusb-1.0, by most of the libusb developers, done out of unhappiness with the total lack of releases
by the libusb-1.0 maintainer.

Fedora Account System Username: jwrdegoede

Comment 1 Elad Alfassa 2012-05-22 16:01:33 UTC
Not a review, just a comment:
Replace the URL feild with a URL that actually points to a libusbx projectpage instead of libusb1

Comment 2 Elad Alfassa 2012-05-22 16:05:17 UTC
Also, might be better to convert these files to UTF8 upstream and not at build time.

Comment 3 Hans de Goede 2012-05-22 16:22:22 UTC
(In reply to comment #1)
> Not a review, just a comment:
> Replace the URL feild with a URL that actually points to a libusbx
> projectpage instead of libusb1

Oh, I thought I had fixed that, ah well will fix before import, or in the next revision of more issues are found.

Comment 4 Elad Alfassa 2012-05-22 16:51:07 UTC
If nobody else will pick this for review, I will review it later this week.

Comment 5 Oron Peled 2012-05-23 07:26:22 UTC
* Elad:
  - If you approve I'd very much like to review this package as I have used
    the older libusb quite a bit and have personal interest to check and
    later on migrate my code to a saner substitute.
     [For the interested: http://svn.asterisk.org/svn/dahdi/tools/trunk/xpp
     specifically, astribank_usb.[ch] and the xtalk/ subdirectory]

  - If you want another review, may I suggest:
       https://bugzilla.redhat.com/show_bug.cgi?id=591190
    Which was abandoned by its reviewer some 2 years ago (but not by me)

  - That concludes my foot-in-the-doorstep. If I stepped on your toes, just
    cry foul and I'll shamefully go away ;-)

* Hans, a review is on flight (unless preempted by Elad)

Comment 6 Elad Alfassa 2012-05-23 08:18:29 UTC
Sure, go ahead and review it :)

Comment 7 Oron Peled 2012-05-23 08:30:24 UTC
Package Review
==============

Key:
- = N/A
x = Pass
! = Fail
? = Not evaluated



==== C/C++ ====
[x]: MUST Header files in -devel subpackage, if present.
[x]: MUST Package does not contain any libtool archives (.la)
[x]: MUST Package does not contain kernel modules.
[x]: MUST Package contains no static executables.
[x]: MUST Rpath absent or only used for internal libs.
[x]: MUST Package is not relocatable.
[x]: MUST Development .so files in -devel subpackage, if present.


==== Generic ====
[x]: MUST Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: MUST Package successfully compiles and builds into binary rpms on at
     least one supported primary architecture.
[x]: MUST All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[x]: MUST Buildroot is not present
     Note: Unless packager wants to package for EPEL5 this is fine
[x]: MUST Package contains no bundled libraries.
[?]: MUST Changelog in prescribed format.

* The .spec file Changelog entry is OK.

* However, upstream ChangeLog points to git:
  - We cannot grab this during build (no network operations)
  - Upstream is correct (IMO), not maintaining a separate ChangeLog
  - The correct way is for upstream to generate it in a 'dist-hook'
    and add it to EXTRA_DIST. This way, tarball releases would
    contain a bundled and up to date ChangeLog as they should.
  - OTOH, upstream NEWS file looks very much like a changelog... hmmm...

[x]: MUST Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: Clean would be needed if support for EPEL is required
[x]: MUST Sources contain only permissible code or content.
[x]: MUST Each %files section contains %defattr if rpm < 4.4
     Note: Note: defattr macros not found. They would be needed for EPEL5
[x]: MUST Macros in Summary, %description expandable at SRPM build time.
[x]: MUST Package requires other packages for directories it uses.
[x]: MUST Package uses nothing in %doc for runtime.
[x]: MUST Package is not known to require ExcludeArch.
[x]: MUST Permissions on files are set properly.
[x]: MUST Package does not contain duplicates in %files.
[x]: MUST Spec file lacks Packager, Vendor, PreReq tags.
[x]: MUST Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
     Note: rm -rf would be needed if support for EPEL5 is required
[x]: MUST If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %doc.
[x]: MUST License field in the package spec file matches the actual license.
[x]: MUST License file installed when any subpackage combination is installed.
[x]: MUST Package consistently uses macros (instead of hard-coded directory
     names).
[x]: MUST Package meets the Packaging Guidelines.
[x]: MUST Package is named according to the Package Naming Guidelines.
[x]: MUST Package does not generates any conflict.

Problematic Obsoletes?
 * Many existing packages depends on either libusb, libusb1:
     [xxxx@rawhide ~]$ repoquery --whatrequires libusb1 | wc -l
     53
     [xxxx@rawhide ~]$ repoquery --whatrequires libusb | wc -l
     86

 * Upstream do not hint in the provided README, etc that this
   is a fork of libusb1 and plug-in compatible with libusb1=<version>:
   - It would be easier to track this if they did.

   - You mention this in the .spec changelog. I think this information
     is important enough to warrant a paragraph in %description
     (so people comparing their installed software with some upstream
     source can have a clue)

   - Failing to notice your changelog remark, I googled for libusb1,libusbx
     and hit your mail from yesterday. Maybe (an edited) version of this
     may be added to %doc as README.Fedora

 * OK, assuming full ABI compatiblity (of current versions) there are no
   problematic obsoletes, just my problematic understanding of the situation.

[x]: MUST Package obeys FHS, except libexecdir and /usr/target.
[x]: MUST Package must own all directories that it creates.
[x]: MUST Package does not own files or directories owned by other packages.
[x]: MUST Package installs properly.
[!]: MUST Package requires pkgconfig, if .pc files are present. (EPEL5)
     Note: Only applicable for EL-5

Ignore. This is OK for Fedora.

[x]: MUST Requires correct, justified where necessary.
[!]: MUST Rpmlint output is silent.

OK. Replacing userspace with user-space would drop some of the
spurious spelling errors (personal taste, could be ignored)

rpmlint libusbx-1.0.11-1.fc18.src.rpm

libusbx.src: W: spelling-error Summary(en_US) userspace -> user space, user-space, users pace
libusbx.src: W: spelling-error %description -l en_US libusb -> libelous
1 packages and 0 specfiles checked; 0 errors, 2 warnings.


rpmlint libusbx-debuginfo-1.0.11-1.fc18.i686.rpm

1 packages and 0 specfiles checked; 0 errors, 0 warnings.


rpmlint libusbx-1.0.11-1.fc18.i686.rpm

libusbx.i686: W: spelling-error Summary(en_US) userspace -> user space, user-space, users pace
libusbx.i686: W: spelling-error %description -l en_US libusb -> libelous
1 packages and 0 specfiles checked; 0 errors, 2 warnings.


rpmlint libusbx-devel-doc-1.0.11-1.fc18.noarch.rpm

libusbx-devel-doc.noarch: E: devel-dependency libusbx-devel
1 packages and 0 specfiles checked; 1 errors, 0 warnings.


rpmlint libusbx-devel-1.0.11-1.fc18.i686.rpm

libusbx-devel.i686: W: no-documentation
1 packages and 0 specfiles checked; 0 errors, 1 warnings.


[x]: MUST Sources used to build the package match the upstream source, as
     provided in the spec URL.

MD5SUM this package     : 9aaab6aee72f65900cc731ecbffb4cf4
OK.

[x]: MUST Spec file is legible and written in American English.
[x]: MUST Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[-]: MUST Package contains a SysV-style init script if in need of one.
[x]: MUST File names are valid UTF-8.
[x]: SHOULD Reviewer should test that the package builds in mock.
[-]: SHOULD If the source package does not include license text(s) as a
     separate file from upstream, the packager SHOULD query upstream to
     include it.
[x]: SHOULD Dist tag is present.
[x]: SHOULD No file requires outside of /etc, /bin, /sbin, /usr/bin,
     /usr/sbin.
[x]: SHOULD Final provides and requires are sane (rpm -q --provides and rpm -q
     --requires).
[x]: SHOULD Package functions as described.

Not tested yet. Not a blocker.

[x]: SHOULD Package does not include license text files separate from
     upstream.
[x]: SHOULD The placement of pkgconfig(.pc) files are correct.
[x]: SHOULD Scriptlets must be sane, if used.
[!]: SHOULD SourceX is a working URL.

Yes, but the URL tag seems dubious:
 - Shouldn't it be:
      http://sourceforge.net/projects/libusbx

 - The existing:
      http://libusb.wiki.sourceforge.net/Libusb1.0
   Redirects to:
      http://sourceforge.net/projects/libusb/develop
   Which looks like an older upstream project

[-]: SHOULD Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: SHOULD Package should compile and build into binary rpms on all supported
     architectures.
[x]: SHOULD %check is present and all tests pass.

It would be nice if some of the examples would actually be
used for 'make check'. For example the listdevs.c is probabely
usefull to test compile+link+run. This should probably work
even within mock (or Debian pbuilder) where actuall USB devices
are not accessible.

[x]: SHOULD Packages should try to preserve timestamps of original installed
     files.

As Elad already mentioned, UTF-8 of example source code should be
patched upstream. Your (hopefully temporary) workaround is OK.

[x]: SHOULD Spec use %global instead of %define.

Comment 8 Hans de Goede 2012-05-23 10:06:06 UTC
Hi,

Thanks for the review!

I've fixed the URL field and send a mail upstream about
fixing the UTF-8 issue for example/*.c

> [?]: MUST Changelog in prescribed format.
> 
> * The .spec file Changelog entry is OK.
> 
> * However, upstream ChangeLog points to git:
>   - We cannot grab this during build (no network operations)
>   - Upstream is correct (IMO), not maintaining a separate ChangeLog
>   - The correct way is for upstream to generate it in a 'dist-hook'
>     and add it to EXTRA_DIST. This way, tarball releases would
>     contain a bundled and up to date ChangeLog as they should.
>   - OTOH, upstream NEWS file looks very much like a changelog... hmmm...

Yes NEWS is the human readable form of the ChangeLog, iow it summarizes
all the important changes while leaving out things like formatting cleanups :)

So I believe that just shipping NEWS is the right thing to do, this provides
the right amount of information for users / developers using libusbx, rather
then people actually developping libusbx itself. And the latter catagory
can simply look at the git history.

> Problematic Obsoletes?
>  * Many existing packages depends on either libusb, libusb1:
>      [xxxx@rawhide ~]$ repoquery --whatrequires libusb1 | wc -l
>      53
>      [xxxx@rawhide ~]$ repoquery --whatrequires libusb | wc -l
>      86
> 

Right, notice that this package does not touch libusb-0.1 (which we package
as libusb. It "only" replaces libusb-1.0 (which we package as libusb1).

>  * Upstream do not hint in the provided README, etc that this
>    is a fork of libusb1 and plug-in compatible with libusb1=<version>:
>    - It would be easier to track this if they did.
> 
>    - You mention this in the .spec changelog. I think this information
>      is important enough to warrant a paragraph in %description
>      (so people comparing their installed software with some upstream
>      source can have a clue)

Good idea, I've extended the %description to include the relevant information
 
>    - Failing to notice your changelog remark, I googled for libusb1,libusbx
>      and hit your mail from yesterday. Maybe (an edited) version of this
>      may be added to %doc as README.Fedora

I've opted to instead add the relevant bits to %description, as I would like
the stay as close to upstream as possible and not add any Fedora specific
patches / README files.

>  * OK, assuming full ABI compatiblity (of current versions) there are no
>    problematic obsoletes, just my problematic understanding of the situation.

Yes libusbx is fully ABI and API compatible with libusb-1.0.x (upto 1.0.9, which
is the latest release.

> OK. Replacing userspace with user-space would drop some of the
> spurious spelling errors (personal taste, could be ignored)

I've opted to instead just drop userspace making the Summary:
Library for accessing USB devices

"Library" already makes it clear this is for userspace apps :)

> Yes, but the URL tag seems dubious:
>  - Shouldn't it be:
>       http://sourceforge.net/projects/libusbx

Right, I somehow got it wrong, fixed.

> [x]: SHOULD %check is present and all tests pass.
> 
> It would be nice if some of the examples would actually be
> used for 'make check'. For example the listdevs.c is probabely
> usefull to test compile+link+run. This should probably work
> even within mock (or Debian pbuilder) where actuall USB devices
> are not accessible.

Good idea, I've instead added --enable-examples-build to %configure, which does
the same but then as part of %build

Here is a new version with all of the above fixes:
Spec URL: http://people.fedoraproject.org/~jwrdegoede/libusbx.spec
SRPM URL: http://people.fedoraproject.org/~jwrdegoede/libusbx-1.0.11-2.fc15.src.rpm

Comment 9 Oron Peled 2012-05-23 13:27:12 UTC
> > [?]: MUST Changelog in prescribed format.
> > * The .spec file Changelog entry is OK.
> > 
> > * However, upstream ChangeLog points to git:
> >   - We cannot grab this during build (no network operations)
> >   - Upstream is correct (IMO), not maintaining a separate ChangeLog
> >   - The correct way is for upstream to generate it in a 'dist-hook'
> >     and add it to EXTRA_DIST. This way, tarball releases would
> >     contain a bundled and up to date ChangeLog as they should.
> >   - OTOH, upstream NEWS file looks very much like a changelog... hmmm...
> 
> Yes NEWS is the human readable form of the ChangeLog, iow it summarizes
> all the important changes while leaving out things like formatting cleanups :)
> So I believe that just shipping NEWS is the right thing to do, this provides
> the right amount of information for users / developers using libusbx, rather
> then people actually developping libusbx itself. And the latter catagory
> can simply look at the git history.

Agreed.

> > Problematic Obsoletes?
> >  * Many existing packages depends on either libusb, libusb1:
> >      [xxxx@rawhide ~]$ repoquery --whatrequires libusb1 | wc -l
> >      53
> >      [xxxx@rawhide ~]$ repoquery --whatrequires libusb | wc -l
> >      86
> > 
> 
> Right, notice that this package does not touch libusb-0.1 (which we package
> as libusb. It "only" replaces libusb-1.0 (which we package as libusb1).
>> >  * Upstream do not hint in the provided README, etc that this
> >    is a fork of libusb1 and plug-in compatible with libusb1=<version>:
> >    - It would be easier to track this if they did.
> > 
> >    - You mention this in the .spec changelog. I think this information
> >      is important enough to warrant a paragraph in %description
> >      (so people comparing their installed software with some upstream
> >      source can have a clue)
> 
> Good idea, I've extended the %description to include the relevant information

+1

> >    - Failing to notice your changelog remark, I googled for libusb1,libusbx
> >      and hit your mail from yesterday. Maybe (an edited) version of this
> >      may be added to %doc as README.Fedora
> 
> I've opted to instead add the relevant bits to %description, as I would like
> the stay as close to upstream as possible and not add any Fedora specific
> patches / README files.

+1

> >  * OK, assuming full ABI compatiblity (of current versions) there are no
> >    problematic obsoletes, just my problematic understanding of the situation.
> 
> Yes libusbx is fully ABI and API compatible with libusb-1.0.x (upto 1.0.9, which
> is the latest release.
> 
> > OK. Replacing userspace with user-space would drop some of the
> > spurious spelling errors (personal taste, could be ignored)
> 
> I've opted to instead just drop userspace making the Summary:
> Library for accessing USB devices
> 
> "Library" already makes it clear this is for userspace apps :)

+1

> > Yes, but the URL tag seems dubious:
> >  - Shouldn't it be:
> >       http://sourceforge.net/projects/libusbx
> 
> Right, I somehow got it wrong, fixed.

It now points to project wiki -- good.

> > [x]: SHOULD %check is present and all tests pass.
> > 
> > It would be nice if some of the examples would actually be
> > used for 'make check'. For example the listdevs.c is probabely
> > usefull to test compile+link+run. This should probably work
> > even within mock (or Debian pbuilder) where actuall USB devices
> > are not accessible.
> 
> Good idea, I've instead added --enable-examples-build to %configure, which does
> the same but then as part of %build

OK.


Package APPROVED

Comment 10 Hans de Goede 2012-05-23 14:21:48 UTC
New Package SCM Request
=======================
Package Name: libusbx
Short Description: Library for accessing USB devices
Owners: jwrdegoede jnovy jvcelak
Branches: 
InitialCC: lucilanga ndim

Comment 11 Gwyn Ciesla 2012-05-23 14:31:25 UTC
Git done (by process-git-requests).

Comment 12 Oron Peled 2012-05-23 16:24:06 UTC
Huston we have a (dependency) problem:
 - On Fedora-15 I have libguestfs-1.10.12-1.fc15.i686 installed

 - It has:
      rpm -q --requires libguestfs | grep usb
      /lib/libusb-0.1.so.4  
      /lib/libusb-1.0.so.0

 - Trying yum localinstall libusbx-*.i686.rpm yield a conflict

 - Removing libguestfs enabled installing libusbx-*.i686.rpm

 - Trying to reinstall libguestfs, result in the following funny result:
      yum --obsoletes install libguestfs
      ... bla bla bla ... confirming ...
      Downloading Packages:
      Running rpm_check_debug
      ERROR with rpm_check_debug vs depsolve:
      libusb1 <= 1.0.9 is obsoleted by (installed) libusbx-1.0.11-2.fc15.i686
      Please report this error in http://yum.baseurl.org/report

So:
  - I think the dependency problem is libguestfs fault (notice the
    explicit path: /lib/libusb.... vs. libusb... in other packages)
         repoquery --whatrequires /lib/libusb-1.0.so.0
         libguestfs-1:1.10.2-1.fc15.i686

  - Also as side effect, we uncover a yum bug

Seems like I'll have to open two new BR (later, must run now)

Comment 13 Hans de Goede 2012-05-23 17:46:30 UTC
Hi,

(In reply to comment #12)
>   - I think the dependency problem is libguestfs fault (notice the
>     explicit path: /lib/libusb.... vs. libusb... in other packages)
>          repoquery --whatrequires /lib/libusb-1.0.so.0
>          libguestfs-1:1.10.2-1.fc15.i686

Right sounds like a libguestfs packaging bug, good work on catching this, and thanks in advance
for the bug you're going to file for this :)

Regards,

Hans

Comment 14 Hans de Goede 2012-05-23 19:30:35 UTC
Imported & build for rawhide.

Retire procedure for libusb1 completed, rel-eng libusb1 block request for rawhide here:
https://fedorahosted.org/rel-eng/ticket/5198

Closing.

Comment 15 Oron Peled 2012-05-24 21:23:33 UTC
Filed bug #825034 against libguestfs in F15 (F16, F17, rawhide are OK) because
its broken dependency prevents replacing libusb1 with libusbx.