Bug 1741636 - Review Request: ocsinventory-agent - The client for OCS Inventory Server
Summary: Review Request: ocsinventory-agent - The client for OCS Inventory Server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1743767
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-15 16:35 UTC by Pat Riehecky
Modified: 2019-10-26 17:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-26 17:21:33 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Description Pat Riehecky 2019-08-15 16:35:25 UTC
Spec URL: https://copr.fedorainfracloud.org/coprs/jcpunk/ocsinventory-review/package/ocsinventory-agent/

SRPM URL: https://copr.fedorainfracloud.org/coprs/jcpunk/ocsinventory-review/package/ocsinventory-agent/

Description: This is the agent for OCS Inventory Server.  It was previously retired from Fedora due to lack of interest.  I'd like to begin maintaining this package.

Fedora Account System Username: jcpunk

Comment 1 Robert-André Mauchin 🐧 2019-08-23 13:31:55 UTC
 - LICENSE file should be installed with %license not %doc

 - Not needed

%defattr(-, root, root, -)

 - Not needed 

%clean
rm -rf %{buildroot}

rm -rf %{buildroot} in %install


 - You need to include the SystemD macros for ocsinventory-agent.service

%post
%systemd_post ocsinventory-agent.service

%preun
%systemd_preun ocsinventory-agent.service

%postun
%systemd_postun_with_restart ocsinventory-agent.service

 - Source0 is 404, you're missing a "v" before %{official_version}:

Source0:   https://github.com/OCSInventory-NG/UnixAgent/releases/download/v%{official_version}/Ocsinventory-Unix-Agent-%{official_version}.tar.gz


 - Not installable

DEBUG util.py:600:  Error: 
DEBUG util.py:600:   Problem 1: conflicting requests
DEBUG util.py:600:    - nothing provides monitor-edid needed by perl-Ocsinventory-Agent-2.6.0-2.fc32.noarch
DEBUG util.py:600:   Problem 2: package ocsinventory-agent-2.6.0-2.fc32.x86_64 requires perl-Ocsinventory-Agent = 2.6.0-2.fc32, but none of the providers can be installed
DEBUG util.py:600:    - conflicting requests
DEBUG util.py:600:    - nothing provides monitor-edid needed by perl-Ocsinventory-Agent-2.6.0-2.fc32.noarch

 - Own /usr/libexec/ocsinventory-agent

%attr(0750, root, root) %{_libexecdir}/%{name}/

 - use perl not %{__perl}

 - considers using perl-interpreter and perl-generators as BR to detect Requires


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

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


Issues:
=======
- Package installs properly.
  Note: Installation errors (see attachment)
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/
- 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.
  Note: License file LICENSE is not marked as %license
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/LicensingGuidelines/#_license_text
- systemd_post is invoked in %post, systemd_preun in %preun, and
  systemd_postun in %postun for Systemd service files.
  Note: Systemd service file(s) in ocsinventory-agent
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Scriptlets/#_scriptlets


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

C/C++:
[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 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: "Unknown or generated", "*No copyright* GPL (v2 or later)",
     "GPL (v2 or later)", "GNU General Public License (v2)", "GPL (v2)",
     "*No copyright* CeCILL License (v2)", "Artistic License". 345 files
     have unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/ocsinventory-agent/review-ocsinventory-
     agent/licensecheck.txt
[!]: License file installed when any subpackage combination is installed.
[!]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/libexec/ocsinventory-agent
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[!]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
     Note: rm -rf %{buildroot} present but not required
[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.
[-]: 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.
[!]: 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.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 92160 bytes in 8 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]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[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]: No %config files under /usr.
[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

Perl:
[ ]: Package contains the mandatory BuildRequires and Requires:.
     Note: Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`";
     echo $version)) missing?

===== 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.
[x]: Final provides and requires are sane (see attachments).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     ocsinventory-agent , perl-Ocsinventory-Agent
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: 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]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[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:
[!]: Rpmlint is run on all installed packages.
     Note: Mock build failed
     See: https://docs.fedoraproject.org/en-US/packaging-
     guidelines/#_use_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
-------
Checking: ocsinventory-agent-2.6.0-2.fc32.x86_64.rpm
          perl-Ocsinventory-Agent-2.6.0-2.fc32.noarch.rpm
          ocsinventory-agent-2.6.0-2.fc32.src.rpm
ocsinventory-agent.x86_64: I: enchant-dictionary-not-found fr
ocsinventory-agent.x86_64: E: no-binary
ocsinventory-agent.x86_64: E: non-readable /usr/libexec/ocsinventory-agent/ocsinventory-agent.cron 750
ocsinventory-agent.x86_64: E: non-standard-executable-perm /usr/libexec/ocsinventory-agent/ocsinventory-agent.cron 750
perl-Ocsinventory-Agent.noarch: E: incoherent-logrotate-file /etc/logrotate.d/ocsinventory-agent
ocsinventory-agent.src:144: W: macro-in-comment %{name}
ocsinventory-agent.src:148: W: macro-in-comment %{_localstatedir}
ocsinventory-agent.src:148: W: macro-in-comment %{name}
ocsinventory-agent.src:154: W: macro-in-comment %{name}
ocsinventory-agent.src:157: W: macro-in-comment %{_localstatedir}
ocsinventory-agent.src:157: W: macro-in-comment %{name}
ocsinventory-agent.src:172: W: macro-in-comment %{name}
3 packages and 0 specfiles checked; 4 errors, 7 warnings.

Comment 2 Pat Riehecky 2019-08-23 14:26:32 UTC
Thanks for the review!

I've fixed most of the issues you reported and got a new build in copr[1]

I've got a few questions:

>  - use perl not %{__perl}

The snippet that generates "perl(:MODULE_COMPAT_5.16.3)" is using %{__perl} and I thought the %{__perl} macro was best practices based on the snippet....


>  - You need to include the SystemD macros for ocsinventory-agent.service

The ocsinventory-agent.service is a one shot designed to be triggered from the timers.  I'm not sure it makes sense to enable it like a normal service.


> - Not installable

I've got monitor-edid up for review at https://bugzilla.redhat.com/show_bug.cgi?id=1743767

--

I'm getting a 403 from rpmlint on the Source0 url, but wget has no problem fetching that path.

I've added comments in the spec file to help explain some of the rpmlint complaints:

- the expanded macros in comments are deliberate

- while the package itself contains no binaries, the runtime requirements on OCS change depending on the arch, so the /usr/bin/ocsinventory-agent package is arch specific.



[1] https://copr.fedorainfracloud.org/coprs/jcpunk/ocsinventory-review/package/ocsinventory-agent/

Comment 3 Pat Riehecky 2019-09-30 14:57:53 UTC
monitor-edid is now within the release.  I believe this package is viable now.

Pat

Comment 4 Robert-André Mauchin 🐧 2019-09-30 18:29:52 UTC
>>  - use perl not %{__perl}
>
>The snippet that generates "perl(:MODULE_COMPAT_5.16.3)" is using %{__perl} and I thought the %{__perl} macro was best practices based on the snippet....


Snippet is not up to date, current perl maintainers recommends using perl directly. Macros starting with %{__ are supposedly for rpm private use.

Speaking of best practices:

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}


%install
make pure_install PERL_INSTALL_ROOT=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'

chmod -R u+rwX,go+rX,go-w %{buildroot}/*

→ Use instead:

%build
/usr/bin/perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}


%install
%{make_install}
find %{buildroot} -type f -name '*.bs' -size 0 -delete
%{_fixperms} %{buildroot}/*

Comment 5 Pat Riehecky 2019-09-30 18:57:49 UTC
I've tossed a new build in copr with the suggested changes : https://copr.fedorainfracloud.org/coprs/jcpunk/ocsinventory-review/package/ocsinventory-agent/

Comment 6 Robert-André Mauchin 🐧 2019-09-30 20:13:36 UTC
LGTM, package approved.

Comment 7 Pat Riehecky 2019-10-01 18:37:55 UTC
Filed : https://pagure.io/releng/issue/8854

Comment 8 Fedora Update System 2019-10-02 16:05:42 UTC
FEDORA-2019-24590f847b has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-24590f847b

Comment 9 Fedora Update System 2019-10-03 03:19:59 UTC
ocsinventory-agent-2.6.0-2.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-24590f847b

Comment 10 Fedora Update System 2019-10-26 17:21:33 UTC
ocsinventory-agent-2.6.0-2.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.


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