Bug 1720949 - Review Request: NZBGet - A very efficient Usenet Downloader
Summary: Review Request: NZBGet - A very efficient Usenet Downloader
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-16 18:59 UTC by Chris Caron
Modified: 2019-07-02 23:32 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-29 22:25:01 UTC
Type: ---
Embargoed:
zebob.m: fedora-review?


Attachments (Terms of Use)

Description Chris Caron 2019-06-16 18:59:30 UTC
Spec URL: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-rawhide-x86_64/00936418-nzbget/nzbget.spec
SRPM URL: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-rawhide-x86_64/00936418-nzbget/nzbget-21.0-1.fc31.src.rpm
Description: A very popular and efficient Usenet Downloader
See https://nzbget.net for more details.
Fedora Account System Username: lead2gold


Additional Notes:
COPR: https://copr.fedorainfracloud.org/coprs/lead2gold/nzbget/build/936418/

The only catch is I was only able to build against EL7 by providing a fix to a library I depend on (that someone else maintains).  They provide the library for Fedora but not EL7. I created a bugzilla ticket here explaining how to make it work with EL7: https://bugzilla.redhat.com/show_bug.cgi?id=1720857

In the meantime I'm compiling/building it myself on COPR here:
https://copr.fedorainfracloud.org/coprs/lead2gold/libpar2/

Comment 1 Robert-André Mauchin 🐧 2019-06-18 18:42:27 UTC
 - Please add a comment for each patch explaining what they are doing

 - There's a %{__mkdir} macro which shouldn't be after the description


 - Using env is forbidden, it should be /usr/bin/python3 instead

%if 0%{?with_python3}
# fix-up python references; this effectively changes
# #!/usr/bin/env python
#  to:
# #!/usr/bin/env python3
find scripts -type f -name '*.py' -exec \
   sed -i -e 's|env python[23]\?$|env python3|g' {} \;
%endif

 - Not needed

%{__rm} -rf %{buildroot}

 - make %{?_smp_mflags} → %make_build

 - Not needed:

%defattr(-, root, root)

 - Use install -p to keep timestamps

 - Put this after %install not %files, also use the proper way to do it as described in https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Dynamic_allocation

Requires(pre): shadow-utils

[…]
 
%pre
getent group nzbget >/dev/null || groupadd -r nzbget
getent passwd nzbget >/dev/null || \
    useradd -r -g nzbget -d %{_datadir}/%{name} -s /sbin/nologin \
    -c "nzbget account" nzbget
exit 0

 - You need to set the systemd scriptlets:

BuildRequires: systemd-rpm-macros

[…]

%post
%systemd_post nzbget.service

%preun
%systemd_preun nzbget.service

%postun
%systemd_postun_with_restart nzbget.service


   See https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_scriptlets

Comment 2 Chris Caron 2019-06-19 01:43:00 UTC
Thank you for taking the time to review the package so quickly!

I addressed every single one of your points except I'm unable to get the 'systemd-rpm-macros' reference (and it's accompanied %post, %preun and %postun sections) to work in our favour. Here is what happens:
- https://copr.fedorainfracloud.org/coprs/lead2gold/nzbget/build/940939/
- spec: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-30-x86_64/00940939-nzbget/nzbget.spec

Summary of the link above: Fedora 30 and 31 builds perfectly, but all others fail with the error:
No matching package to install: 'systemd-rpm-macros'
Not all dependencies satisfied
Error: Some packages could not be found.

Knowing this I wrapped just this specific request in a '%if 0%{?fedora} >= 30' and that appears to work:
- https://copr.fedorainfracloud.org/coprs/lead2gold/nzbget/build/940943/

As always I look forward to your feedback! :)

Working SPEC and SRPM:
- spec: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-rawhide-x86_64/00940943-nzbget/nzbget.spec
- srpm: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-rawhide-x86_64/00940943-nzbget/nzbget-21.0-1.fc31.src.rpm

Comment 3 Robert-André Mauchin 🐧 2019-06-19 11:36:51 UTC
 - Don't %if 0%{?fedora} >= 30 for the scriptlets, it's only systemd-rpm-macros which is not available for F30+. Below it is using systemd package.

  - Please add a comment for each patch explaining what they are doing

 - Package is not installable

DEBUG util.py:585:  BUILDSTDERR: Error: 
DEBUG util.py:585:  BUILDSTDERR:  Problem: conflicting requests
DEBUG util.py:585:  BUILDSTDERR:   - nothing provides unrar needed by nzbget-21.0-1.fc31.x86_64
DEBUG util.py:587:  (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

  unrar is not available in Fedora, only rpmfusion. Are you sure is is mandatory?

 - Notify upstream about the wrong FSF address:

nzbget.x86_64: E: incorrect-fsf-address /usr/share/doc/nzbget-21.0/COPYING
nzbget.x86_64: E: incorrect-fsf-address /usr/share/licenses/nzbget/COPYING

 - Own this directory, just use:

%{_datadir}/%{name}

   instead of

%{_datadir}/%{name}/*

 - You need to create a logrotate file and install it:

nzbget.x86_64: W: log-files-without-logrotate ['/var/log/nzbget']

   See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_logrotate_config_file



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/
- Package does not use a name that already exists.


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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[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", "GPL (v2 or later)", "*No copyright*
     Public domain", "FSF All Permissive License", "Expat License", "GNU
     General Public License", "*No copyright* GPL (v2 or later)", "Apache
     License (v2.0)", "*No copyright* Apache License (v2.0)". 96 files have
     unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/nzbget/review-nzbget/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[!]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/share/nzbget
[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.
[-]: 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 419840 bytes in 5 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]: 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 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]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[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:
[-]: 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).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[!]: 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.
[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]: 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]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[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
[ ]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
     Note: Arch-ed rpms have a total of 2385920 bytes in /usr/share
[x]: Spec file according to URL is the same as in SRPM.



Rpmlint
-------
Checking: nzbget-21.0-1.fc31.x86_64.rpm
          nzbget-debuginfo-21.0-1.fc31.x86_64.rpm
          nzbget-debugsource-21.0-1.fc31.x86_64.rpm
          nzbget-21.0-1.fc31.src.rpm
nzbget.x86_64: W: spelling-error %description -l en_US newsgrabber -> news grabber, news-grabber, grabber
nzbget.x86_64: W: non-standard-uid /etc/nzbget.conf nzbget
nzbget.x86_64: E: non-readable /etc/nzbget.conf 640
nzbget.x86_64: E: incorrect-fsf-address /usr/share/doc/nzbget-21.0/COPYING
nzbget.x86_64: E: incorrect-fsf-address /usr/share/licenses/nzbget/COPYING
nzbget.x86_64: W: non-standard-uid /var/lib/nzbget nzbget
nzbget.x86_64: W: non-standard-gid /var/lib/nzbget nzbget
nzbget.x86_64: E: non-standard-dir-perm /var/lib/nzbget 750
nzbget.x86_64: W: non-standard-uid /var/lib/nzbget/downloads nzbget
nzbget.x86_64: W: non-standard-gid /var/lib/nzbget/downloads nzbget
nzbget.x86_64: E: non-standard-dir-perm /var/lib/nzbget/downloads 770
nzbget.x86_64: W: non-standard-uid /var/lib/nzbget/inter nzbget
nzbget.x86_64: W: non-standard-gid /var/lib/nzbget/inter nzbget
nzbget.x86_64: W: non-standard-uid /var/lib/nzbget/nzb nzbget
nzbget.x86_64: W: non-standard-gid /var/lib/nzbget/nzb nzbget
nzbget.x86_64: W: non-standard-uid /var/lib/nzbget/queue nzbget
nzbget.x86_64: W: non-standard-gid /var/lib/nzbget/queue nzbget
nzbget.x86_64: E: non-standard-dir-perm /var/lib/nzbget/queue 750
nzbget.x86_64: W: non-standard-uid /var/lib/nzbget/tmp nzbget
nzbget.x86_64: W: non-standard-gid /var/lib/nzbget/tmp nzbget
nzbget.x86_64: E: non-standard-dir-perm /var/lib/nzbget/tmp 750
nzbget.x86_64: W: non-standard-uid /var/log/nzbget nzbget
nzbget.x86_64: E: non-standard-dir-perm /var/log/nzbget 770
nzbget.x86_64: W: log-files-without-logrotate ['/var/log/nzbget']
nzbget.x86_64: W: no-manual-page-for-binary nzbget
nzbget.src: W: spelling-error %description -l en_US newsgrabber -> news grabber, news-grabber, grabber
nzbget.src: W: spelling-error %description -l en_US nzb -> nib, nab, nob
nzbget.src:97: W: mixed-use-of-spaces-and-tabs (spaces: line 8, tab: line 97)
4 packages and 0 specfiles checked; 8 errors, 20 warnings.

Comment 4 Chris Caron 2019-06-21 01:19:27 UTC
Thanks again for such a speedy response; I addressed all your concerns but a few:

>  unrar is not available in Fedora, only rpmfusion. Are you sure is is mandatory?

Unfortunately it is; just about all binary postings on Usenet require to be unrar'ed.  Do you foresee this as a problem? I forgot about unrar's strange license causing it to sit in other repo's. I also found this link https://fedoraproject.org/wiki/Licensing:Unrar.

> nzbget.x86_64: W: log-files-without-logrotate ['/var/log/nzbget']

The out-of-the-box nzbget configuration has log rotate already built into it. The daemon itself does the log rotating.  Should I patch the configuration file to not do this by default and provide a logrotate?  Or is it acceptable as it is?

>  - Notify upstream about the wrong FSF address:

Done; i did a pull request for the next release and created a small patch file for this one.
Source: https://github.com/nzbget/nzbget/pull/648

> nzbget.x86_64: E: non-readable /etc/nzbget.conf 640


I cleaned up most of these entries and changed this one to just read 660 which may still trigger this error.  The big problem is this file contains passwords in clear text, so I'd like the file to be as restricted as possible and only accessible by the nzbget user and root. I strongly advise keeping the 'other user without write/read permissions here.  Is this okay?  Perhaps you have a better suggestion for this?

As for the content you're interested in:
spec: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-rawhide-x86_64/00942866-nzbget/nzbget.spec
srpm: https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-rawhide-x86_64/00942866-nzbget/nzbget-21.0-1.fc31.src.rpm


Chris

Comment 5 Robert-André Mauchin 🐧 2019-06-21 10:36:04 UTC
(In reply to Chris Caron from comment #4)
> Thanks again for such a speedy response; I addressed all your concerns but a
> few:
> 
> >  unrar is not available in Fedora, only rpmfusion. Are you sure is is mandatory?
> 
> Unfortunately it is; just about all binary postings on Usenet require to be
> unrar'ed.  Do you foresee this as a problem? I forgot about unrar's strange
> license causing it to sit in other repo's. I also found this link
> https://fedoraproject.org/wiki/Licensing:Unrar.
> 

The program will function without unrar, yes? You could change the Requires to a Recommends:
Otherwise this program won't be allowed in Fedora, you would need to propose it to RPMFusion, as it depends on unrar.

> > nzbget.x86_64: W: log-files-without-logrotate ['/var/log/nzbget']
> 
> The out-of-the-box nzbget configuration has log rotate already built into
> it. The daemon itself does the log rotating.  Should I patch the
> configuration file to not do this by default and provide a logrotate?  Or is
> it acceptable as it is?
> 
It should be ok.

> >  - Notify upstream about the wrong FSF address:
> 
> Done; i did a pull request for the next release and created a small patch
> file for this one.
> Source: https://github.com/nzbget/nzbget/pull/648
> 
> > nzbget.x86_64: E: non-readable /etc/nzbget.conf 640
> 
> 
> I cleaned up most of these entries and changed this one to just read 660
> which may still trigger this error.  The big problem is this file contains
> passwords in clear text, so I'd like the file to be as restricted as
> possible and only accessible by the nzbget user and root. I strongly advise
> keeping the 'other user without write/read permissions here.  Is this okay? 
> Perhaps you have a better suggestion for this?
> 
Ignore this f-r error, permissions are ok.

> As for the content you're interested in:
> spec:
> https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-
> rawhide-x86_64/00942866-nzbget/nzbget.spec
> srpm:
> https://copr-be.cloud.fedoraproject.org/results/lead2gold/nzbget/fedora-
> rawhide-x86_64/00942866-nzbget/nzbget-21.0-1.fc31.src.rpm
> 
> 
> Chris

Comment 6 Chris Caron 2019-06-22 15:24:29 UTC
As a user of NZBget, I can say that that while it can function without unrar; it's pretty much useless without it. I will change the reference to unrar to be 'Recommended' as per your suggestion, but I'd like to also have nzbget 'just-work' out of the box without connecting to an additional repository. Sooo.... that said:

I'm just exploring an alternative solution called unar which is already package with Fedora as an open source unrar replacement.
https://src.fedoraproject.org/rpms/unar

I've started a PR against NZBGet but still need to convince the package author. :)
Link: https://github.com/nzbget/nzbget/issues/649

If you wouldn't mind I'd like to leave this ticket open, but just have it linger untouched for a bit while I explore this alternative.

Comment 7 Chris Caron 2019-06-29 22:25:01 UTC
Robert,

The package owner has shown little interest in an open source alternative to unrar. When i reached out to the new maintainers of unar (the unrar open source alternative), i only received an automated email that they'd get back to me within 24 hours.  That was a week ago.

I personally don't see value in maintaining this product in Fedora/RedHat when it will still require the user to connect to another repository anyway to get the remaining packages. I think it would take away from the user experience. The maintainer of libpar still hasn't responded to my ticket (https://bugzilla.redhat.com/show_bug.cgi?id=1720857) either. His absence makes this product unavailable to EPEL users as a result.

I think I'll just continue to host it on my own repository for the time being.

I'm sorry to have wasted your time.

Comment 8 Robert-André Mauchin 🐧 2019-07-02 23:32:46 UTC
No problem!


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