Bug 1024589

Summary: Review Request: js-zlib - JavaScript library reimplementing compression
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: Package ReviewAssignee: Tom Hughes <tom>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jamielinux, manisandro, mrunge, package-review, tom
Target Milestone: ---Flags: tom: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-18 14:07:25 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:
Bug Depends On: 1023848    
Bug Blocks: 1077322    

Description Zbigniew Jędrzejewski-Szmek 2013-10-30 03:08:47 UTC
Spec URL: http://in.waw.pl/~zbyszek/fedora/zlib-js.spec
SRPM URL: http://in.waw.pl/~zbyszek/fedora/zlib-js-0.1.7-1.fc19.src.rpm
Description:
zlib.js is ZLIB(RFC1950), DEFLATE(RFC1951), GZIP(RFC1952), and
PKZIP implementation in JavaScript. This library can be used to
perform compression and decompression in the browser.

Fedora Account System Username: zbyszek

I'm totally out of my depth here, I know nothing about node.js, just cargo-culting from other packages. I'd very happy if somebody more knowledgeable could check the overall approach.

Comment 1 Sandro Mani 2014-02-10 11:41:34 UTC
Uh sorry was a bit too quick, I'd rather leave node.js to someone else :S

Comment 2 Tom Hughes 2014-02-23 15:40:21 UTC
First things first, latest upstream release is 0.2.0 so this needs updating to that.

Next, and before I do a full review, I think we need to establish what rules we are working to here. There are two packages which come out of this:

* The pure javascript one, which needs to comply with the javascript guidelines (so should install in %{_jsdir} not %{_webassetdir}) and should be called js-zlib-js I think. That is rather ugly I admit but it seems to be the logical consequence of the naming rules...

* The node package, which needs to comply with the node guidelines, and should be called nodejs-zlibjs (note the node module has no dot in the name per https://www.npmjs.org/package/zlibjs).

What I'm not sure about is whether it is best to package this from git as you have done, or from the NPM registry as the node guidelines would normally require.

That also goes to the question of what the source rpm should be called...

Comment 3 Jamie Nguyen 2014-03-13 15:03:30 UTC
I don't mean to barge in uninvited, but here is my take on the package. Feel free to ignore my Spec. (There are also lots of whitespace changes, sorry.)

NB: This is unlikely to be available on anything other than F21 and above. closure-compiler requires guava. F20 has too old a version of guava, and EL6 is missing several BuildRequires for guava. Since this is part of the long and winding jQuery dependency tree, we won't see jQuery in F20/F19/EL6 unless some magic happens.

I decided to package from NPM as it contains everything we need. I also decided to maintain the names and locations of files in the upstream software to avoid end-user confusion.

Having recently introduced a package called js-json, containing the most popular(?) json JS library, I thought the most appropriate name would be js-zlib, containing the most popular(?) zlib library.


Spec URL: http://jamielinux.fedorapeople.org/gruntjs/js-zlib.spec
SRPM URL: http://jamielinux.fedorapeople.org/gruntjs/SRPMS/js-zlib-0.2.0-1.fc21.src.rpm

* Thu Mar 13 2014 Jamie Nguyen <jamielinux> - 0.2.0-1
- update to upstream release 0.2.0
- rename to js-zlib and nodejs-zlibjs
- install to {_jsdir}
- maintain filenames and locations that upstream are using
- use patch instead of sed
- include additional documentation in nodejs-zlibjs package

Comment 4 Jamie Nguyen 2014-03-14 10:18:20 UTC
Spec URL: http://jamielinux.fedorapeople.org/gruntjs/js-zlib.spec
SRPM URL: http://jamielinux.fedorapeople.org/gruntjs/SRPMS/js-zlib-0.2.0-2.fc21.src.rpm

* Fri Mar 14 2014 Jamie Nguyen <jamielinux> - 0.2.0-2
- add missing BuildArch: noarch
- nodejs-zlibjs should only be built for {nodejs_arches} but js-zlib package
  does not have this limitation, so add logic for building nodejs-zlibjs only
  on {nodejs_arches} while allowing js-zlib to be built on all architectures
- add logic for building on EPEL 6


OK so if you think this looks like one big hack... well it is. But it works! Until there is some other solution, this will do. Any arches that get added to the %{nodejs_arches} macro will have to be manually added to this Spec.

From the Spec:
The following longwinded conditionals are required because both js-zlib and nodejs-zlibjs are 'BuildArch: noarch', but the nodejs-zlibjs package is additionally restricted to 'ExclusiveArch: {nodejs_arches} noarch' (while still remaining a noarch package). We want to build js-zlib on all arches, but unfortunately the 'ifarch' conditional cannot be combined with 'BuildArch: noarch'. This rules out the use of 'ifarch {nodejs_arches}' and we instead have to match {_arch} with each architecture we want to include.

Comment 5 Zbigniew Jędrzejewski-Szmek 2014-03-17 07:52:58 UTC
Tom, sorry for the slow response. I think that the naming proposed by Jamie is OK: nodejs-zlibjs and js-zlib. The tarball is called zlibjs, so even upstream seems to skip the dot.

Jamie, thank you for the updated spec file. It seems much better than my version. I made two changes though:
- I reverted your replacement of sed with patch, since the patch seems very fragile and will probably have to be updated quite often when upstream changes the ant file
- I simplified the arch condition using grep
May I add you as a co-maintainer?

Spec URL: http://in.waw.pl/~zbyszek/fedora/zlib-js.spec
SRPM URL: http://in.waw.pl/~zbyszek/fedora/zlib-js-0.2.0-3.fc20.src.rpm

Comment 6 Zbigniew Jędrzejewski-Szmek 2014-03-17 07:54:30 UTC
Argh, wrong url:

Spec URL: http://in.waw.pl/~zbyszek/fedora/js-zlib.spec
SRPM URL: http://in.waw.pl/~zbyszek/fedora/js-zlib-0.2.0-3.fc20.src.rpm

Comment 7 Jamie Nguyen 2014-03-17 18:07:31 UTC
To paraphrase a discussion with T.C. via email:
What I thought was a working solution turns out to be not really working at all. %{_arch} is the build host architecture not the target architecture, so if an EPEL package is sent to a x86_64 builder then the nodejs-zlibjs subpackage will be unconditionally present even in PPC repositories. And conversely, if the package is sent to a PPC builder then the nodejs-zlibjs subpackage will be unconditionally absent even in x86_64 repositories. The only solution with our current buildsystem appears to be to make the package arched (remove BuildArch: noarch, and use %ifarch for the subpackage).

I suggested instead that we split them into two completely separate packages and symlink js-zlib/node-zlib.js to the nodejs-zlibjs package. This would allow:
 - js-zlib to remain completely free of architecture restrictions
 - nodejs-zlibjs to be restricted to %{nodejs_arches}
 - both packages to remain noarch

I have confirmed by running the test suite that the new nodejs-zlibjs package works as intended with the symlink.

Review Request: nodejs-zlibjs
https://bugzilla.redhat.com/show_bug.cgi?id=1077322

Spec URL: http://jamielinux.fedorapeople.org/gruntjs/js-zlib.spec
SRPM URL: http://jamielinux.fedorapeople.org/gruntjs/SRPMS/js-zlib-0.2.0-4.fc21.src.rpm

* Mon Mar 17 2014 Jamie Nguyen <jamielinux> - 0.2.0-4
- As it turns out, matching {_arch} won't solve our problem as it indicates
  the architecture of the build host not the target architecture. Instead
  split nodejs-zlibjs into a separate package, as otherwise js-zlib would be
  restricted to {nodejs_arches}. bin/node-zlib.js will remain in the js-zlib
  package, while nodejs-zlibjs will depend on js-zlib and have a symlink.
- add logic for building on EPEL 6

Comment 8 Jamie Nguyen 2014-03-17 18:09:47 UTC
(And in case it wasn't obvious, the symlink is so that we aren't building the same source twice, which would seem less than ideal.)

Comment 9 Tom Hughes 2014-03-17 20:16:47 UTC
Package Review
==============

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


Issues
======

[!]: Rpmlint is run on all installed packages.

js-zlib.noarch: W: spelling-error Summary(en_US) reimplementing -> re implementing, re-implementing, implementing
js-zlib.src: W: spelling-error Summary(en_US) reimplementing -> re implementing, re-implementing, implementing


===== 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:
     "Apache (v2.0)", "Unknown or generated". 4 files have unknown license.
     Detailed output of licensecheck in /home/tom/1024589-js-
     zlib/licensecheck.txt
[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).
[ ]: 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]: 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 4 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 %doc.
[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]: 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 do not use a name that already exist
[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:
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[-]: 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).
[?]: Package functions as described.
[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.
[?]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Sources can be downloaded from URI in Source: tag
[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]: Dist tag is present (not strictly required in GL).
[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:
[!]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: js-zlib-0.2.0-4.fc21.noarch.rpm
          js-zlib-0.2.0-4.fc21.src.rpm
js-zlib.noarch: W: spelling-error Summary(en_US) reimplementing -> re implementing, re-implementing, implementing
js-zlib.src: W: spelling-error Summary(en_US) reimplementing -> re implementing, re-implementing, implementing
2 packages and 0 specfiles checked; 0 errors, 2 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint js-zlib
js-zlib.noarch: W: spelling-error Summary(en_US) reimplementing -> re implementing, re-implementing, implementing
1 packages and 0 specfiles checked; 0 errors, 1 warnings.
# echo 'rpmlint-done:'



Requires
--------
js-zlib (rpmlib, GLIBC filtered):
    web-assets-filesystem



Provides
--------
js-zlib:
    js-zlib



Source checksums
----------------
http://registry.npmjs.org/zlibjs/-/zlibjs-0.2.0.tgz :
  CHECKSUM(SHA256) this package     : bdfe87c7d2aa03b7afd7ba219aa0592edde464863e311e40e04b8ed987f827a0
  CHECKSUM(SHA256) upstream package : bdfe87c7d2aa03b7afd7ba219aa0592edde464863e311e40e04b8ed987f827a0


Generated by fedora-review 0.5.1 (bb9bf27) last change: 2013-12-13
Command line :/usr/bin/fedora-review -m compton-rawhide-x86_64 -b 1024589
Buildroot used: compton-rawhide-x86_64
Active plugins: Generic, Shell-api
Disabled plugins: Java, C/C++, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP, Ruby
Disabled flags: EXARCH, EPEL5, BATCH, DISTTAG

Comment 10 Tom Hughes 2014-03-17 20:18:28 UTC
Other than the rpmlint warning, my other question is whether we should be packaging the .map files?

Comment 11 Jamie Nguyen 2014-03-17 21:57:16 UTC
Hmmm. They would be useful to have. I'm not sure what the guidelines would say about having the *.map in jsdir along with the rest of the minified javascript, but since they are useful in the web browser then I think it makes sense to put them in jsdir.

Spec URL: http://jamielinux.fedorapeople.org/gruntjs/js-zlib.spec
SRPM URL: http://jamielinux.fedorapeople.org/gruntjs/SRPMS/js-zlib-0.2.0-5.fc21.src.rpm

* Mon Mar 17 2014 Jamie Nguyen <jamielinux> - 0.2.0-5
- also include .map files

Comment 12 Zbigniew Jędrzejewski-Szmek 2014-03-18 00:02:21 UTC
Package looks OK.

The rpmlint warning is bogus: "reimplemented" is what is commonly used, and "re-implemented" looks foreign.

Comment 13 Tom Hughes 2014-03-18 10:54:44 UTC
Looks good now then. Package approved.

Comment 14 Jamie Nguyen 2014-03-18 10:58:05 UTC
New Package SCM Request
=======================
Package Name: zlib-js
Short Description: JavaScript library reimplementing compression
Owners: jamielinux zbyszek
Branches: f19 f20 el6 epel7
InitialCC:

Comment 15 Jamie Nguyen 2014-03-18 11:00:44 UTC
New Package SCM Request
=======================
Package Name: zlib-js
Short Description: JavaScript library reimplementing compression
Owners: jamielinux zbyszek patches
Branches: f19 f20 el6 epel7
InitialCC:

Comment 16 Jamie Nguyen 2014-03-18 11:03:56 UTC
New Package SCM Request
=======================
Package Name: zlib-js
Short Description: JavaScript library reimplementing compression
Owners: jamielinux zbyszek patches
Branches:
InitialCC:

Comment 17 Gwyn Ciesla 2014-03-18 11:49:51 UTC
Requested package name zlib-js doesn't match bug summary js-zlib, please
correct.

Comment 18 Zbigniew Jędrzejewski-Szmek 2014-03-18 12:46:31 UTC
New Package SCM Request
=======================
Package Name: js-zlib
Short Description: JavaScript library reimplementing compression
Owners: jamielinux zbyszek patches
Branches:
InitialCC:

Comment 19 Gwyn Ciesla 2014-03-18 12:55:32 UTC
Git done (by process-git-requests).

Comment 20 Zbigniew Jędrzejewski-Szmek 2014-03-18 14:07:25 UTC
Built for rawhide: http://koji.fedoraproject.org/koji/buildinfo?buildID=505192.