Bug 1047599 - Review Request: php-phpseclib-math-biginteger - Pure-PHP arbitrary precision integer arithmetic library
Summary: Review Request: php-phpseclib-math-biginteger - Pure-PHP arbitrary precision ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Shawn Iwinski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1047596
Blocks: 1047608 1047611
TreeView+ depends on / blocked
 
Reported: 2014-01-01 03:07 UTC by Adam Williamson
Modified: 2014-02-25 18:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-14 19:47:54 UTC
Type: ---
Embargoed:
shawn: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)
phpcompatinfo.log (13.40 KB, text/x-log)
2014-01-02 13:12 UTC, Shawn Iwinski
no flags Details
fedora-review.txt (7.19 KB, text/plain)
2014-01-02 13:17 UTC, Shawn Iwinski
no flags Details

Description Adam Williamson 2014-01-01 03:07:00 UTC
Spec URL: https://www.happyassassin.net/reviews/php-phpseclib-Math-BigInteger/php-phpseclib-Math-BigInteger.spec
SRPM URL: https://www.happyassassin.net/reviews/php-phpseclib-Math-BigInteger/php-phpseclib-Math-BigInteger-0.3.5-1.fc21.src.rpm
Description: Supports base-2, base-10, base-16, and base-256 numbers.  Uses the GMP or BCMath extensions, if available, and an internal implementation, otherwise.
Fedora Account System Username: adamwill

Comment 1 Shawn Iwinski 2014-01-02 13:12:39 UTC
Created attachment 844552 [details]
phpcompatinfo.log

phpcompatinfo version 2.26.0

Comment 2 Shawn Iwinski 2014-01-02 13:17:36 UTC
Created attachment 844553 [details]
fedora-review.txt

Generated by fedora-review 0.5.1 (bb9bf27) last change: 2013-12-13
Command line :/usr/bin/fedora-review --mock-config fedora-rawhide-x86_64 -b 1047599
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, EPEL5, BATCH, DISTTAG

Comment 3 Shawn Iwinski 2014-01-02 13:22:31 UTC
===== MUST items =====

[!]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by: /usr/share/pear/Math(php-pear-
     Math-Stats)

     %files should be:

     %dir %{pear_phpdir}/Math
     %{pear_phpdir}/Math/BigInteger.php

[!]: Package is named according to the Package Naming Guidelines.

     Even though existing pkgs use CamelCase, we have been trying to adhere
     to the naming guideline "You should generally use lowercase", so:
     php-phpseclib-math-biginteger

[!]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.

     Please remove this EPEL 5 piece "rm -rf $RPM_BUILD_ROOT" in %install

===== SHOULD items =====

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

     Please remove this EPEL 5 piece

[!]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.

     Please submit a query to upstream to include a license file and link to it
     in your spec.

[x]: Final provides and requires are sane (see attachments).

     Please add the following from phpcompatinfo (can be done after initial
     import; these are already loaded from php-common but we explicitly specify
     all PHP extension requirements)
     * php-date
     * php-pcre

     Description already mentions optional BCMath (php-bcmath) and GMP
     (php-gmp) but you should also add a note about optional OpenSSL (php-openssl)

[x]: Package does not include license text files separate from upstream.

     We usually add a LICENSE file while we are waiting for upstream to add
     one from our request.

Comment 4 Remi Collet 2014-01-02 15:41:26 UTC
I agree.

About name: from very recent Guidelines change: "You should generally use lowercase and turn underscores into dashes unless there's a compelling reason to follow a different upstream convention."

Something to be fixed in "pear make-rpm-spec..."

About:
  [ -f package2.xml ] || mv package.xml package2.xml
  mv package2.xml %{pear_name}-%{version}/%{name}.xml

Cosmetic: It's usually enough to just use the package.xml (having both package.xml and package2.xml could exists in very old package but is not supported anymore (by PEAR), so usually, just check line <package packagerversion="1.9.2" version="2.0"..)

About dependencies, from Guidelines: "PHP extensions must have a Requires on all of the dependent extensions (php-date, php-gd, php-mbstring, ...). "

So yes php-date and php-pcre are mandatory (as extensions/packages split have change and will very probably change again)

From Guidelines: "Common licenses that require including their texts with all derivative works include ASL 2.0, EPL, BSD and MIT. ", so Yes LICENSE file is mandatory for this package.

Comment 5 Adam Williamson 2014-01-02 17:40:31 UTC
All of these come from pear make-rpm-spec, so we should probably fix that for the future.

I disagree with Shawn's first suggestion:

%files should be:

%dir %{pear_phpdir}/Math
%{pear_phpdir}/Math/BigInteger.php

There is no difference between ours except mine is simpler. In both cases the package owns /usr/share/pear/Math and /usr/share/pear/Math/BigInteger.php .

As long as there isn't a 'php-filesystem' package or something to own 'shared' namespaces like /usr/share/pear/Crypt , /usr/share/pear/Math etc, packages have no good choice, only three bad ones:

(bad) Own the directory, violating the guideline
(worse) Don't own the directory, and require a package that's completely unrelated and not required at all to ensure that *something* owns the directory
(worse?) Don't own the directory and don't require any other package, leaving the directory unowned unless one of the other packages that happens to own the directory is installed

In any case, both my current version and Shawn's suggestion implement the first of these.

I'll go through and clean the other stuff. Who wants to fix pear make-rpm-spec ? :)

Comment 6 Remi Collet 2014-01-02 17:57:13 UTC
I think (In reply to Adam Williamson from comment #5)
> (bad) Own the directory, violating the guideline

This is not violating the Guidelines and is the right solution.

Packages must own all directories they put files in, except for: 
* any directories owned by the filesystem, man, or other explicitly created -filesystem packages
* any directories owned by other packages in your package's natural dependency chain

You create the dir, and don't require anything that own it, so you have to own it.

> In any case, both my current version and Shawn's suggestion implement the
> first of these.

Yes.

> I'll go through and clean the other stuff. Who wants to fix pear
> make-rpm-spec ? :)

I think it will be me... just need to found time to dig again in this old code...

Comment 7 Adam Williamson 2014-01-02 18:22:46 UTC
remi: indeed, rather than "violating the guideline" I should have written "making rpmlint unhappy" :) the rpmlint 'error' is a false positive.

Comment 8 Adam Williamson 2014-01-05 01:10:42 UTC
On the licensing issue: the license is included inline in each of the actual source files. I don't believe this is a violation of the license itself or of Fedora's licensing policies, and I don't believe we need to ship a separate copy of the license text or ask upstream to do so.

Comment 10 Remi Collet 2014-01-07 09:56:20 UTC
The openssl.cfg have obviously not the correct role (upstream bug)

Should be role="cfg", thus will be installed in /etc/pear

Notice: this is a bit ugly to manage in source code, as it is needed to check if run from sources tree or from install one.

Commonly used solution (ex taken from php-bartlett-PHP-CompatInfo)

In Crypt/RSA.php

    $dir = '@cfg_dir@' . DIRECTORY_SEPARATOR . 'Crypt_RSA';
    if (strpos($dir, '@') === false) {
        // PEAR installer was used to install the package
    } else {
        // manual install
        $dir = dirname(__FILE__)
    }
    $filename = $dir . DIRECTORY_SEPARATOR . 'openssl.cnf';

In package.xml

   <file baseinstalldir="Crypt" name="RSA.php" role="php" >
     <tasks:replace from="@cfg_dir@" to="cfg_dir" type="pear-config" />
   </file>
   <file name="openssl.cnf" role="cfg"/>

Comment 11 Remi Collet 2014-01-07 09:57:22 UTC
Sorry for the noise, forget previous comment related to another package.

Comment 12 Adam Williamson 2014-01-09 22:11:49 UTC
So, is this one approved or not?

Comment 13 Remi Collet 2014-01-10 06:57:25 UTC
@shawn, what are the remaining blockers ?

If only the missing license, you can probably approved this package, as I have approved the other, thinking having the license text inclued in the file header is enough for a script language.

Comment 14 Shawn Iwinski 2014-01-10 18:57:28 UTC
(In reply to Adam Williamson from comment #12)
> So, is this one approved or not?

Yes :)


(In reply to Remi Collet from comment #13)
> @shawn, what are the remaining blockers ?
> 
> If only the missing license, you can probably approved this package, as I
> have approved the other, thinking having the license text inclued in the
> file header is enough for a script language.

OK

Comment 15 Shawn Iwinski 2014-01-10 18:57:48 UTC
===== MUST items =====
[x]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by: /usr/share/pear/Math(php-pear-
     Math-Stats)
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.

===== SHOULD items =====
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[-]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.

Comment 16 Shawn Iwinski 2014-01-10 18:58:42 UTC
I forgot....


No blockers.

===== APPROVED =====

Comment 17 Adam Williamson 2014-01-10 19:59:48 UTC
New Package SCM Request
=======================
Package Name: php-phpseclib-math-biginteger
Short Description: Pure-PHP arbitrary precision integer arithmetic library
Owners: adamwill
Branches: f20 el6
InitialCC:

Comment 18 Gwyn Ciesla 2014-01-10 20:14:14 UTC
Git done (by process-git-requests).

Comment 19 Adam Williamson 2014-01-14 19:47:54 UTC
Building for Rawhide. http://koji.fedoraproject.org/koji/taskinfo?taskID=6405059

Comment 20 Adam Williamson 2014-02-24 03:22:21 UTC
Package Change Request
======================
Package Name: php-phpseclib-math-biginteger
New Branches: f19 epel7

Comment 21 Gwyn Ciesla 2014-02-24 13:19:17 UTC
No owners specified.

Comment 22 Adam Williamson 2014-02-25 18:24:09 UTC
Package Change Request
======================
Package Name: php-phpseclib-math-biginteger
New Branches: f19 epel7
Owners: adamwill

Comment 23 Gwyn Ciesla 2014-02-25 18:47:10 UTC
Git done (by process-git-requests).


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