Bug 606720 - Review Request: maven-shade-plugin - This plugin provides the capability to package the artifact in an uber-jar
Summary: Review Request: maven-shade-plugin - This plugin provides the capability to p...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Victor G. Vasilyev
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-22 10:08 UTC by Stanislav Ochotnicky
Modified: 2010-07-13 08:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-13 08:41:33 UTC
Type: ---
Embargoed:
victor.vasilyev: fedora-review+
kevin: fedora-cvs+


Attachments (Terms of Use)

Description Stanislav Ochotnicky 2010-06-22 10:08:11 UTC
Spec URL: <spec info here>
SRPM URL: <srpm info here>
Description: <description here>

Comment 1 Stanislav Ochotnicky 2010-06-22 10:13:03 UTC
Hit enter accidentaly before. Proper URLs:

Spec URL: http://sochotni.fedorapeople.org/maven-shade-plugin.spec
SRPM URL: http://sochotni.fedorapeople.org/maven-shade-plugin-1.3.3-1.fc13.src.rpm

Description: 
This plugin provides the capability to package the artifact in an
uber-jar, including its dependencies and to shade - i.e. rename - the
packages of some of the dependencies.

Koji scratchbuild (dist-f14-maven221 target):
https://koji.fedoraproject.org/koji/taskinfo?taskID=2264615

Comment 2 Orion Poplawski 2010-06-28 16:06:37 UTC
Hasn't this already been packaged as maven2-plugin-shade?  Bug 519051.

Comment 3 Stanislav Ochotnicky 2010-06-28 16:17:25 UTC
I guess you could call this a "rename". See this part of spec file:
> Obsoletes: maven2-plugin-shade <= 0:2.0.8
> Provides: maven2-plugin-shade = 1:%{version}-%{release}

Maven2 has been split into several packages in dist-f14-maven221 and each maven plugin is now packaged separately.

Comment 4 Victor G. Vasilyev 2010-07-07 13:25:15 UTC
Stanislav,

According to 
https://fedoraproject.org/wiki/Package_Review_Process#Reviewer
I've completed informal review:

1. All binaries files that are contained in the upstream sources should be removed at the %prep section of the spec to be sure that they are not used to build the target software.
Both the svn repo of the project, and, consequently, its archive (maven-shade-plugin-1.3.3.tar.xz) contain JAR files, i.e binaries files.

2. The section %description javadoc:
NOW: 
This plugin provides the capability to package the artifact in an uber-jar.
SHOULD BE:
This package contains the API documentation for maven-shade-plugin.

You would use a pattern from the guidelines:
%description javadoc
This package contains the API documentation for %{name}.

3. Minor issue: Seems the macro style is used in the spec file. 
Hence, the following macros would also be used:
%__rm ...
%__cp ...
%__ln_s ...
%__mkdir_p ... # if any

This is minor issue, and its fixing is up to you.

4. The https://fedoraproject.org/wiki/Packaging:Java#maven_2 recommends to make $MAVEN_REPO_LOCAL directory if it is declared and used in a spec file, i.e.

%__mkdir_p $MAVEN_REPO_LOCAL 

But, the spec doesn't do it.

5. Q: Should we declare and export the environment variable MAVEN_REPO_LOCAL at all? Seems it is used locally in %build section of the spec file only. If so then, probably, will be better to use a macros like this:

%global maven_repo_local %{_builddir}/%{name}-%{version}/.m2/repository

6. Q: I tried to build this package on my Fedora box, but I've not found some required packages in rawhide. What is wrong?

# yum --disablerepo=* --enablerepo=rawhide install  maven-enforcer-plugin maven-install-plugin maven-compiler-plugin maven-plugin-plugin  maven-resources-plugin maven-surefire-provider-junit  maven-jar-plugin  maven-javadoc-plugin  maven-shared-plugin-testing-harness
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
No package maven-enforcer-plugin available.
No package maven-install-plugin available.
No package maven-compiler-plugin available.
No package maven-plugin-plugin available.
No package maven-resources-plugin available.
No package maven-jar-plugin available.
No package maven-javadoc-plugin available.
...

7. The https://fedoraproject.org/wiki/Packaging:Java#maven_2 recommends to have:
BuildRequires:  jpackage-utils

8. Seems, if OpenJDK is used to build software, i.e.
BuildRequires: java-devel >= 1:1.6.0
then we always need explicitly specify version in the run-time requirement for java to avoid problems with versions of both Java classes (i.e. 50.0) and Java API installed on a system (i.e. 6.0):
Requires: java >= 1:1.6.0

9. Q: Why the version 0:2.0.8 is used in the tag:
Obsoletes: maven2-plugin-shade <= 0:2.0.8
?
I've found only a package
Name       : maven2-plugin-shade
Arch       : noarch
Version    : 1.2.2
Release    : 2.fc13

Comment 5 Stanislav Ochotnicky 2010-07-08 11:57:38 UTC
First: Thanks for great (albeit unofficial) review so far. 

1. jar files present in the tarball are used for testing. Notable exception was plexus-util that I replaced with symlink to our own plexus-util (fixed in this version) Rest of the jars are not installed they are just small test cases. 

2. Hmmm, perhaps you misread the spec file? This is what I see in mine:
%package javadoc
Group:          Documentation
Summary:        API documentation for %{name}
Requires:       jpackage-utils

%description javadoc
%{summary}.

3. I actually didn't use macro commands anywhere in the spec file AFAIK. I prefer it this way. I don't see a reason to use %__mkdir_p when "mkdir -p" behaves consistently across all implementations I know of...

4. I didn't create that dir, because maven creates it itself if it doesn't exist. But you're right...it's better to create it.

5. Exactly because MAVEN_REPO_LOCAL is not used anywhere besides %build section, defining %global seems too much. Maybe replacing with local %define in %build section, but still...it's a question of style and this seems like the most common style used in Fedora spec files.

6. I am sorry I didn't warn in advance...this package was prepared only for dist-f14-maven221 tag, Currently it builds fine in rawhide (maven221 tag was merged recently...so maybe that's why it didn't work for you back then). See my build on koji if you want (s)rpms

7. Fixed

8. Fixed

9. This should not be needed, but apparently in the past there were some tools that had problems with unspecified Epochs. Some considered them -1 and some 0. Just to be on the safe side, Epoch 0 was used. This is just a precaution, but doesn't actually affect anything else beside upgrades from older maven.

Koji build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2304028

Spec file: http://sochotni.fedorapeople.org/maven-shade-plugin.spec
SRPM: http://sochotni.fedorapeople.org/maven-shade-plugin-1.3.3-2.fc13.src.rpm

Comment 6 Victor G. Vasilyev 2010-07-08 14:23:12 UTC
(In reply to comment #5)
> 1. jar files present in the tarball are used for testing. Notable exception was
> plexus-util that I replaced with symlink to our own plexus-util (fixed in this
> version) Rest of the jars are not installed they are just small test cases. 
OK

> 2. Hmmm, perhaps you misread the spec file? 
Sorry. I had wrong substitution of %{summary} that I've done in my mind. Unfortunately, koji  was not accessible to me yesterday for unknown reason, and I wasn't able to check my assumption.  

> 3. I actually didn't use macro commands anywhere in the spec file AFAIK. 
OK

> 4. I didn't create that dir, because maven creates it itself if it doesn't
> exist. But you're right...it's better to create it.
OK

> 5. Exactly because MAVEN_REPO_LOCAL is not used anywhere besides %build
> section, defining %global seems too much. 
> Maybe replacing with local %define in
> %build section, but still...it's a question of style and this seems like the
> most common style used in Fedora spec files.
OK
I only try to find a most common pattern for maven command for using it later in the spec files. E.g. I see that in many spec files we should:
- define location of a local repo. Usually, it is
  %{_builddir}/%{name}-%{version}/.m2/repository
- create a directory for the local repo
- start mvn-jpp with the option -Dmaven.repo.local=<location of a local repo>
 
> 6. I am sorry I didn't warn in advance...this package was prepared only for
> dist-f14-maven221 tag, Currently it builds fine in rawhide (maven221 tag was
> merged recently...so maybe that's why it didn't work for you back then). 
> See my build on koji if you want (s)rpms
OK

> 7. Fixed
OK

> 8. Fixed
OK

> 9. This should not be needed, but apparently in the past there were some tools
> that had problems with unspecified Epochs. Some considered them -1 and some 0.
> Just to be on the safe side, Epoch 0 was used. This is just a precaution, but
> doesn't actually affect anything else beside upgrades from older maven.
OK

Since all issues are resolved I'll start formal review.

Comment 7 Victor G. Vasilyev 2010-07-08 15:39:17 UTC
*  MUST: rpmlint must be run on every package. The output should be posted in the review.
$ rpmlint maven-shade-plugin*-1.3.3-2.fc14.*.rpm

maven-shade-plugin.noarch: W: spelling-error Summary(en_US) uber -> tuber, cuber, umber
maven-shade-plugin.noarch: W: spelling-error %description -l en_US uber -> tuber, cuber, umber
maven-shade-plugin.src: W: spelling-error Summary(en_US) uber -> tuber, cuber, umber
maven-shade-plugin.src: W: spelling-error %description -l en_US uber -> tuber, cuber, umber
maven-shade-plugin.noarch: W: no-documentation
maven-shade-plugin.noarch: W: non-conffile-in-etc /etc/maven/fragments/maven-shade-plugin
maven-shade-plugin.src: W: invalid-url Source0: maven-shade-plugin-1.3.3.tar.xz
3 packages and 0 specfiles checked; 0 errors, 7 warnings.
OK
* MUST: The package must be named according to the Package Naming Guidelines.
OK
* MUST: The spec file name must match the base package %{name}, in the format %{name}.spec unless your package has an exemption.
OK
* MUST: The package must meet the Packaging Guidelines.
OK
* MUST: The package must be licensed with a Fedora approved license and meet the Licensing Guidelines.
OK ASL2.0
* MUST: The License field in the package spec file must match the actual license.
OK http://maven.apache.org/plugins/maven-shade-plugin/license.html
* 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 must be included in %doc.
OK
* MUST: The spec file must be written in American English.
OK 
The German word "uber" is used in the upstream project.
* MUST: The spec file for the package MUST be legible.
OK
* MUST: The sources used to build the package must match the upstream source, as provided in the spec URL. Reviewers should use md5sum for this task. If no upstream URL can be specified for this package, please see the Source URL Guidelines for how to deal with this.
OK svn repo is used
* MUST: The package MUST successfully compile and build into binary rpms on at least one primary architecture.
OK http://koji.fedoraproject.org/koji/taskinfo?taskID=2304028
* MUST: If the package does not successfully compile, build or work on an architecture, then those architectures should be listed in the spec in ExcludeArch. Each architecture listed in ExcludeArch MUST have a bug filed in bugzilla, describing the reason that the package does not compile/build/work on that architecture. The bug number MUST be placed in a comment, next to the corresponding ExcludeArch line.
N/A  noarch
* MUST: All build dependencies must be listed in BuildRequires, except for any that are listed in the exceptions section of the Packaging Guidelines ; inclusion of those as BuildRequires is optional. Apply common sense.
OK
* MUST: The spec file MUST handle locales properly. This is done by using the %find_lang macro. Using %{_datadir}/locale/* is strictly forbidden.
N/A
* MUST: Every binary RPM package (or subpackage) which stores shared library files (not just symlinks) in any of the dynamic linker's default paths, must call ldconfig in %post and %postun. [10]
N/A
* MUST: Packages must NOT bundle copies of system libraries.
OK
* MUST: If the package is designed to be relocatable, the packager must state this fact in the request for review, along with the rationalization for relocation of that specific package. Without this, use of Prefix: /usr is considered a blocker.
N/A not a relocatable package
* MUST: A package must own all directories that it creates. If it does not create a directory that it uses, then it should require a package which does create that directory.
OK
* MUST: A Fedora package must not list a file more than once in the spec file's %files listings.
OK
* MUST: Permissions on files must be set properly. Executables should be set with executable permissions, for example. Every %files section must include a %defattr(...) line.
OK
* MUST: Each package must consistently use macros.
OK
* MUST: The package must contain code, or permissable content.
OK
* MUST: Large documentation files must go in a -doc subpackage. (The definition of large is left up to the packager's best judgement, but is not restricted to size. Large can refer to either size or quantity).
N/A
* MUST: If a package includes something as %doc, it must not affect the runtime of the application. To summarize: If it is in %doc, the program must run properly if it is not present.
N/A
* MUST: Header files must be in a -devel package.
N/A
* MUST: Static libraries must be in a -static package.
N/A
* MUST: If a package contains library files with a suffix (e.g. libfoo.so.1.1), then library files that end in .so (without suffix) must go in a -devel package.
N/A
* MUST: In the vast majority of cases, devel packages must require the base package using a fully versioned dependency: Requires: %{name} = %{version}-%{release}
N/A
* MUST: Packages must NOT contain any .la libtool archives, these must be removed in the spec if they are built.
OK
* MUST: Packages containing GUI applications must include a %{name}.desktop file, and that file must be properly installed with desktop-file-install in the %install section. If you feel that your packaged GUI application does not need a .desktop file, you must put a comment in the spec file with your explanation.
N/A
* MUST: Packages must not own files or directories already owned by other packages. The rule of thumb here is that the first package to be installed should own the files or directories that other packages may rely upon. This means, for example, that no package in Fedora should ever share ownership with any of the files or directories owned by the filesystem or man package. If you feel that you have a good reason to own a file or directory that another package owns, then please present that at package review time.
OK
* MUST: All filenames in rpm packages must be valid UTF-8.
OK

#  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.
OK the packager will be notified below.
# SHOULD: The description and summary sections in the package spec file should contain translations for supported Non-English languages, if available.
OK it is not required for the maven plugin
# SHOULD: The reviewer should test that the package builds in mock.
OK there is koji build
# SHOULD: The package should compile and build into binary rpms on all supported architectures.
OK noarch
# SHOULD: The reviewer should test that the package functions as described. A package should not segfault instead of running, for example.
OK
# SHOULD: If scriptlets are used, those scriptlets must be sane. This is vague, and left up to the reviewers judgement to determine sanity.
OK
# SHOULD: Usually, subpackages other than devel should require the base package using a fully versioned dependency.
OK *-javadoc doesn't require the base package
# SHOULD: The placement of pkgconfig(.pc) files depends on their usecase, and this is usually for development purposes, so should be placed in a -devel pkg. A reasonable exception is that the main pkg itself is a devel tool not installed in a user runtime, e.g. gcc or gdb.
N/A
# SHOULD: If the package has file dependencies outside of /etc, /bin, /sbin, /usr/bin, or /usr/sbin consider requiring the package which provides the file instead of the file itself.
N/A
# SHOULD: your package should contain man pages for binaries/scripts. If it doesn't, work with upstream to add them where they make sense.
N/A no binaries/scripts in the package

Stanislav, formal review against the package is completed. 
There are no any issues.
The package is GOOD.

Only one extra action is required from your side:
Please, query upstream to include the license text as a separate file into svn repo.

Comment 8 Stanislav Ochotnicky 2010-07-09 07:04:36 UTC
Thank you for great review. I'll get in touch with upstream about that license...

Requesting CVS:
New Package CVS Request
=======================
Package Name: maven-shade-plugin
Short Description: Plugin provides the capability to package the artifact in an uber-jar
Owners: 
Branches: 
InitialCC:

Comment 9 Kevin Fenzi 2010-07-09 18:18:12 UTC
Can you add owners to the request and reset the fedora-cvs flag to ?

Comment 10 Stanislav Ochotnicky 2010-07-12 07:05:05 UTC
(In reply to comment #9)
> Can you add owners to the request and reset the fedora-cvs flag to ?    

Sure. I forgot to add myself :-)

New Package CVS Request
=======================
Package Name: maven-shade-plugin
Short Description: Plugin provides the capability to package the artifact in an
uber-jar
Owners: sochotni
Branches: 
InitialCC:

Comment 11 Kevin Fenzi 2010-07-12 17:19:42 UTC
CVS done (by process-cvs-requests.py).

Comment 12 Stanislav Ochotnicky 2010-07-13 08:41:33 UTC
Koji build:
https://koji.fedoraproject.org/koji/buildinfo?buildID=183369

Thanks all, closing.


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