Bug 1666493

Summary: Review Request: OpenLiberty - Server runtime for Java Developers
Product: [Fedora] Fedora Reporter: Michael.Zhang
Component: Package ReviewAssignee: Nobody's working on this, feel free to take it <nobody>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: fschwarz, hiwkby, package-review, zebob.m
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-10 00:58:40 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:    
Bug Blocks: 177841, 201449    
Attachments:
Description Flags
Updated spec file
none
Updated spec file v2 none

Description Michael.Zhang 2019-01-15 19:50:39 UTC
Spec URL: https://app.box.com/s/9pd6nx4cxsu29r5i41kn3g33x5278nsy
SRPM URL: https://app.box.com/s/hg2zdfcf83j2vlvhrkhes8jsy6y06oag
Description: Open Liberty provides developers with proven Java EE 8 technology and the latest Eclipse MicroProfile™ capabilities for building microservices.
Fedora Account System Username: zhangm13 - Michael.Zhang

This will be my first package on Fedora. I am currently looking for a sponsor to help me package this in the next month.

Comment 1 Michael.Zhang 2019-01-21 15:57:03 UTC
Hi, I've modified the link to the srpm and I've attached the spec file to the bug request.

Link to srpm - https://app.box.com/v/openliberty-18004-src-rpm

Comment 2 Michael.Zhang 2019-01-21 15:58:18 UTC
Created attachment 1522183 [details]
Updated spec file

Comment 3 Robert-André Mauchin 🐧 2019-02-16 00:02:08 UTC
This package doesn't conform to the the Fedora Packaging Guidelines, you should read them
https://docs.fedoraproject.org/en-US/packaging-guidelines/Java/ 
https://docs.fedoraproject.org/en-US/packaging-guidelines/

 - Not needed:

%define _topdir     /home/travis/build/was-lighthouse/openliberty-rpmdeb/rpmbuild
%define name        openliberty
%define version     18.0.0.4
%define buildroot   %{_topdir}/BUILDROOT/%{name}-root

 - Shouldn't be used:

#%define _rpmfilename %%{NAME}-%%{VERSION}.%%{ARCH}.rpm

AutoProv: no
%undefine __find_provides
AutoReq: no
%undefine __find_requires
# Do not try autogenerate prereq/conflicts/obsoletes and check files
%undefine __check_files
%undefine __find_prereq
%undefine __find_conflicts
%undefine __find_obsoletes
# Be sure buildpolicy set to do nothing - does not randomly compile the python files
%define __spec_install_post %{nil}
# Remove missing file termination
%define _missing_doc_files_terminate_build 0

#BUILDHOST:     IBM Linux Machine
#OS:            linux
#ARCH:          noarch

 - Not needed

BuildRoot:      %{buildroot}
Group:          WAS/Development/Tools
Vendor:         IBM
Packager:       IBM

 - Missing dist tag:

Release:        1%{?dist}

 - Description should be split to be under 80 characters per line

 - The package should not be installed inder /opt

"All architecture-independent JAR files MUST go into %{_javadir} or its subdirectory."

 - You should provide SystemD files, not init.d ones

 - You need to include a changelog entry

 - It is forbidden to ship jar files directly:

https://docs.fedoraproject.org/en-US/packaging-guidelines/Java/#_pre_built_dependencies

https://docs.fedoraproject.org/en-US/packaging-guidelines/what-can-be-packaged/#prebuilt-binaries-or-libraries

Comment 4 Michael.Zhang 2019-02-25 23:04:57 UTC
Created attachment 1538618 [details]
Updated spec file v2

Comment 5 Michael.Zhang 2019-02-25 23:22:01 UTC
Hi,

Made some changes to the spec file as recommended by the Fedora Guidelines.

(1) The package should not be installed inder /opt
   - moved the package installation dir to /usr/share/openliberty

(2) You should provide SystemD files, not init.d ones
   - moved the openliberty script from /etc/init.d/openliberty to /usr/libexec/openliberty and created the relevant service files (under /usr/lib/systemd/system/openliberty@.service) to use SystemD instead of SystemV init.

(3) You need to include a changelog entry
   - created an changelog entry detailing the changes

From your previous comment of:
 - "It is forbidden to ship jar files directly:"

I'm assuming you wish for us to incorporate the jar building process into our travis build process. So there are 2 ways we can go about this:
 
   (1) call rpmbuild - which would then have to call gradle inside to build straight from the source and package as rpm all in 1 rpm command
   (2) call gradle to build the necessary jars then call rpmbuild to package the contents into a rpm

We would much rather prefer the 2nd option as it is easier and more convenient on our end. Note: the Travis Build process and Github Repo will soon be made public.

When running rpmlint on our package, we get the "openliberty.noarch: W: invalid-license EPL-1.0" warning. I believe that the EPL-1.0 (Eclipse Public License 1.0) is under the list of acceptable licenses so why am I seeing this warning?

Comment 6 Michael.Zhang 2019-02-26 03:45:45 UTC
The updated src rpm link is - https://app.box.com/v/openliberty-src-rpm

Comment 7 Felix Schwarz 2019-03-07 20:48:53 UTC
(In reply to Michael.Zhang from comment #5)
> From your previous comment of:
>  - "It is forbidden to ship jar files directly:"
> 
> I'm assuming you wish for us to incorporate the jar building process into
> our travis build process. So there are 2 ways we can go about this:
>  
>    (1) call rpmbuild - which would then have to call gradle inside to build
> straight from the source and package as rpm all in 1 rpm command
>    (2) call gradle to build the necessary jars then call rpmbuild to package
> the contents into a rpm
> 
> We would much rather prefer the 2nd option as it is easier and more
> convenient on our end.

Not sure if I understood you correctly but Fedora's build process can not use pre-built binaries (even if you build them transparently on Travis). The full build process (including *all* dependencies) must be in Fedora. All sources must be included in your source rpm (or rpm dependencies) you must not download anything from the internet during your builds.

(And you judging from the size of the OpenLiberty download packaging it for Fedora will be quite a bit of work.)

Comment 8 Hirotaka Wakabayashi 2019-05-11 07:21:09 UTC
Hello Michael,

I found openliberty-19.0.0.1.tar.gz, which should contains source code(java
files), contains jar files. The guideline says jar files from upstream 
releases MUST NOT be used during build of Fedora packages.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Java/#_pre_built_dependencies

I understand the basic process to build source files is:
1) prepare in the %prep section
2) build source files in the %build section
3) install the compile files to the the buildroot

Therefor you should use the %prep section to uncompress openliberty-19.0.0.1.tar.gz,
which contains java files, and extract the contents into the build directory.
You can use the %setup macro. For example,
```
%prep
%setup
```
See http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html for details.

Then you should use the %build section to compile java files in the build
directory. For example,
```
%build
make {?_smp_flags}
```

Finally you should use the %install section to install the jar files. For
example,
```
%install
install -p -m 644 foo.jar %{buildroot}%{_javadir}/foo.jar
```

Java Packaging HOWTO must help you very much. It shows many examples and
is very easy to understand for me. 
https://fedora-java.github.io/howto/latest/

After you make your source rpm file, you can check it by using Koji.
See https://fedoraproject.org/wiki/Using_the_Koji_build_system for details.

Here is the current Koji scratch build result:
https://koji.fedoraproject.org/koji/taskinfo?taskID=34779979

Error messages says:
```
error: Bad file:
 /home/travis/build/was-lighthouse/openliberty-rpmdeb/rpmbuild/SOURCES/openliberty-19.0.0.1.tar.gz: No such file or directory
```

The /home/travis/build/was-lighthouse/openliberty-rpmdeb/rpmbuild directory may
exist in your local development environment. However you should not assume the
directory is present anywhere.

Best Regards,
Hirotaka Wakabayashi

Comment 9 Package Review 2020-07-10 00:57:02 UTC
This is an automatic check from review-stats script.

This review request ticket hasn't been updated for some time. We're sorry
it is taking so long. If you're still interested in packaging this software
into Fedora repositories, please respond to this comment clearing the
NEEDINFO flag.

You may want to update the specfile and the src.rpm to the latest version
available and to propose a review swap on Fedora devel mailing list to increase
chances to have your package reviewed. If this is your first package and you
need a sponsor, you may want to post some informal reviews. Read more at
https://fedoraproject.org/wiki/How_to_get_sponsored_into_the_packager_group.

Without any reply, this request will shortly be considered abandoned
and will be closed.
Thank you for your patience.

Comment 10 Package Review 2020-08-10 00:58:40 UTC
This is an automatic action taken by review-stats script.

The ticket submitter failed to clear the NEEDINFO flag in a month.
As per https://fedoraproject.org/wiki/Policy_for_stalled_package_reviews
we consider this ticket as DEADREVIEW and proceed to close it.