Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1358215 - Review Request: direnv - shell environment variable manager
Summary: Review Request: direnv - shell environment variable manager
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dominic Cleal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-20 09:52 UTC by Dominic Cleal
Modified: 2017-01-19 05:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-19 05:53:38 UTC
dustymabe: fedora-review+


Attachments (Terms of Use)

Description Dominic Cleal 2016-07-20 09:52:52 UTC
Spec URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv.spec
SRPM URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv-2.9.0-1.fc25.src.rpm

Description: 
direnv is an environment switcher for the shell. It knows how to hook
into bash, zsh, tcsh and fish shell to load or unload environment
variables depending on the current directory. This allows
project-specific environment variables without cluttering the
"~/.profile" file.

Upstream: https://github.com/direnv/direnv/#readme

Fedora Account System Username: domcleal

Comment 1 Mario Blättermann 2016-07-24 11:21:13 UTC
The package doesn't contain any binary, so please add "BuildArch: noarch".

Comment 2 Dominic Cleal 2016-07-24 11:28:45 UTC
(In reply to Mario Blättermann from comment #1)
> The package doesn't contain any binary, so please add "BuildArch: noarch".

It contains %{_bindir}/direnv, which is a (statically-built) binary.

Comment 3 Dusty Mabe 2016-08-29 14:57:39 UTC
hey Dominic.

I think everything looks good. I've got one comment in there about parallel make.

This is my first go package review so please forgive me if I've missed something obvious. Maybe we can get a more experienced go packager to review this as well.


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

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: Cannot run licensecheck: Command 'licensecheck -r
     /var/lib/mock/fedora-24-x86_64/root/builddir/build/BUILD/direnv-2.9.0'
     returned non-zero exit status 1
[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.
[-]: 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.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 2 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 %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]: 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]: 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:
[!]: Uses parallel make %{?_smp_mflags} macro.

DWM: Maybe consider adding this flag to your call to make?
     https://fedoraproject.org/wiki/Packaging:Guidelines#Parallel_make

[x]: 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 direnv-
     debuginfo
[x]: 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]: %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]: 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]: Package should compile and build into binary rpms on all supported
     architectures.
[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.

Comment 4 Jan Chaloupka 2016-08-29 15:12:06 UTC
Would be handy to at least:

%global provider        github
%global provider_tld    com 
%global project         direnv
%global repo            direnv
# https://github.com/direnv/direnv
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}
%global commit          2bb2df4ca3bf3f45d1f36372c279615239e5c0f4

The commit is important so automatic tooling can scan your spec file and connect the code with commit and repository.

Then use

# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

instead of

ExclusiveArch: %{go_arches}
BuildRequires: compiler(go-compiler)

to make it portable to other architectures. %{go_arches} is not defined everywhere, the same holds for the compiler(go-compiler)

There are no devel packages so no need for devel subpackage.

Comment 5 Dominic Cleal 2016-08-30 07:34:27 UTC
Thanks for the review, updated the spec/SRPM:

Spec URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv.spec
SRPM URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv-2.9.0-2.fc26.src.rpm

(In reply to Dusty Mabe from comment #3)
> [!]: Uses parallel make %{?_smp_mflags} macro.
> 
> DWM: Maybe consider adding this flag to your call to make?
>      https://fedoraproject.org/wiki/Packaging:Guidelines#Parallel_make

Thanks, fixed in -2 for the main build (not %check).

(In reply to Jan Chaloupka from comment #4)
> Would be handy to at least:
> 
> %global provider        github
> %global provider_tld    com 
> %global project         direnv
> %global repo            direnv
> # https://github.com/direnv/direnv
> %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
> %global import_path     %{provider_prefix}
> %global commit          2bb2df4ca3bf3f45d1f36372c279615239e5c0f4
> 
> The commit is important so automatic tooling can scan your spec file and
> connect the code with commit and repository.

Can you elaborate on this please? The spec file doesn't built a particular upstream commit, it only uses official releases, so I'm not sure that hardcoding SHAs into the spec file makes sense.

> Then use
> 
> # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
> ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64
> %{arm}}
> # If go_compiler is not set to 1, there is no virtual provide. Use golang
> instead.
> BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
> 
> instead of
> 
> ExclusiveArch: %{go_arches}
> BuildRequires: compiler(go-compiler)
> 
> to make it portable to other architectures. %{go_arches} is not defined
> everywhere, the same holds for the compiler(go-compiler)

Thanks, fixed in -2.

Comment 6 Jan Chaloupka 2016-08-30 10:33:30 UTC
>> Would be handy to at least:
>> 
>> %global provider        github
>> %global provider_tld    com 
>> %global project         direnv
>> %global repo            direnv
>> # https://github.com/direnv/direnv
>> %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
>> %global import_path     %{provider_prefix}
>> %global commit          2bb2df4ca3bf3f45d1f36372c279615239e5c0f4
>> 
>> The commit is important so automatic tooling can scan your spec file and
>> connect the code with commit and repository.

> Can you elaborate on this please? The spec file doesn't built a particular
> upstream commit, it only uses official releases, so I'm not sure that
> hardcoding SHAs into the spec file makes sense.

The release itself is important for rpm's NVR. It is easier to search for commit macro in the spec file rather then parsing package release version and then detecting the corresponding commit from it.

Comment 7 Dominic Cleal 2016-08-30 10:38:08 UTC
(In reply to Jan Chaloupka from comment #6)
> >> The commit is important so automatic tooling can scan your spec file and
> >> connect the code with commit and repository.
> 
> > Can you elaborate on this please? The spec file doesn't built a particular
> > upstream commit, it only uses official releases, so I'm not sure that
> > hardcoding SHAs into the spec file makes sense.
> 
> The release itself is important for rpm's NVR. It is easier to search for
> commit macro in the spec file rather then parsing package release version
> and then detecting the corresponding commit from it.

What requires the corresponding commit to be recorded? I'm not aware of this in Fedora spec files generally, only when not using a release (https://fedoraproject.org/wiki/Packaging:SourceURL?rd=Packaging/SourceURL#Git_Hosting_Services). It doesn't feel like it belongs here, the version number to commit is part of upstream's process, not packaging.

Comment 8 Jan Chaloupka 2016-08-30 11:04:11 UTC
You are right. This is not part of the packaging guidelines. It is useful for tools that automatically scans spec files and associate package source code with upstream commit.

For instance, I have a tool that can automatically scan through all spec files, get the commit (from the %{commit}) macro and run lint. In this case it can be used to run all tests and associate test results with the commit. Automatic tools can then run tests on the latest upstream commit and determine if all tests pass. Comparing with the commit the tool can then notify a packager saying a new commit with all tests passing is available.

This is not required, just useful to have.

Comment 9 Dominic Cleal 2016-08-30 11:32:26 UTC
Thanks for the explanation, I was unaware of it before now, but have added it in case it's useful. I'll try to remember to keep the SHA in sync.

It might be worth proposing it via FPC for inclusion in the common guidelines so it's standardised.

The updated spec/SRPM are available at:

Spec URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv.spec
SRPM URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv-2.9.0-3.fc26.src.rpm

Comment 10 Dusty Mabe 2016-08-30 18:02:44 UTC
> %global _dwz_low_mem_die_limit 0

Should we add a comment up here to say what these are going to be used for? basically a nice comment of the discussion above.

> %global provider        github
> %global provider_tld    com   
> %global project         direnv
> %global repo            direnv
> # https://github.com/direnv/direnv
> %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
> %global import_path     %{provider_prefix}
> %global commit          2bb2df4ca3bf3f45d1f36372c279615239e5c0f4

> Name: direnv
> Version: 2.9.0
> Release: 3%{?dist}
> Summary: Environment variable switcher for the shell 
> License: MIT
> URL: https://github.com/direnv/direnv
> Source0: https://github.com/direnv/direnv/archive/v%{version}.tar.gz

should URL and Source0 use the provider/provider_tld/project/repo macros that you just created above?

Comment 11 Dominic Cleal 2016-08-30 18:13:54 UTC
Both comments addressed, thanks for the feedback. I've also corrected the URL field, as I realised that http://direnv.net is the project homepage (linked from GitHub).

Spec URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv.spec
SRPM URL: https://fedorapeople.org/~domcleal/reviews/direnv/direnv-2.9.0-4.fc26.src.rpm

Comment 12 Dusty Mabe 2016-08-30 19:42:08 UTC
LGTM. jchaloup, want to give it one more look over before ack?

Comment 13 Jan Chaloupka 2016-08-31 06:41:33 UTC
LGTM

Comment 14 Dusty Mabe 2016-09-01 19:09:56 UTC
ok good deal. passing review

Comment 15 Fedora Update System 2016-09-02 13:46:12 UTC
direnv-2.9.0-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6d6d427d8a

Comment 16 Fedora Update System 2016-09-02 13:47:47 UTC
direnv-2.9.0-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6fca1153d8

Comment 17 Dominic Cleal 2016-09-02 13:49:46 UTC
Thanks for the review Dusty and Jan. Package is now built for Rawhide, F25 and F24 (updates pending).

Comment 18 Fedora Update System 2016-09-03 03:22:58 UTC
direnv-2.9.0-4.fc24 has been pushed to the Fedora 24 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-2016-6fca1153d8

Comment 19 Fedora Update System 2016-09-03 03:53:04 UTC
direnv-2.9.0-4.fc25 has been pushed to the Fedora 25 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-2016-6d6d427d8a

Comment 20 Fedora Update System 2017-01-19 05:53:38 UTC
direnv-2.9.0-4.fc25 has been pushed to the Fedora 25 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.