Bug 1175270 - Review Request: usbip - USB/IP user-space
Summary: Review Request: usbip - USB/IP user-space
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1169478
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-17 12:03 UTC by Jonathan Dieter
Modified: 2015-02-06 07:12 UTC (History)
6 users (show)

Fixed In Version: usbip-3.17-3.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-27 02:55:35 UTC
Type: ---
Embargoed:
zbyszek: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
RPM Fusion 3436 0 None None None Never

Description Jonathan Dieter 2014-12-17 12:03:24 UTC
Spec URL: http://lesloueizeh.com/jdieter/usbip/usbip.spec
SRPM URL: http://lesloueizeh.com/jdieter/usbip/usbip-3.17-1.fc21.src.rpm
Description:
This package contains the user-space for the USB/IP protocol.  The modules were mainstreamed in 3.17 and should be built in Fedora's kernels soon[1].

Please note that you must have the modules built in order to test and install this package.

Fedora Account System Username:
jdieter

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1169478#c5

Comment 1 Jonathan Dieter 2014-12-17 12:07:49 UTC
rpmlint output:
$ rpmlint ./usbip.spec 
./usbip.spec: W: invalid-url Source0: usbip-3.17.tar.xz
0 packages and 1 specfiles checked; 0 errors, 1 warnings.

$ rpmlint ../SRPMS/usbip-3.17-1.fc21.src.rpm 
usbip.src: W: strange-permission extract_usbip.sh 0755L
usbip.src: W: invalid-url Source0: usbip-3.17.tar.xz
1 packages and 0 specfiles checked; 0 errors, 2 warnings.

$ rpmlint ../RPMS/x86_64/usbip-3.17-1.fc21.x86_64.rpm 
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

$ rpmlint ../RPMS/x86_64/usbip-devel-3.17-1.fc21.x86_64.rpm 
usbip-devel.x86_64: W: only-non-binary-in-usr-lib
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

The complaints in the spec and SRPM are because we pull the userspace tools out of the kernel source so we don't have a massive SRPM for a <100K package.

Comment 2 Zbigniew Jędrzejewski-Szmek 2015-01-14 03:29:44 UTC
0. A general question: wouldn't this be better build as a part of the kernel package?

1. remove %clean
2. remove %defattr
3. Consider using %license for COPYING
4. Consider adding something like (copied from another package):

# Use the same directory of the main package for subpackage licence and docs
%global _docdir_fmt %{name}

This will avoid having a doc/usbip-devel directory with one file (or
licenses/usbip-devel directory with one file if you do 3.)

4. Combine the two %systemd_posts into one, it'll reload systemd just once.

5. /etc/default is an abomination. You can incorporate the file into the systemd service file
as a comment. If somebody is doing debugging, they can create
/run/systemd/system/usbip-server.d/override.conf with updates the options (by the
time F22 comes out, systemctl edit usbip-server will do this automatically).

6. Module loading in a service file is very much discouraged. Is is not possible to have the module
load automatically? And rmmod in a service file is usually a bad idea because rmmod can interfere with other
things. Why is this necessary?

7. Drop After=syslog.target.

Looks good.

===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Header files in -devel subpackage, if present.
[x]: ldconfig called in %post and %postun if required.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.
[x]: Development (unversioned) .so files in -devel subpackage, if present.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses found:
     "GPL (v2 or later) (with incorrect FSF address)", "GPL (v2 or later)",
     "Unknown or generated". 10 files have unknown license. Detailed output of
     licensecheck in /var/tmp/1175270-usbip/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[ ]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed
[-]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 61440 bytes in 4 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least one
     supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: 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]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install' ' DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[x]: Package do not use a name that already exist
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as provided
     in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[ ]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: %clean present but not required
[-]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.
[-]: Final provides and requires are sane (see attachments).
[!]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in usbip-devel
It should be added for (your) sanity. An automatic requires is generated on the
library, but it does not include the specific version, and you do not want to have
reports for a mismatching main and devel packages.

[ ]: Package functions as described.
I didn't test it, but at least the binaries work :)

[?]: Latest version is packaged.
I guess that the version depeneds on the branch. It should be 3.18 for rawhide.

[x]: Package does not include license text files separate from upstream.
[x]: SourceX tarball generation or download is documented.
     Note: Package contains tarball without URL, check comments
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Dist tag is present (not strictly required in GL).
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Uses parallel make %{?_smp_mflags} macro.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package is
     arched.
[x]: Package should not use obsolete m4 macros
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: usbip-3.17-1.fc22.x86_64.rpm
          usbip-devel-3.17-1.fc22.x86_64.rpm
          usbip-3.17-1.fc22.src.rpm
usbip-devel.x86_64: W: only-non-binary-in-usr-lib
usbip.src: W: strange-permission extract_usbip.sh 0755L
usbip.src: W: invalid-url Source0: usbip-3.17.tar.xz
3 packages and 0 specfiles checked; 0 errors, 3 warnings.




Rpmlint (installed packages)
----------------------------
<mock-chroot>[root@bupkis /]# rpmlint usbip-devel usbip
usbip-devel.x86_64: W: only-non-binary-in-usr-lib
2 packages and 0 specfiles checked; 0 errors, 1 warnings.
<mock-chroot>[root@bupkis /]# echo 'rpmlint-done:'



Requires
--------
usbip-devel (rpmlib, GLIBC filtered):
    libusbip.so.0()(64bit)
    usbip(x86-64)

usbip (rpmlib, GLIBC filtered):
    /bin/sh
    config(usbip)
    hwdata
    kmod(usbip-core.ko)
    kmod(usbip-host.ko)
    kmod(vhci-hcd.ko)
    libc.so.6()(64bit)
    libudev.so.1()(64bit)
    libudev.so.1(LIBUDEV_183)(64bit)
    libusbip.so.0()(64bit)
    rtld(GNU_HASH)
    systemd



Provides
--------
usbip-devel:
    usbip-devel
    usbip-devel(x86-64)

usbip:
    config(usbip)
    libusbip.so.0()(64bit)
    usbip
    usbip(x86-64)



Generated by fedora-review 0.5.2 (63c24cb) last change: 2014-07-14
Command line :/usr/bin/fedora-review -b 1175270
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api, C/C++
Disabled plugins: Java, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP, Ruby
Disabled flags: EXARCH, EPEL5, BATCH, DISTTAG

Comment 3 Jonathan Dieter 2015-01-14 07:57:52 UTC
Thanks so much for the review!!!  Comments are inline:

(In reply to Zbigniew Jędrzejewski-Szmek from comment #2)
> 0. A general question: wouldn't this be better build as a part of the kernel
> package?

The kernel developers don't want to have to deal maintaining the userspace (which is fair enough).  See the last part of https://bugzilla.redhat.com/show_bug.cgi?id=1169478#c6 and https://bugzilla.redhat.com/show_bug.cgi?id=1169478#c11.

> 1. remove %clean

Done

> 2. remove %defattr

Done

> 3. Consider using %license for COPYING

Done

> 4. Consider adding something like (copied from another package):
> 
> # Use the same directory of the main package for subpackage licence and docs
> %global _docdir_fmt %{name}
> 
> This will avoid having a doc/usbip-devel directory with one file (or
> licenses/usbip-devel directory with one file if you do 3.)

Done

> 4. Combine the two %systemd_posts into one, it'll reload systemd just once.

Done.

> 5. /etc/default is an abomination. You can incorporate the file into the
> systemd service file
> as a comment. If somebody is doing debugging, they can create
> /run/systemd/system/usbip-server.d/override.conf with updates the options
> (by the
> time F22 comes out, systemctl edit usbip-server will do this automatically).

I agree.  The problem is that this package has been in RPM Fusion with the /etc/default config file, so I'm a bit hesitant to possibly break people's configs.  I have removed it for the moment, but if I get any bug reports, I will probably put it back in.

> 6. Module loading in a service file is very much discouraged. Is is not
> possible to have the module
> load automatically? And rmmod in a service file is usually a bad idea
> because rmmod can interfere with other
> things. Why is this necessary?

First off, I agree on rmmod and have removed those.

As for module loading, I don't think there's any other way of loading them only when they're needed.  It's not like we can watch for the appearance of a device or anything like that, and, because there are separate modules for server and client, I'd rather not have them both automatically loaded at startup.

> 7. Drop After=syslog.target.

Done.

<snip>

> [!]: Fully versioned dependency in subpackages if applicable.
>      Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
> usbip-devel
> It should be added for (your) sanity. An automatic requires is generated on
> the
> library, but it does not include the specific version, and you do not want
> to have reports for a mismatching main and devel packages.

I think this might be a false positive.  I do have that line exactly as is for the -devel subpackage.

<snip>

> [?]: Latest version is packaged.
> I guess that the version depeneds on the branch. It should be 3.18 for
> rawhide.

Updating to 3.18.

Updated URLs:
Spec URL: http://lesloueizeh.com/jdieter/usbip/usbip.spec
SRPM URL: http://lesloueizeh.com/jdieter/usbip/usbip-3.18-1.fc21.src.rpm

Comment 4 Igor Gnatenko 2015-01-14 09:00:13 UTC
> %configure --disable-static --with-usbids-dir=/usr/share/hwdata
replace /usr/share with %{_datadir}
> make DESTDIR=%{buildroot} install
replace with %make_install
> install -m ......
for all install calls use '-p' flag to preserver datetime
> Group: ....
drop this tag


other looks good to me

Comment 5 Jonathan Dieter 2015-01-14 09:26:52 UTC
Thanks for your input. Comments inline:

(In reply to Igor Gnatenko from comment #4)
> > %configure --disable-static --with-usbids-dir=/usr/share/hwdata
> replace /usr/share with %{_datadir}

Done.

> > make DESTDIR=%{buildroot} install
> replace with %make_install

Done.

> > install -m ......
> for all install calls use '-p' flag to preserver datetime

Done.

> > Group: ....
> drop this tag

According to http://fedoraproject.org/wiki/Packaging:Guidelines#Group_tag, it's optional and I'd rather keep it, thanks.

> other looks good to me

Thanks

Comment 7 Zbigniew Jędrzejewski-Szmek 2015-01-14 13:12:13 UTC
One more thing: please extend the %description a bit, so that a person who initially has no idea what this is (and/or does not know the acronyms) can easily understand what this package does.

Package is APPROVED.

Comment 8 Jonathan Dieter 2015-01-15 07:38:48 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #7)
> One more thing: please extend the %description a bit, so that a person who
> initially has no idea what this is (and/or does not know the acronyms) can
> easily understand what this package does.

Done.

Thanks so much for the review!!

Comment 9 Jonathan Dieter 2015-01-15 07:41:22 UTC
New Package SCM Request
=======================
Package Name: usbip
Short Description: USB/IP user-space
Upstream URL: http://usbip.sourceforge.net
Owners: jdieter
Branches: f20 f21 el6 epel7
InitialCC:

Comment 10 Gwyn Ciesla 2015-01-15 13:32:15 UTC
Git done (by process-git-requests).

Comment 11 Fedora Update System 2015-01-17 10:22:46 UTC
usbip-3.17-3.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/usbip-3.17-3.fc21

Comment 12 Fedora Update System 2015-01-17 23:56:52 UTC
usbip-3.17-3.fc21 has been pushed to the Fedora 21 testing repository.

Comment 13 Fedora Update System 2015-01-27 02:55:35 UTC
usbip-3.17-3.fc21 has been pushed to the Fedora 21 stable repository.

Comment 14 Vladimir Stackov 2015-02-05 19:12:46 UTC
Any plans for EL6/7?
You have requested branching but there is no spec.
If you need some help with packaging or testing feel free to contact me.

Comment 15 Jonathan Dieter 2015-02-05 19:18:31 UTC
I'd happily maintain it for both EL6/7, but the kernel modules would need to be backported and built in the EL kernels, which requires someone with a @redhat.com address.

Comment 16 Vladimir Stackov 2015-02-06 07:12:45 UTC
(In reply to Jonathan Dieter from comment #15)
> I'd happily maintain it for both EL6/7, but the kernel modules would need to
> be backported and built in the EL kernels, which requires someone with a
> @redhat.com address.

You are right... I forgot that Fedora packaging policy prohibits kmod packages.


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