Bug 1548761

Summary: Review Request: nnn - The missing terminal file browser for X
Product: [Fedora] Fedora Reporter: Robert-André Mauchin 🐧 <eclipseo>
Component: Package ReviewAssignee: Dridi Boukelmoune <dridi.boukelmoune>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dridi.boukelmoune, eclipseo, fedora, package-review, zbyszek
Target Milestone: ---Flags: dridi.boukelmoune: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-29 16:19:40 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 Robert-André Mauchin 🐧 2018-02-24 20:49:52 UTC
Spec URL: https://raw.githubusercontent.com/eclipseo/packaging/ec5f137/nnn.spec
SRPM URL: https://copr-be.cloud.fedoraproject.org/results/eclipseo/jarun/fedora-rawhide-x86_64/00720699-nnn/nnn-1.6-1.fc28.src.rpm

Description:
nnn is probably the fastest and most resource-sensitive (with all 
its capabilities) file browser you have ever used. It's extremely flexible 
too - integrates with your DE and favourite GUI utilities, works with 
the desktop opener, supports bookmarks, has smart navigation shortcuts, 
navigate-as-you-type mode, disk usage analyzer mode, comprehensive file 
details and much more. nnn was initially forked from noice but is 
significantly different today.

Cool things you can do with nnn:

 - open any file in the default desktop application or a custom one
 - navigate-as-you-type (search-as-you-type enabled even on directory switch)
 - check disk usage with number of files in current directory tree
 - run desktop search utility (gnome-search-tool or catfish) in any directory
 - copy absolute file paths to clipboard, spawn a terminal and use the paths
 - navigate instantly using shortcuts like ~, -, & or handy bookmarks
 - use cd ..... at chdir prompt to go to a parent directory
 - detailed file stats, media info, list and extract archives
 - pin a directory you may need to revisit and jump to it anytime
 - lock the current terminal after a specified idle time
 - change directory on exit


Fedora Account System Username: eclipseo

Comment 1 Artur Frenszek-Iwicki 2018-02-25 08:38:45 UTC
>%autosetup -p1 -n %{name}-%{version}
"-n %{name}-%{version}" is the default, you can drop this.

>%{__install}
Macro forms of system executables should not be used.
https://fedoraproject.org/wiki/Packaging:Guidelines#Macros

>%{_datadir}/bash-completion/completions
Are you sure this is right? On my Fedora 27, the directory is "%{_datadir}/bash_completion.d/".

Comment 2 Robert-André Mauchin 🐧 2018-02-25 11:42:35 UTC
(In reply to Iwicki Artur from comment #1)
> >%autosetup -p1 -n %{name}-%{version}
> "-n %{name}-%{version}" is the default, you can drop this.
> 
I prefer to keep it that way for consistency if you don't mind.

> >%{__install}
> Macro forms of system executables should not be used.
> https://fedoraproject.org/wiki/Packaging:Guidelines#Macros
> 

Done.

> >%{_datadir}/bash-completion/completions
> Are you sure this is right? On my Fedora 27, the directory is
> "%{_datadir}/bash_completion.d/".

I'm pretty certain this is the correct dir.

ll  /usr/share/bash-completion/                                                                                                                            
total 72K
-rw-r--r--. 1 root root 71K juil. 26  2017 bash_completion
drwxr-xr-x. 1 root root 13K févr. 25 01:59 completions
drwxr-xr-x. 1 root root  26 déc.  13 14:56 helpers

bash_completion.d should be under /etc/. But vendor completions go into /usr.


Spec URL: https://raw.githubusercontent.com/eclipseo/packaging/a3ea2b4/nnn.spec
SRPM URL: https://copr-be.cloud.fedoraproject.org/results/eclipseo/jarun/fedora-rawhide-x86_64/00720856-nnn/nnn-1.6-1.fc28.src.rpm

Comment 3 Artur Frenszek-Iwicki 2018-02-25 11:46:08 UTC
>bash_completion.d should be under /etc/. But vendor completions go into /usr.
Ah, right. I confused %{_datadir} with %{_sysconfdir}. Sorry.

Comment 4 Zbigniew Jędrzejewski-Szmek 2018-03-01 10:02:19 UTC
> %global debug_package   %{nil}
Why?

Comment 5 Zbigniew Jędrzejewski-Szmek 2018-03-01 10:02:46 UTC
> Version:    1.6
1.7 is out.

Comment 7 Robert-André Mauchin 🐧 2018-03-01 17:48:39 UTC
And thanks for the review!

Comment 8 Dridi Boukelmoune 2018-03-12 12:27:44 UTC
Hello Robert-André, would you like to review kcov (bug 1480752) that has been overtaken by events? In exchange I'd be happy to do a formal review of nnn.

Comment 9 Dridi Boukelmoune 2018-03-13 20:43:36 UTC
Trying to mock build the SRPM via fedora-review fails at the %build step:

===
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.K5KqMF
+ umask 022
+ cd /builddir/build/BUILD
+ cd nnn-1.7
+ export 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/
+ export 'LDFLAGS=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ LDFLAGS='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ /usr/bin/make -O -j4
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-
BUILDSTDERR: cc1: fatal error: inaccessible plugin file plugin/annobin.so expanded from short plugin name annobin: No such file or directory
BUILDSTDERR: compilation terminated.
BUILDSTDERR: make: *** [Makefile:28: nnn] Error 1
RPM build errors:
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.K5KqMF (%build)
BUILDSTDERR:     Bad exit status from /var/tmp/rpm-tmp.K5KqMF (%build)
Child return code was: 1
===

Does this ring a bell? I'll try to build nnn from source (not as an RPM) to get a feel of the build process.

Comment 10 Dridi Boukelmoune 2018-03-13 20:57:29 UTC
It looks like redhat-rpm-config is not pulling annobin despite what /usr/lib/rpm/redhat/redhat-annobin-cc1 expects.

Comment 11 Robert-André Mauchin 🐧 2018-03-13 21:03:01 UTC
Not an issue with my package, it works well in fedora review. I suggest scrubbing your chroot and retrying with fedora-review --mock-config fedora-rawhide-x86_64 -n nnn.

Comment 12 Dridi Boukelmoune 2018-03-13 21:35:23 UTC
It turned out network was not available during the build and dnf installed whatever was in my cache according to the root.log file.

If I look at redhat-rpm-config now it's fine:

    <mock-chroot> sh-4.4# rpm -qR redhat-rpm-config | grep annobin
    (annobin if gcc)

While fedora-review is processing, I have a couple comments:

> sed -i "/STRIP ?= strip/d" Makefile

You don't need to touch the Makefile as the strip target is phony and optional, building and installing doesn't lead to running the target. If you would like to future proof this, you can neuter it this way:

    %make_build STRIP=/bin/true

I lean towards not altering the sources when I can help it, but I don't see this as a problem.

> %make_install PREFIX=%{_prefix}

Upstream's Makefile should replace instances of `install` with $(INSTALL) to allow %make_install to honor the -p flag (as is done for manual installation of *sh completion scripts).

> %autosetup -p1 -n %{name}-%{version}

You don't need the -n flag in %autosetup since upstream's tarball already matches the pattern expected by default.

Comment 13 Dridi Boukelmoune 2018-03-13 21:36:37 UTC
Don't mind my %autosetup comment, I see you already stated your preference.

Comment 14 Dridi Boukelmoune 2018-03-13 22:47:01 UTC
Package Review
==============

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

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

C/C++:
[-]: Provides: bundled(gnulib) in place as required.
     Note: Sources not installed
[-]: 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.
[!]: 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.

The LICENSE file looks more like BSD than GPLv3+.

[x]: License file installed when any subpackage combination is installed.
[!]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/share/bash-completion,
     /usr/share/fish, /usr/share/bash-completion/completions,
     /usr/share/zsh
[!]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by: /usr/lib/.build-id(nethogs,
     <snip>
     /usr/share/fish/vendor_functions.d(fish), /usr/share/zsh/site-
     functions(systemd, task, vcsh, pulseaudio, arch-install-scripts, curl,
     zsh), /usr/lib/.build-id/9d(mlt, open-vm-tools, man-db, kbd,
     <snip>
     rust, grub2-tools)

You should own the following directories since their original packages
are not hard dependencies and nnn can work even if they aren't installed:

- /usr/share/bash-completion
- /usr/share/bash-completion/completions
- /usr/share/fish
- /usr/share/zsh
- /usr/share/fish/vendor_functions.d

https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#File_and_Directory_Ownership

[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.
[-]: 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 30720 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines

The package lacks a manual page for the nlay program (SHOULD), but otherwise
complies with all MUST items except the ones noted above.

https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Manpages

[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 %license.
[x]: Package requires other packages for directories it uses.
[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 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]: 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).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in nnn-
     debuginfo , nnn-debugsource
[x]: Package functions as described.

Tested manually on x86_64 inside the mock root.

[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: 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.

https://koji.fedoraproject.org/koji/taskinfo?taskID=25689296

[-]: %check is present and all tests pass.

No test suite upstream.

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

Upstream makefile hardcodes `install`.

[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]: 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:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[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]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: nnn-1.7-1.fc29.x86_64.rpm
          nnn-debuginfo-1.7-1.fc29.x86_64.rpm
          nnn-debugsource-1.7-1.fc29.x86_64.rpm
          nnn-1.7-1.fc29.src.rpm
nnn.x86_64: W: spelling-error %description -l en_US favourite -> favorite, favoritism
nnn.x86_64: W: spelling-error %description -l en_US noice -> nice, notice, novice
nnn.x86_64: W: spelling-error %description -l en_US cd -> CD, dc, Cd
nnn.x86_64: W: spelling-error %description -l en_US chdir -> chair, choir
nnn.x86_64: W: only-non-binary-in-usr-lib
nnn.x86_64: W: no-manual-page-for-binary nlay
nnn-debugsource.x86_64: W: no-documentation
nnn.src: W: spelling-error %description -l en_US favourite -> favorite, favoritism
nnn.src: W: spelling-error %description -l en_US noice -> nice, notice, novice
nnn.src: W: spelling-error %description -l en_US cd -> CD, dc, Cd
nnn.src: W: spelling-error %description -l en_US chdir -> chair, choir
4 packages and 0 specfiles checked; 0 errors, 11 warnings.




Rpmlint (debuginfo)
-------------------
Checking: nnn-debuginfo-1.7-1.fc29.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.





Rpmlint (installed packages)
----------------------------
sh: /usr/bin/python: No such file or directory
nnn.x86_64: W: spelling-error %description -l en_US favourite -> favorite, favoritism
nnn.x86_64: W: spelling-error %description -l en_US noice -> nice, notice, novice
nnn.x86_64: W: spelling-error %description -l en_US cd -> CD, dc, Cd
nnn.x86_64: W: spelling-error %description -l en_US chdir -> chair, choir
nnn.x86_64: W: invalid-url URL: https://github.com/jarun/nnn <urlopen error [Errno -2] Name or service not known>
nnn.x86_64: W: only-non-binary-in-usr-lib
nnn.x86_64: W: no-manual-page-for-binary nlay
nnn-debugsource.x86_64: W: invalid-url URL: https://github.com/jarun/nnn <urlopen error [Errno -2] Name or service not known>
nnn-debugsource.x86_64: W: no-documentation
nnn-debuginfo.x86_64: W: invalid-url URL: https://github.com/jarun/nnn <urlopen error [Errno -2] Name or service not known>
3 packages and 0 specfiles checked; 0 errors, 10 warnings.



Requires
--------
nnn (rpmlib, GLIBC filtered):
    /bin/bash
    libc.so.6()(64bit)
    libncursesw.so.6()(64bit)
    libreadline.so.7()(64bit)
    libtinfo.so.6()(64bit)
    rtld(GNU_HASH)

nnn-debugsource (rpmlib, GLIBC filtered):

nnn-debuginfo (rpmlib, GLIBC filtered):



Provides
--------
nnn:
    nnn
    nnn(x86-64)

nnn-debugsource:
    nnn-debugsource
    nnn-debugsource(x86-64)

nnn-debuginfo:
    debuginfo(build-id)
    nnn-debuginfo
    nnn-debuginfo(x86-64)



Source checksums
----------------
https://github.com/jarun/nnn/archive/v1.7/nnn-1.7.tar.gz :
  CHECKSUM(SHA256) this package     : fbe26efbed8b467352f313b92f8617d873c8cf0209fb6377572cf8d1ddc2747c
  CHECKSUM(SHA256) upstream package : fbe26efbed8b467352f313b92f8617d873c8cf0209fb6377572cf8d1ddc2747c


Generated by fedora-review 0.6.1 (f03e4e7) last change: 2016-05-02
Command line :/usr/bin/fedora-review -b 1548761
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 16 Dridi Boukelmoune 2018-03-14 08:58:52 UTC
FYI:

- https://github.com/jarun/nnn/pull/96
- https://github.com/jarun/nnn/issues/97

This looks overall good but I disagree with adding `Requires: bash-completion` because nnn will work fine without this package. Considering that bash is the default shell on Fedora, `Recommends:` would be more appropriate.

From the packaging guidelines:

https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#File_and_Directory_Ownership

See the example "The directory is owned by a package which is not required for your package to function" and its solution:

> The evolution package should own the /usr/share/gtk-doc directory. There is no need to add an explicit Requires on gtk-doc solely for the directory ownership. 

Since you need the ownership of both directories, sub-directories and finally completion scripts, you can simplify your %files list by omitting the %dir entries:

    -%{_datadir}/bash-completion/completions/nnn-completion.bash
    +%{_datadir}/bash-completion

    -%dir %{_datadir}/fish
    -%dir %{_datadir}/fish/vendor_functions.d
    -%dir %{_datadir}/fish
    +%{_datadir}/fish

    -%dir %{_datadir}/zsh
    -%dir %{_datadir}/zsh/site-functions
    -%{_datadir}/zsh/site-functions/_nnn
    +%{_datadir}/zsh

The latter is only a suggestion.

Comment 17 Zbigniew Jędrzejewski-Szmek 2018-03-14 09:05:27 UTC
> Considering that bash is the default shell on Fedora, `Recommends:` would be more appropriate.

Yes, please don't add unnecessary strong dependencies like that.

Comment 19 Dridi Boukelmoune 2018-03-14 15:58:57 UTC
Package approved.

If you are looking for a co-maintainer, while my initial intention was only a review swap I may become an active nnn user. It may answer one of my pain points for which I never really looked for a solution since it's not too frequent :)

Comment 20 Robert-André Mauchin 🐧 2018-03-14 16:29:37 UTC
Thanks!

Comment 21 Gwyn Ciesla 2018-03-14 16:30:06 UTC
(fedrepo-req-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/nnn

Comment 22 Fedora Update System 2018-03-15 15:46:55 UTC
nnn-1.7-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-cac53b01ee

Comment 23 Fedora Update System 2018-03-15 15:55:12 UTC
nnn-1.7-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a3439ef672

Comment 24 Fedora Update System 2018-03-16 14:45:14 UTC
nnn-1.7-1.fc28 has been pushed to the Fedora 28 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-2018-cac53b01ee

Comment 25 Fedora Update System 2018-03-16 17:55:18 UTC
nnn-1.7-1.fc27 has been pushed to the Fedora 27 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-2018-a3439ef672

Comment 26 Fedora Update System 2018-03-29 16:19:40 UTC
nnn-1.7-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2018-03-30 12:58:20 UTC
nnn-1.7-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.