Bug 786249

Summary: Review Request: rubygem-puppet-lint - Tool to verify the style of puppet manifests
Product: [Fedora] Fedora Reporter: Michael S. <misc>
Component: Package ReviewAssignee: Bohuslav "Slavek" Kabrda <bkabrda>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bkabrda, fedora, notting, package-review
Target Milestone: ---Flags: bkabrda: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-29 12:07:49 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 Michael S. 2012-01-31 20:16:38 UTC
Spec URL: http://www.ephaone.org/~misc/specs/rubygem-puppet-lint.spec
SRPM URL: http://www.ephaone.org/~misc/specs/rubygem-puppet-lint-0.1.12-1.fc16.src.rpm
Description: Ensure your Puppet manifests conform with the Puppetlabs style guide

Checks your Puppet manifests against the Puppetlabs
style guide and alerts you to any discrepancies.

Comment 1 Michael S. 2012-03-24 12:53:05 UTC
Made the rpm compile on f17 ( but I am not sure it work fine on f16 now )

Spec URL: http://www.ephaone.org/~misc/specs/rubygem-puppet-lint.spec
SRPM URL: http://www.ephaone.org/~misc/specs/rubygem-puppet-lint-0.1.12-1.fc17.src.rpm

Comment 2 Russell Harrison 2012-03-26 22:24:41 UTC
Michael,

I was getting ready to open my own review bug when I noticed you beat me to the punch.  I took a first run at your original spec and I'm looking at the updated spec now.  You are correct the new spec will not build on fedora <= f16 or epel.  Both versions will need to be maintained in the meantime.

Here are my notes from the overall package review guidelines I'll include ruby specific notes in a future comment.

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

Key:
- = N/A
x = Pass
! = Fail
? = Not evaluated



==== Generic ====
[x]: MUST Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.

[x]: MUST Package successfully compiles and builds into binary rpms on at
     least one supported primary architecture.

Note this package will not build under f17+ a new spec will need to be created for future versions.

[-]: MUST %build honors applicable compiler flags or justifies otherwise.
[x]: MUST All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[x]: MUST Buildroot is not present
     Note: Unless packager wants to package for EPEL5 this is fine
[x]: MUST Package contains no bundled libraries.
[x]: MUST Changelog in prescribed format.
[x]: MUST Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: Clean would be needed if support for EPEL is required
[x]: MUST Sources contain only permissible code or content.
[x]: MUST Each %files section contains %defattr if rpm < 4.4
     Note: Note: defattr macros not found. They would be needed for EPEL5
[ ]: MUST Macros in Summary, %description expandable at SRPM build time.
[x]: MUST Package requires other packages for directories it uses.
[x]: MUST Package uses nothing in %doc for runtime.
[x]: MUST Package is not known to require ExcludeArch.
[x]: MUST Permissions on files are set properly.
[x]: MUST Package does not contain duplicates in %files.
[x]: MUST Fully versioned dependency in subpackages, if present.
[x]: MUST Spec file lacks Packager, Vendor, PreReq tags.
[x]: MUST Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
     Note: rm -rf would be needed if support for EPEL5 is required
[x]: MUST Large documentation files are in a -doc subpackage, if required.
[!]: MUST 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 %doc.
[!]: MUST License field in the package spec file matches the actual license.
puppet-lint is licenced under a MIT licence not "GPLv2+ or Ruby" listed in the spec file.

[x]: MUST License file installed when any subpackage combination is installed.
[x]: MUST Package consistently uses macros (instead of hard-coded directory
     names).
[x]: MUST Package is named according to the Package Naming Guidelines.
[x]: MUST Package does not generate any conflict.
[x]: MUST Package obeys FHS, except libexecdir and /usr/target.
[x]: MUST Package must own all directories that it creates.
[x]: MUST Package does not own files or directories owned by other packages.
[x]: MUST Package installs properly.
[x]: MUST Requires correct, justified where necessary.
[!]: MUST Rpmlint output is silent.

rpmlint rubygem-puppet-lint-0.1.12-1.fc16.noarch.rpm

rubygem-puppet-lint.noarch: W: no-documentation
rubygem-puppet-lint.noarch: W: no-manual-page-for-binary puppet-lint
1 packages and 0 specfiles checked; 0 errors, 2 warnings.


The README.md and LICENSE file should be listed as %doc

rubvgems have their own man format.

rpmlint rubygem-puppet-lint-0.1.12-1.fc16.src.rpm

1 packages and 0 specfiles checked; 0 errors, 0 warnings.


rpmlint rubygem-puppet-lint-doc-0.1.12-1.fc16.noarch.rpm

rubygem-puppet-lint-doc.noarch: W: wrong-file-end-of-line-encoding /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/cache.ri
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/code%3d-i.ri %3d
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/String/%25-i.ri %25
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/errors%3f-i.ri %3f
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/String/expand%21-i.ri %21
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/file%3d-i.ri %3d
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/warnings%3f-i.ri %3f
1 packages and 0 specfiles checked; 0 errors, 7 warnings.


These seem to be pretty common with rubygems

[x]: MUST Sources used to build the package match the upstream source, as
     provided in the spec URL.
/home/rharriso/tmp/rpm/786249/puppet-lint-0.1.12.gem :
  MD5SUM this package     : 4dd542e2093b6dd06cfec7a69930913c
  MD5SUM upstream package : 4dd542e2093b6dd06cfec7a69930913c

[x]: MUST Spec file is legible and written in American English.
[x]: MUST Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[-]: MUST Package contains a SysV-style init script if in need of one.
[x]: MUST File names are valid UTF-8.
[-]: MUST Useful -debuginfo package or justification otherwise.
[x]: SHOULD Reviewer should test that the package builds in mock.
[-]: SHOULD 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]: SHOULD Dist tag is present.
[x]: SHOULD No file requires outside of /etc, /bin, /sbin, /usr/bin,
     /usr/sbin.
[x]: SHOULD Final provides and requires are sane (rpm -q --provides and rpm -q
     --requires).
[x]: SHOULD Package functions as described.
[!]: SHOULD Latest version is packaged.

version 0.1.13 has been released.

[x]: SHOULD Package does not include license text files separate from
     upstream.
[x]: SHOULD SourceX is a working URL.
[-]: SHOULD Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: SHOULD Package should compile and build into binary rpms on all supported
     architectures.
[!]: SHOULD %check is present and all tests pass.

This will not build for epel 6 because of build requires for the check portion.

[x]: SHOULD Packages should try to preserve timestamps of original installed
     files.
[x]: SHOULD Spec use %global instead of %define.

Issues:
[!]: MUST 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 %doc.
See: http://fedoraproject.org/wiki/Packaging/LicensingGuidelines#License_Text

[!]: MUST License field in the package spec file matches the actual license.
puppet-lint is licenced under a MIT licence not "GPLv2+ or Ruby" listed in the spec file.

[!]: MUST Rpmlint output is silent.
rpmlint rubygem-puppet-lint-0.1.12-1.fc16.noarch.rpm

rubygem-puppet-lint.noarch: W: no-documentation
rubygem-puppet-lint.noarch: W: no-manual-page-for-binary puppet-lint
1 packages and 0 specfiles checked; 0 errors, 2 warnings.

The README.md and LICENSE file should be listed as %doc

rubvgems have their own man format.

rpmlint rubygem-puppet-lint-0.1.12-1.fc16.src.rpm

1 packages and 0 specfiles checked; 0 errors, 0 warnings.


rpmlint rubygem-puppet-lint-doc-0.1.12-1.fc16.noarch.rpm

rubygem-puppet-lint-doc.noarch: W: wrong-file-end-of-line-encoding /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/cache.ri
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/code%3d-i.ri %3d
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/String/%25-i.ri %25
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/errors%3f-i.ri %3f
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/String/expand%21-i.ri %21
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/file%3d-i.ri %3d
rubygem-puppet-lint-doc.noarch: W: unexpanded-macro /usr/lib/ruby/gems/1.8/doc/puppet-lint-0.1.12/ri/PuppetLint/warnings%3f-i.ri %3f
1 packages and 0 specfiles checked; 0 errors, 7 warnings.


These seem to be pretty common with rubygems


See: http://fedoraproject.org/wiki/Packaging/Guidelines#rpmlint

[!]: SHOULD Latest version is packaged.
version 0.1.13 has been released.

Generated by fedora-review 0.1.3
External plugins:

Comment 3 Russell Harrison 2012-03-26 22:46:45 UTC
Ruby Gidelines:
https://fedoraproject.org/wiki/Packaging/Ruby

[x]: Pure Ruby packages must be built as noarch packages.
[x]: Packages that contain Ruby Gems must be called rubygem-%{gemname} where gemname is the name from the Gem's specification.
[x]: The Source of the package must be the full URL to the released Gem archive; the version of the package must be the Gem's version
[x]: The package must have a Requires and a BuildRequires on rubygems
[x]: The package must provide rubygem(%{gemname}) where gemname is the name from the Gem's specification. For every dependency on a Gem named gemdep, the package must contain a Requires on rubygem(%{gemdep}) with the same version constraints as the Gem
[!]: The %prep and %build sections of the specfile should be empty.

I am aware the guidelines are changing and this requirement will as well but the current requirements specify this.

[x]: The Gem must be installed into %{gemdir} defined as %global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
[!]: The install should be performed with the command gem install --local --install-dir %{buildroot}%{gemdir} --force %{SOURCE0}
[x]: The package must own the following files and directories: 
    %{gemdir}/gems/%{gemname}-%{version}/
    %{gemdir}/cache/%{gemname}-%{version}.gem
    %{gemdir}/specifications/%{gemname}-%{version}.gemspec
[-]: Architecture-specific content must not be installed into %{gemdir}
[x]: If the Gem only contains pure Ruby code, it must be marked as BuildArch: noarch. If the Gem contains binary content (e.g., for a database driver), it must be marked as architecture specific, and all architecture specific content must be moved from the %{gemdir} to the [#ruby_sitearch %{ruby_sitearch} directory] during %install

Comment 4 Russell Harrison 2012-03-26 22:54:45 UTC
As I mentioned earlier I had started packaging puppet-lint myself.  I've taken some of the improvements you've made in your spec files and incorporated it into my own which also resolves the issues I noted above if you would like to compare / comment on my version you can find it here:

For F16 and EL6
Spec URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-doc-0.1.13-1.fc16.spec
SRPM URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.1.13-1.fc16.src.rpm

For F17+:
Spec URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-doc-0.1.13-1.fc17.spec
SRPM URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.1.13-1.fc17.src.rpm

Comment 5 Michael S. 2012-03-27 05:41:41 UTC
I just did a rpm because I used it, but if you want to take care of the package for EPEL and previous fedora version, we can take your version. I just used a automated generator for that and corrected some obvious issues, but since the ruby packaging world is changing so much, I have decided to wait a little before revisiting this topic ( ie, no need to do a perfect spec if I need to fix it later :/ )

Comment 6 Russell Harrison 2012-03-28 16:24:35 UTC
If you'd prefer we could co-maintain the package and use my version as the starting point and revisit the f17+ specs as the ruby guidelines settle out.

Comment 7 Michael S. 2012-03-31 23:51:37 UTC
Why not co maintain, but i am far from being a ruby expert when it come to packaging.

How do we proceed, we open a new request, who do the review ?

Comment 8 Bohuslav "Slavek" Kabrda 2012-05-07 08:02:51 UTC
Hi guys, I'd like to take this for a review, are you both ok with it? Could you please tell me, where the current versions of your SPEC and SRPM are?
Thanks.

Comment 9 Russell Harrison 2012-06-25 17:46:50 UTC
(In reply to comment #8)
> Hi guys, I'd like to take this for a review, are you both ok with it? Could
> you please tell me, where the current versions of your SPEC and SRPM are?
> Thanks.

I've finally gotten a chance to redo my packaging of puppet-lint from scratch using the new ruby packaging guidelines.  

Spec URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.1.13-1.fc17.spec
SRPM URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.1.13-1.fc17.src.rpm

Comment 10 Russell Harrison 2012-08-27 04:15:34 UTC
puppet-lint 0.2.0 was finally released a few days ago.  I'd been waiting for this version to be released because of some bugs I'd encountered before continuing with this review. I've updated my packages for the new version and they can be found here:

Spec URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.2.0-1.fc18.spec
SRPM URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.2.0-1.fc18.src.rpm

Comment 11 Russell Harrison 2012-09-07 18:25:59 UTC
puppet-lint 0.2.1 has been released.  I've update my package with the new version.

Spec URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.2.1-1.fc18.spec
SRPM URL: http://rharrison.fedorapeople.org/package_review/rubygem-puppet-lint-0.2.1-1.fc18.src.rpm

Comment 12 Bohuslav "Slavek" Kabrda 2012-09-10 06:47:47 UTC
Sorry for the delay, here are my comments:
- Is Requires: puppet really needed? Isn't it possible to lint the puppet files without actually having puppet installed?
- BuildRequires: rubygem(rspec-core) should be BuildRequires: rubygem(rspec) from F17 and above.
- BuildRequires: rubygem(rdoc) is not necessary, rdoc gets automatically drawn in by rubygems, that generate the documentation.
- Some files should be moved to -doc subpackage. The rule of thumb we use here is: if it is not needed for runtime, put it in the -doc subpackage. Moreover, the packages that actually are documentation, like rdoc files or README, should still be marked %doc even in the subpackage. Other files, as Rakefile, should be moved to -doc subpackage while not being marked as %doc. LICENSE should be marked as %doc, but should stay in the main package. So please move Rakefile, spec and README to -doc subpackage.
- It is customary (but not required) not to remove the %{buildroot}/%{gem_instdir}/.*, but %exclude them in the file listing (consider this a nice-to-have, certainly not a blocker).
- %{buildroot}/%{gem_instdir}/%{gem_name}.gemspec file is usually kept in the package and placed in the -doc, while not being marked as %doc :)

Please post the new spec/srpm. The package looks good in overall, so I think there will be no further problems when you fix the ones above.

Comment 13 Russell Harrison 2012-09-25 16:54:40 UTC
(In reply to comment #12)
> Sorry for the delay, here are my comments:
> - Is Requires: puppet really needed? Isn't it possible to lint the puppet
> files without actually having puppet installed?
I think you're right, v0.2.0 looks like it dropped the puppet requirement from the gem. I'll drop it from the package as well.

> - BuildRequires: rubygem(rspec-core) should be BuildRequires: rubygem(rspec)
> from F17 and above.
OK, I was trying to bring in as little as possible required for the tests to run.  I'll change it to match standard practice.

> - BuildRequires: rubygem(rdoc) is not necessary, rdoc gets automatically
> drawn in by rubygems, that generate the documentation.
Removed

> - Some files should be moved to -doc subpackage. The rule of thumb we use
> here is: if it is not needed for runtime, put it in the -doc subpackage.
> Moreover, the packages that actually are documentation, like rdoc files or
> README, should still be marked %doc even in the subpackage. Other files, as
> Rakefile, should be moved to -doc subpackage while not being marked as %doc.
> LICENSE should be marked as %doc, but should stay in the main package. So
> please move Rakefile, spec and README to -doc subpackage.
Even README? That seems a bit extreme, I would think that at least that minimal level of documentation should remain with the main package.  Moving the requested files to the doc subpackage.

> - It is customary (but not required) not to remove the
> %{buildroot}/%{gem_instdir}/.*, but %exclude them in the file listing
> (consider this a nice-to-have, certainly not a blocker).
That seems cleaner to me as well. I'm not a fan of removing things during rpm builds.

> - %{buildroot}/%{gem_instdir}/%{gem_name}.gemspec file is usually kept in
> the package and placed in the -doc, while not being marked as %doc :)
Done

> Please post the new spec/srpm. The package looks good in overall, so I think
> there will be no further problems when you fix the ones above.
Great! I'll test out these changes this morning and post the new files later today.

Comment 15 Bohuslav "Slavek" Kabrda 2012-09-26 05:50:54 UTC
Great, the package builds and works fine and specfile is clean. APPROVED

Comment 16 Russell Harrison 2012-09-29 20:30:18 UTC
New Package SCM Request
=======================
Package Name: rubygem-puppet-lint
Short Description: Tool to verify the style of puppet manifests
Owners: rharrison
Branches: f17 f18 el6
InitialCC:

Comment 17 Gwyn Ciesla 2012-09-30 02:08:32 UTC
Git done (by process-git-requests).

Comment 18 Fedora Update System 2012-10-01 03:48:32 UTC
rubygem-puppet-lint-0.2.1-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/rubygem-puppet-lint-0.2.1-3.fc17

Comment 19 Fedora Update System 2012-10-01 19:00:30 UTC
rubygem-puppet-lint-0.2.1-3.el6 has been pushed to the Fedora EPEL 6 testing repository.

Comment 20 Bohuslav "Slavek" Kabrda 2012-11-29 12:07:49 UTC
The package has been built and pushed to stable, I'm closing this bug.

Comment 21 Russell Harrison 2015-02-19 23:23:14 UTC
Package Change Request
======================
Package Name: rubygem-puppet-lint
New Branches: el7
Owners: rharrison
InitialCC: 

I was reminded by a user that I forgot to request a el7 branch when RHEL7 was released.

Bug 1191370 Please build to EPEL 7

Comment 22 Russell Harrison 2015-02-23 15:49:08 UTC
Package Change Request
======================
Package Name: rubygem-puppet-lint
New Branches: epel7
Owners: rharrison

I was reminded by a user that I forgot to request a el7 branch when RHEL7 was released.

Bug 1191370 Please build to EPEL 7

Comment 23 Gwyn Ciesla 2015-02-24 14:55:29 UTC
Git done (by process-git-requests).