Bug 1577011 - Review Request: wiringpi - PIN based GPIO access library for BCM283x SoC devices
Summary: Review Request: wiringpi - PIN based GPIO access library for BCM283x SoC devices
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Oliver
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: FE-NEEDSPONSOR 1573194
TreeView+ depends on / blocked
 
Reported: 2018-05-11 02:03 UTC by Vaughan
Modified: 2020-01-21 10:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
mavit: fedora-review+


Attachments (Terms of Use)

Description Vaughan 2018-05-11 02:03:48 UTC
Spec URL: https://github.com/agrez/wiringpi/blob/master/wiringpi.spec
SRPM URL: https://github.com/agrez/wiringpi/releases/download/2.46-1.git8d188fa/wiringpi-2.46-1.git8d188fa.fc28.src.rpm
Description: WiringPi is a PIN based GPIO access library for the BCM2835, BCM2836 and BCM2837 SoC devices (Raspberry Pi).
Fedora Account System Username: vaughan

This is my first package, I am seeking a sponsor.

Comment 1 Vaughan 2018-05-11 02:08:53 UTC
koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=26858050

Comment 2 Peter Oliver 2018-05-11 09:18:20 UTC
You need to link directly to the spec, not to a web page containing the text of the spec, so that it can be read directly by the fedora-review tool.

Spec URL: https://raw.githubusercontent.com/agrez/wiringpi/master/wiringpi.spec

Comment 3 Peter Oliver 2018-05-11 12:03:26 UTC
Thanks for submitting this.  Here’s my review:

Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Dist tag is present.  Use %{?dist} instead of %{dist}.  See https://fedoraproject.org/wiki/Packaging:DistTag
- Development (unversioned) .so files in -devel subpackage, if present.
  Note: Unversioned so-files directly in %_libdir.
  See: http://fedoraproject.org/wiki/Packaging/Guidelines#DevelPackages
  Files /usr/lib/libwiringPi.so and /usr/lib/libwiringPiDev.so are present in both the libs and devel subpackages, but should only be in the devel subpackage.
- ldconfig called in %post and %postun if required.
  Note: /sbin/ldconfig not called in wiringpi-libs
  See: http://fedoraproject.org/wiki/Packaging/Guidelines#Shared_Libraries
  On Fedora 27 and earlier, a post-install scriptlet is required in the libs subpackage.  
- Package uses hardened build flags if required to.
  Note: suid files: gpio and not %global _hardened_build
  See: http://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Compiler_flags
- The licence can be left out of the main and devel subpackages, since both depend on libs, which also contains the licence.
- The devel subpackage should mention %{?_isa} when it requires the libs subpackage.  Perhaps the main package should require the libs subpackage in the same way.
https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Requiring_Base_Package
- Can this be built on all ARM flavours?  ExclusiveArch could be set to %{arm} if so.
- rpmlint suggests that “WiringPi is” is left off the start of the Summary.
- Commit 8d188fa of WiringPi is tagged as version 2.46, which means the “release version” guidelines rather than the “snapshot” guidelines of https://fedoraproject.org/wiki/Packaging:Versioning should be followed (i.e., “.git%{commit_short}” can removed).
- It might be nice to install the examples as documentation in the devel package.
- Could some of the Makefile changes be submitted upstream?

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

C/C++:
[-]: Provides: bundled(gnulib) in place as required.
     Note: Sources not installed
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
     Note: Using prebuilt packages
[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: There is no build directory. Running licensecheck on vanilla
     upstream sources. No licenses found. Please check the source files for
     licenses manually.
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
     Note: Using prebuilt rpms.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[x]: 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.
[!]: 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]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 4 files.
[x]: Package complies to the Packaging Guidelines
[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 %license.
[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]: 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]: Macros in Summary, %description expandable at SRPM build time.
[x]: Package does not contain duplicates in %files.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[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]: Package contains systemd file(s) if in need.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

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

Generic:
[x]: Reviewer should test that the package builds in mock.
[-]: 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]: Final provides and requires are sane (see attachments).
[!]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     wiringpi-libs , wiringpi-devel , wiringpi-debuginfo , wiringpi-
     debugsource
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[!]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[-]: Packages should try to preserve timestamps of original installed
     files.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Uses parallel make %{?_smp_mflags} macro.
[x]: Sources can be downloaded from URI in Source: tag
[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: Mock build failed
     See: http://fedoraproject.org/wiki/Packaging/Guidelines#rpmlint
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.



Rpmlint
-------
wiringpi.armv7hl: W: name-repeated-in-summary C WiringPi
wiringpi.armv7hl: W: only-non-binary-in-usr-lib
wiringpi.armv7hl: E: setuid-binary /usr/bin/gpio root 4755
wiringpi.armv7hl: E: non-standard-executable-perm /usr/bin/gpio 4755
wiringpi.src: W: name-repeated-in-summary C WiringPi
wiringpi.src: W: spelling-error %description -l en_US gpio -> GPO
wiringpi-debugsource.armv7hl: W: no-documentation
wiringpi-devel.armv7hl: W: no-documentation
wiringpi-libs.armv7hl: E: invalid-soname /usr/lib/libwiringPi.so.2.46 libwiringPi.so
wiringpi-libs.armv7hl: E: invalid-soname /usr/lib/libwiringPiDev.so.2.46 libwiringPiDev.so
wiringpi-libs.armv7hl: W: no-documentation
wiringpi-libs.armv7hl: W: devel-file-in-non-devel-package /usr/lib/libwiringPi.so
wiringpi-libs.armv7hl: E: library-without-ldconfig-postin /usr/lib/libwiringPi.so.2.46
wiringpi-libs.armv7hl: E: library-without-ldconfig-postun /usr/lib/libwiringPi.so.2.46
wiringpi-libs.armv7hl: W: devel-file-in-non-devel-package /usr/lib/libwiringPiDev.so
wiringpi-libs.armv7hl: E: library-without-ldconfig-postin /usr/lib/libwiringPiDev.so.2.46
wiringpi-libs.armv7hl: E: library-without-ldconfig-postun /usr/lib/libwiringPiDev.so.2.46
wiringpi-libs-debuginfo.armv7hl: E: useless-provides debuginfo(build-id)
7 packages and 1 specfiles checked; 9 errors, 9 warnings.




Requires
--------
wiringpi-devel (rpmlib, GLIBC filtered):
    wiringpi-libs

wiringpi (rpmlib, GLIBC filtered):
    ld-linux-armhf.so.3
    libc.so.6
    libcrypt.so.1
    libgcc_s.so.1
    libgcc_s.so.1(GCC_3.5)
    libm.so.6
    libpthread.so.0
    librt.so.1
    libwiringPi.so
    libwiringPiDev.so
    rtld(GNU_HASH)

wiringpi-libs (rpmlib, GLIBC filtered):
    ld-linux-armhf.so.3
    libc.so.6
    libcrypt.so.1
    libcrypt.so.1(XCRYPT_2.0)
    libgcc_s.so.1
    libgcc_s.so.1(GCC_3.5)
    libm.so.6
    libpthread.so.0
    librt.so.1
    rtld(GNU_HASH)

wiringpi-debugsource (rpmlib, GLIBC filtered):

wiringpi-debuginfo (rpmlib, GLIBC filtered):



Provides
--------
wiringpi-devel:
    wiringpi-devel
    wiringpi-devel(armv7hl-32)

wiringpi:
    wiringpi
    wiringpi(armv7hl-32)

wiringpi-libs:
    libwiringPi.so
    libwiringPiDev.so
    wiringpi-libs
    wiringpi-libs(armv7hl-32)

wiringpi-debugsource:
    wiringpi-debugsource
    wiringpi-debugsource(armv7hl-32)

wiringpi-debuginfo:
    debuginfo(build-id)
    wiringpi-debuginfo
    wiringpi-debuginfo(armv7hl-32)



Unversioned so-files
--------------------
wiringpi-libs: /usr/lib/libwiringPi.so
wiringpi-libs: /usr/lib/libwiringPiDev.so

Source checksums
----------------
https://git.drogon.net/?p=wiringPi;a=snapshot;h=8d188fa0e00bb8c6ff6eddd07bf92857e9bd533a;sf=tgz#/wiringPi-8d188fa.tar.gz :
  CHECKSUM(SHA256) this package     : 636fd5f76424bff05efa05eca5e98ac34581b0d1dbb1fbd83a145fbb37e097af
  CHECKSUM(SHA256) upstream package : 636fd5f76424bff05efa05eca5e98ac34581b0d1dbb1fbd83a145fbb37e097af


Generated by fedora-review 0.6.1 (f03e4e7) last change: 2016-05-02
Command line :/usr/bin/fedora-review -n wiringpi --prebuilt
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api, C/C++
Disabled plugins: Java, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP
Disabled flags: EXARCH, DISTTAG, EPEL5, BATCH, EPEL6

Comment 4 Vaughan 2018-05-12 07:48:54 UTC
Hi Peter, thanks for the review. Please see below for commits / comments.

(In reply to Peter Oliver from comment #3)
> Issues:
> =======
> - Dist tag is present.  Use %{?dist} instead of %{dist}.  See
> https://fedoraproject.org/wiki/Packaging:DistTag
DONE https://github.com/agrez/wiringpi/commit/6e53a3b22548372f66d3e7d5e23c20407d212151

> - Development (unversioned) .so files in -devel subpackage, if present.
>   Note: Unversioned so-files directly in %_libdir.
>   See: http://fedoraproject.org/wiki/Packaging/Guidelines#DevelPackages
>   Files /usr/lib/libwiringPi.so and /usr/lib/libwiringPiDev.so are present
> in both the libs and devel subpackages, but should only be in the devel
> subpackage.
DONE
https://github.com/agrez/wiringpi/commit/02e43e63fc44373cc19e03f2b5e6b7ac1fac0e65

> - ldconfig called in %post and %postun if required.
>   Note: /sbin/ldconfig not called in wiringpi-libs
>   See: http://fedoraproject.org/wiki/Packaging/Guidelines#Shared_Libraries
>   On Fedora 27 and earlier, a post-install scriptlet is required in the libs
> subpackage.
DONE
https://github.com/agrez/wiringpi/commit/fadf83b45da31b5c2af25b693600ec90ef47c117
  
> - Package uses hardened build flags if required to.
>   Note: suid files: gpio and not %global _hardened_build
>   See:
> http://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/
> Guidelines#Compiler_flags
DONE
https://github.com/agrez/wiringpi/commit/3fc96c13b755ca543f835cf52a1b943201ff91e1

> - The licence can be left out of the main and devel subpackages, since both
> depend on libs, which also contains the licence.
DONE
https://github.com/agrez/wiringpi/commit/85d5651d9fad86a883ffa69812f9168e0f6683f5

> - The devel subpackage should mention %{?_isa} when it requires the libs
> subpackage.  Perhaps the main package should require the libs subpackage in
> the same way.
> https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/
> Guidelines#Requiring_Base_Package
DONE
https://github.com/agrez/wiringpi/commit/28cbb1352e77ee2f261fbccb0a935428f0ac8270

> - Can this be built on all ARM flavours?  ExclusiveArch could be set to
> %{arm} if so.
Do you want to know if it works on aarch64 too? I haven't actually tested wiringpi on aarch64 (as you would need aarch64 BCM270x Linux kernel port, which I haven't ever built), so I don't know if it works. Anyway, I updated the spec and makefile patch to add aarch64 build support. Koji scratch builds seem to build ok.
https://github.com/agrez/wiringpi/commit/db7bc872556ec98f5c82e443f48f51bed8c061da

> - rpmlint suggests that “WiringPi is” is left off the start of the Summary.
DONE
https://github.com/agrez/wiringpi/commit/79899f3c3956eddc6396f32868c52e49618c875a

> - Commit 8d188fa of WiringPi is tagged as version 2.46, which means the
> “release version” guidelines rather than the “snapshot” guidelines of
> https://fedoraproject.org/wiki/Packaging:Versioning should be followed
> (i.e., “.git%{commit_short}” can removed).
DONE
https://github.com/agrez/wiringpi/commit/229325a65f607de4b622249fa499cc6ff0cc75eb

> - It might be nice to install the examples as documentation in the devel
> package.
DONE
https://github.com/agrez/wiringpi/commit/a5774441b5da91b2d626adab003479241c90e601

> - Could some of the Makefile changes be submitted upstream?
> 
Yes, ok I can ask upstream and see if the maintainer is receptive.

Updated Spec URL: https://raw.githubusercontent.com/agrez/wiringpi/master/wiringpi.spec

Update SRPM URL: https://github.com/agrez/wiringpi/releases/download/2.46-1/wiringpi-2.46-1.fc28.src.rpm

koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=26913836

Cheers!
Vaughan

Comment 5 Peter Oliver 2018-05-13 12:17:59 UTC
(In reply to Vaughan from comment #4)

> > - ldconfig called in %post and %postun if required.
> >   Note: /sbin/ldconfig not called in wiringpi-libs
> >   See: http://fedoraproject.org/wiki/Packaging/Guidelines#Shared_Libraries
> >   On Fedora 27 and earlier, a post-install scriptlet is required in the libs
> > subpackage.
> DONE
> https://github.com/agrez/wiringpi/commit/
> fadf83b45da31b5c2af25b693600ec90ef47c117

There's a macro, %ldconfig_scriptlets, that will do this for you.  See https://fedoraproject.org/wiki/Packaging:Scriptlets#Shared_Libraries

> > - Can this be built on all ARM flavours?  ExclusiveArch could be set to
> > %{arm} if so.
> Do you want to know if it works on aarch64 too? I haven't actually tested
> wiringpi on aarch64 (as you would need aarch64 BCM270x Linux kernel port,
> which I haven't ever built), so I don't know if it works. Anyway, I updated
> the spec and makefile patch to add aarch64 build support. Koji scratch
> builds seem to build ok.
> https://github.com/agrez/wiringpi/commit/
> db7bc872556ec98f5c82e443f48f51bed8c061da

Searching the web suggests that there are/were some problems, here.  I'll have a closer look when I can find a spare SD card to install onto.

One more thought: I think wiringPi is principally a library that happens to include the gpio tool, rather than principally the gpio tool which happens to come with a library.  Instead of putting the tool in wiringpi and the library in wiringpi-libs, does it make more sense to put the libraries in wiringpi, and the gpio tool in a package called, say, wiringpi-tools?

Comment 6 Vaughan 2018-05-13 13:40:51 UTC
(In reply to Peter Oliver from comment #5)
> 
> There's a macro, %ldconfig_scriptlets, that will do this for you.  See
> https://fedoraproject.org/wiki/Packaging:Scriptlets#Shared_Libraries
>
I didn't know about this one! Its a much neater solution.
https://github.com/agrez/wiringpi/commit/fe305b8fb2104dd7b635e7b1b3743a68ac46eed9

> 
> Searching the web suggests that there are/were some problems, here.  I'll
> have a closer look when I can find a spare SD card to install onto.
>
I have downloaded an aarch64 image and will try to do some investigations (time permitting) during the week.

> One more thought: I think wiringPi is principally a library that happens to
> include the gpio tool, rather than principally the gpio tool which happens
> to come with a library.  Instead of putting the tool in wiringpi and the
> library in wiringpi-libs, does it make more sense to put the libraries in
> wiringpi, and the gpio tool in a package called, say, wiringpi-tools?
Yes agreed, I think it makes more sense. I will refactor the spec.

Comment 7 Vaughan 2018-05-14 10:53:17 UTC
Ok, I have refactored the spec and fixed a few more rpmlint grumbles, plus added some pkg-config files.

Updated Spec URL: https://raw.githubusercontent.com/agrez/wiringpi/master/wiringpi.spec


Updated SRPM URL: https://github.com/agrez/wiringpi/releases/download/2.46-1/wiringpi-2.46-1.fc28.src.rpm

koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=26960053


Cheers!
Vaughan

Comment 8 Peter Oliver 2018-05-14 14:59:19 UTC
Best exclude aarch64 until it can be tested.  Apart from that, I approve the review.  Thanks for submitting the package!

You'll now need to wait for a sponsor to sponsor you as a new packager.  I'll draw to the attention of any potentials sponsors your work over at https://github.com/fedberry/.

Comment 9 Vaughan 2018-05-15 01:52:38 UTC
(In reply to Peter Oliver from comment #8)
> Best exclude aarch64 until it can be tested.  Apart from that, I approve the
> review.  Thanks for submitting the package!
> 
Done. https://github.com/agrez/wiringpi/commit/48f9e6d2d93fb3dbe2df21109d37ba26e37bc1ac

> You'll now need to wait for a sponsor to sponsor you as a new packager. 
> I'll draw to the attention of any potentials sponsors your work over at
> https://github.com/fedberry/.

OK, no problem. Thanks for your time with this review. In regards to Fedora packaging guidelines / policies, it has been a good learning experience for me (I have been living in the packaging 'wild west' for too long). ;-)

Cheers!
Vaughan

Comment 10 Peter Oliver 2018-06-27 11:52:12 UTC
It turns out that it's possible to explicitly request sponsorship by raising an issue at https://pagure.io/packager-sponsors/.

Comment 11 Ian McInerney 2020-01-21 10:08:22 UTC
It looks like upstream has stopped development of wiringpi: http://wiringpi.com/wiringpi-deprecated/. There is a "fork" (https://github.com/WiringPi/WiringPi) that will contain some things, but they have said no new features or changes will be accepted to that version.


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