Bug 1244102 - (composer/spdx-licenses) Review Request: php-composer-spdx-licenses - SPDX licenses list and validation library
Review Request: php-composer-spdx-licenses - SPDX licenses list and validatio...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Shawn Iwinski
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-17 02:36 EDT by Remi Collet
Modified: 2015-08-08 16:04 EDT (History)
3 users (show)

See Also:
Fixed In Version: php-composer-spdx-licenses-1.1.0-2.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-07 09:06:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
shawn: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)
phpcompatinfo-full.log (4.63 KB, text/plain)
2015-07-21 08:45 EDT, Shawn Iwinski
no flags Details
phpcompatinfo-src.log (4.09 KB, text/plain)
2015-07-21 08:46 EDT, Shawn Iwinski
no flags Details
fedora-review.txt (6.20 KB, text/plain)
2015-07-21 08:46 EDT, Shawn Iwinski
no flags Details

  None (edit)
Description Remi Collet 2015-07-17 02:36:46 EDT
Spec URL: https://raw.githubusercontent.com/remicollet/remirepo/c40107535873bb656d74b808436d9d8fdf4df389/php/php-composer-spdx-licenses/php-composer-spdx-licenses.spec
SRPM URL: http://rpms.famillecollet.com/SRPMS/php-composer-spdx-licenses-1.0.0-1.20150717git572abf7.remi.src.rpm
Description: 
SPDX licenses list and validation library.

Originally written as part of composer/composer,
now extracted and made available as a stand-alone library.

Fedora Account System Username: remi
Comment 1 Remi Collet 2015-07-17 02:42:53 EDT
No urgency... until https://github.com/composer/composer/pull/4264 is merged...
Comment 3 Marcin Haba 2015-07-18 18:25:07 EDT
Hello,

I am not Fedora packages maintainer, so my review is informal.

I have five following points about your Spec and package:

1) Source0 should be URL available to download, not %{name}-%{version}-%{gh_short}.tgz
https://fedoraproject.org/wiki/Packaging:SourceURL?rd=Packaging/SourceURL#Referencing_Source

2) "URL" value is not possible to open from Spec file due to macros used. I am not sure if here are allowed macros.

"URL: The full URL for more information about the program"
from:
https://fedoraproject.org/wiki/How_to_create_an_RPM_package#SPEC_file_overview

I would ask somebody else for confirm or nagate this point.

3) The %clean section is not required for F-13 and above. 
https://fedoraproject.org/wiki/Packaging:Guidelines#.25clean

4) In Spec comment:

# git snashop to get upstream test suite

What is it snashop? Do you mean snapshot?

5) rpmlint shows on RPM:

php-composer-spdx-licenses.noarch: E: script-without-shebang /usr/share/php/Composer/Spdx/autoload.php
php-composer-spdx-licenses.noarch: E: script-without-shebang /usr/share/php/Composer/Spdx/SpdxLicenses.php

The two scripts have executable permissions. When you unset executable permission on these files then should be OK.
Comment 4 Remi Collet 2015-07-20 01:41:47 EDT
1/ 2/ explained in comment => upstream doesn't provide any useful archive.

3/ not needed but not forbiden

(I usually clean EL-5 stuff after inital import)

4/ yes, snapshot

5/ good catch, fixed

Spec: https://raw.githubusercontent.com/remicollet/remirepo/2b0562f4427714414e2be3e0b9a778a9e090dfff/php/php-composer-spdx-licenses/php-composer-spdx-licenses.spec
Srpm: http://rpms.famillecollet.com/SRPMS/php-composer-spdx-licenses-1.1.0-2.remi.src.rpm
Comment 5 Marcin Haba 2015-07-20 04:50:25 EDT
Package Review
==============

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


Issues:
=======
- 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 CHANGELOG.md is marked as %doc instead of %license
  See:
  http://fedoraproject.org/wiki/Packaging/LicensingGuidelines#License_Text


===== 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: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated". 4 files have unknown license. Detailed
     output of licensecheck in /home/gani/1244102-php-composer-spdx-
     licenses/licensecheck.txt
[x]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by:
     /usr/share/php/Composer(composer)
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: 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.
[x]: 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]: 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 10240 bytes in 4 files.
[ ]: 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]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[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]: 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:
[ ]: Buildroot is not present
     Note: Buildroot: present but not needed
[x]: 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).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: 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.
[-]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Reviewer should test that the package builds in mock.
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: No rpmlint messages.
[x]: Spec file according to URL is the same as in SRPM.

PHP:
[x]: Run phpci static analyze on all php files.
     Note: phpCompatInfo version 4.3.0 DB built Jun 16 2015 12:31:49 CEST
     static analyze results in /home/gani/1244102-php-composer-spdx-
     licenses/phpci.log


Hello,

I performed informal review form.

Here are my comments to some review form fields:

[x]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by:
     /usr/share/php/Composer(composer)

I marked this point as passed because Composer path is generic path for main composer packages repository
----

[x]: 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]: Buildroot is not present
     Note: Buildroot: present but not needed

I marked these points as passed because Remi explained that he is going to build the package in EPEL5 environment. According to Packages Guidlines:

"EPEL difference
rpm in EPEL5 requires the BuildRoot tag and it must be manually cleaned in %install; follow the EPEL Guidelines."
https://fedoraproject.org/wiki/Packaging:Guidelines#BuildRoot_tag
----

[ ]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed

I am not sure this point, so I leaved it empty. For me it does not look too dangerous.
----

[ ]: Package complies to the Packaging Guidelines

I did not mark this field because still I am learning the Packaging Guidelines. From this reason I am not able to determine this point.
----

[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: %clean present but not required

I marked as passed because Remi explained that he is going to build the package in EPEL5 environment. According to Packages Guidlines:

According to:
"Each package for F-12 and below (or EPEL 5) MUST have a %clean section, which contains rm -rf %{buildroot}"

https://fedoraproject.org/wiki/Packaging:Guidelines#.25clean
----

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

Result from PHPUnit triggered by Spec %global with_test 1 as below:

OK (347 tests, 352 assertions)

----

My comment:

I checked manually using basic methods call from php-composer-spdx-licenses. It works very well! :)

Thanks for your valuable contribution for PHP developers and Fedora. Thank you for this review too.
Comment 6 Remi Collet 2015-07-20 05:23:04 EDT
(In reply to Marcin Haba from comment #5)
> Issues:
> =======
> - 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 CHANGELOG.md is marked as %doc instead of %license
>   See:
>   http://fedoraproject.org/wiki/Packaging/LicensingGuidelines#License_Text

I don't understand this comment.

   %license LICENSE
   %doc *.md
Comment 7 Marcin Haba 2015-07-20 05:29:11 EDT
Thanks for this notice.

It is comment generated automatically by fedora-review tool. I have no idea about it either why this comment occured. I pasted it as part of entire generated form.

I will try to look on this issue deeper.
Comment 8 Marcin Haba 2015-07-20 06:38:52 EDT
Hello,

It looks that the source of this issue is here:

/usr/lib/python2.7/site-packages/FedoraReview/plugins/generic.py

Here is grabbing all "potential" licenses files:

for potentialfile in ['COPYING', 'LICEN', 'copying', 'licen']:
    pattern = '*' + potentialfile + '*'
    ....[if 'COPYING', 'LICEN', 'copying' or 'licen' found in paths from rpm content then add the file to licenses list (licenses variable)....


and next the license files are checked if exists in docs files list:

for _license in licenses:
     if _license in docs:
         ....[test fail due to found "license" file is in docs....


The problem here is in line 791 generic.py:

    pattern = '*' + potentialfile + '*'

and in consequence in 793 generic.py:

licenses = filter(lambda l: not self.rpms.find(l + '/*'), licenses)file

because pattern here is find(l + '/*')

Your package name contains in name keyword "licenses" - "php-composer-spdx-licenses"

and from this reason it finish with test fail.

I will propose to fedora-review author change the patterm from:

    pattern = '*' + potentialfile + '*'

to:

    pattern = '*/' + potentialfile + '*'

Then this test case be search on files only, not paths.

I checked this change with your package and fedora-review. It works for me.
Comment 9 Marcin Haba 2015-07-20 11:01:20 EDT
Hello,

Just I notified fedora-review authors about issue from this feature request.

https://fedorahosted.org/FedoraReview/ticket/264

I also prepared a bit better patch that this above and I attached patch to ticket.
Comment 10 Remi Collet 2015-07-21 02:58:15 EDT
(In reply to Remi Collet from comment #1)
> No urgency... until https://github.com/composer/composer/pull/4264 is
> merged...

PR 4264 is merged.
Comment 11 Remi Collet 2015-07-21 06:22:58 EDT
@Shawn, would you have a few minutes for a quick "formal" review (as the informal already done most of the work).
Comment 12 Shawn Iwinski 2015-07-21 08:45:36 EDT
Created attachment 1054353 [details]
phpcompatinfo-full.log

phpCompatInfo version 4.3.0 DB built Jun 16 2015 12:31:49 CEST
Comment 13 Shawn Iwinski 2015-07-21 08:46:01 EDT
Created attachment 1054354 [details]
phpcompatinfo-src.log

phpCompatInfo version 4.3.0 DB built Jun 16 2015 12:31:49 CEST
Comment 14 Shawn Iwinski 2015-07-21 08:46:28 EDT
Created attachment 1054355 [details]
fedora-review.txt

Generated by fedora-review 0.6.0 (3c5c9d7) last change: 2015-05-20
Command line :/usr/bin/fedora-review -m fedora-rawhide-x86_64 -b 1244102
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, PHP, Shell-api
Disabled plugins: Java, C/C++, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, Ruby
Disabled flags: EXARCH, DISTTAG, EPEL5, BATCH, EPEL6
Comment 15 Shawn Iwinski 2015-07-21 08:47:47 EDT
[!]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
     Note: rm -rf %{buildroot} present but not required
[!]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed
[!]: Buildroot is not present
     Note: Buildroot: present but not needed
[!]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: %clean present but not required

As usual, remove EPEL 5 bits after initial import.



No blockers.

===== APPROVED =====
Comment 16 Remi Collet 2015-07-21 08:50:09 EDT
@Shawn great thanks, this was really fast :)

New Package SCM Request
=======================
Package Name: php-composer-spdx-licenses
Short Description: SPDX licenses list and validation library
Upstream URL: https://github.com/composer/spdx-licenses
Owners: remi
Branches: f21 f22 f23 epel7
InitialCC:
Comment 17 Gwyn Ciesla 2015-07-23 09:46:53 EDT
Git done (by process-git-requests).
Comment 18 Fedora Update System 2015-07-23 11:26:23 EDT
php-composer-spdx-licenses-1.1.0-2.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/php-composer-spdx-licenses-1.1.0-2.fc22
Comment 19 Fedora Update System 2015-07-23 11:28:36 EDT
php-composer-spdx-licenses-1.1.0-2.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/php-composer-spdx-licenses-1.1.0-2.el7
Comment 20 Fedora Update System 2015-07-23 11:28:42 EDT
php-composer-spdx-licenses-1.1.0-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/php-composer-spdx-licenses-1.1.0-2.fc21
Comment 21 Fedora Update System 2015-07-23 15:13:07 EDT
php-composer-spdx-licenses-1.1.0-2.el7 has been pushed to the Fedora EPEL 7 testing repository.
Comment 22 Fedora Update System 2015-08-07 09:06:42 EDT
php-composer-spdx-licenses-1.1.0-2.fc21 has been pushed to the Fedora 21 stable repository.
Comment 23 Fedora Update System 2015-08-07 09:07:33 EDT
php-composer-spdx-licenses-1.1.0-2.fc22 has been pushed to the Fedora 22 stable repository.
Comment 24 Fedora Update System 2015-08-08 16:04:19 EDT
php-composer-spdx-licenses-1.1.0-2.el7 has been pushed to the Fedora EPEL 7 stable repository.

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