Difference between revisions of "Foreign Packaging"

From JogampWiki
Jump to navigation Jump to search
(Platform dependent tools)
(Redline with Maven)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
We assume that the application is packaged as a [https://jogamp.org/wiki/index.php/JogAmp_JAR_File_Handling#Fat-Jar fat JAR] called "user-app.jar" for the sake of simplicity.
+
'''N.B: This article is subject to changes and is incomplete.'''
 +
 
 +
We assume that the application is packaged as a [http://jogamp.org/wiki/index.php/JogAmp_JAR_File_Handling#Fat-Jar fat JAR] called "user-app.jar" for the sake of simplicity.
  
 
= Red Hat Package Manager =
 
= Red Hat Package Manager =
Line 22: Line 24:
 
[http://redline-rpm.org Redline RPM] is a pure Java library for manipulating RPM packages. It can be use in command line, with [http://ant.apache.org Ant] and with [http://maven.apache.org Maven].
 
[http://redline-rpm.org Redline RPM] is a pure Java library for manipulating RPM packages. It can be use in command line, with [http://ant.apache.org Ant] and with [http://maven.apache.org Maven].
  
Redline requires [http://commons.apache.org/proper/commons-compress/download_compress.cgi Apache Commons Compress], [http://www.bouncycastle.org/latest_releases.html Bounty Castle] and [http://www.slf4j.org/download.html SLF4J].
+
Redline requires [http://commons.apache.org/proper/commons-compress/download_compress.cgi Apache Commons Compress], [http://www.bouncycastle.org/latest_releases.html Bounty Castle], [http://www.slf4j.org/download.html SLF4J] and [http://repo1.maven.org/maven2/org/tukaani/xz/1.4/ XZ].
  
 +
==== Redline with Ant ====
 
Using a distinct name space or a different task name for the Redline RPM task is necessary to avoid any conflict with the build-in Ant [http://ant.apache.org/manual/Tasks/rpm.html RPM task]:
 
Using a distinct name space or a different task name for the Redline RPM task is necessary to avoid any conflict with the build-in Ant [http://ant.apache.org/manual/Tasks/rpm.html RPM task]:
  
Line 33: Line 36:
 
             <pathelement path="slf4j-api-1.7.7.jar"/>
 
             <pathelement path="slf4j-api-1.7.7.jar"/>
 
             <pathelement path="slf4j-simple-1.7.7.jar"/>
 
             <pathelement path="slf4j-simple-1.7.7.jar"/>
 +
            <pathelement path="xz-1.4.jar"/>
 
             <pathelement path="redline-1.1.16.jar"/>
 
             <pathelement path="redline-1.1.16.jar"/>
 
         </classpath>
 
         </classpath>
Line 47: Line 51:
  
 
The created RPM will use the JRE installed on the operating system.
 
The created RPM will use the JRE installed on the operating system.
 +
 +
==== Redline with Maven ====
 +
[http://ronanquillevere.github.io/2015/06/18/redline-rpm-generation.html This tutorial] explains how to use Redline with Maven.
  
 
= Debian Package Manager =
 
= Debian Package Manager =
  
[https://wiki.debian.org/Teams/Dpkg Dpkg] (Debian packager) is the default management system under Debian, Ubuntu, Knoppix, Mint, ...
+
[http://wiki.debian.org/Teams/Dpkg Dpkg] (Debian packager) is the default management system under Debian, Ubuntu, Knoppix, Mint, ...
  
 
== Platform dependent tools ==
 
== Platform dependent tools ==
  
 
The following tools only work under GNU Linux or other Unix platforms with native deb support.
 
The following tools only work under GNU Linux or other Unix platforms with native deb support.
 +
 +
[http://manpages.ubuntu.com/manpages/lucid/fr/man1/dpkg-buildpackage.1.htmldpkg-buildpackage dpkg-buildpackage] can be used to build DEBs. You can find more information about DEB packaging in the [http://wiki.debian.org/Packaging official documentation].
 +
 +
The build system [http://maven.apache.org Maven] can call this command when you use its [http://debian-maven.sourceforge.net Debian Maven plugin].
  
 
== Cross-platform tools ==
 
== Cross-platform tools ==
  
 
=== Jpkg ===
 
=== Jpkg ===
 +
 +
[http://leplastrier.com/projects/jpkg/ Jpkg] is a pure Java library for manipulating DEB packages. It provides an Ant task. You can find an example of use in its [http://github.com/leplastrier/jpkg-library/blob/master/README.md readme file].
  
 
=== JDeb ===
 
=== JDeb ===
 +
 +
[http://github.com/tcurdt/jdeb JDeb] is a pure Java library for manipulating DEB packages. It can be use in command line, with [http://ant.apache.org Ant] and with [http://maven.apache.org Maven].
 +
 +
JDeb requires [http://commons.apache.org/proper/commons-compress/download_compress.cgi Apache Commons Compress], [http://www.bouncycastle.org/latest_releases.html Bounty Castle] and [http://commons.apache.org/proper/commons-io/download_io.cgi Apache Commons IO].
 +
 +
Using a distinct name space or a different task name for the JDeb deb task is necessary to avoid any conflict with any other library used for the same purpose:
 +
 +
<code lang="xml">
 +
    <taskdef name="pure-java-deb"  classname="org.vafer.jdeb.ant.DebAntTask">
 +
        <classpath>
 +
            <pathelement path="bcpg-jdk15on-151.jar"/>
 +
            <pathelement path="commons-compress-1.8.1.jar"/>
 +
            <pathelement path="commons-io-2.4.jar"/>
 +
            <pathelement path="jdeb-1.3.jar"/>
 +
        </classpath>
 +
    </taskdef>
 +
</code>
 +
 +
Then, you can call this Ant task:
 +
<code lang="xml">
 +
    <pure-java-deb destfile="debs" control="controlDir" verbose="true">
 +
        <data src="user-app.jar" type="file">
 +
            <mapper type="perm" prefix="/usr/share/games/mygame"/>
 +
        </data>
 +
    </pure-java-deb>
 +
</code>
 +
 +
The attribute "control" must be a directory and the control filename must be named "control" in order to be found by JDeb. You can find an example of control file [http://github.com/tcurdt/jdeb/blob/master/src/examples/ant/src/deb/control/control here].
 +
 +
= Cross-platform tools supporting several package managers =
 +
 +
== JNDT ==
 +
[http://gouessej.wordpress.com/2014/11/22/ardor3d-est-mort-vive-jogamps-ardor3d-continuation-ardor3d-is-dead-long-life-to-jogamps-ardor3d-continuation/#jndt JNDT] is a pure Java library that provides several Ant targets to create some self-contained native application bundles for GNU Linux, Mac OS X and Windows. It supports several package formats under GNU Linux and as it is cross-platform, it doesn't require any support of native build tools, i.e it allows to create a DEB package with a GNU Linux distribution that doesn't support the native DEB build tools, it allows to create a Mac application bundle under Windows, ...

Latest revision as of 13:11, 16 September 2015

N.B: This article is subject to changes and is incomplete.

We assume that the application is packaged as a fat JAR called "user-app.jar" for the sake of simplicity.

Red Hat Package Manager

RPM (Red Hat Package Manager) is the default package management system under Red Hat, Fedora, Mageia, Mandriva, OpenSUSE, Oracle Linux, ...

Platform dependent tools

The following tools only work under GNU Linux or other Unix platforms with native rpm support.

rpmbuild can be used to build RPMs. You can find more information about RPM packaging in the official documentation.

The build tool Ant can call this command when you use its RPM task. The build system Maven does the same with its RPM plugin.

Cross-platform tools

jRPM

jRPM is a pure Java library for manipulating RPM packages.

Redline

Redline RPM is a pure Java library for manipulating RPM packages. It can be use in command line, with Ant and with Maven.

Redline requires Apache Commons Compress, Bounty Castle, SLF4J and XZ.

Redline with Ant

Using a distinct name space or a different task name for the Redline RPM task is necessary to avoid any conflict with the build-in Ant RPM task:

   <taskdef name="pure-java-rpm" classname="org.redline_rpm.ant.RedlineTask">
       <classpath>
           <pathelement path="bcpg-jdk15on-151.jar"/>
           <pathelement path="commons-compress-1.8.1.jar"/>
           <pathelement path="slf4j-api-1.7.7.jar"/>
           <pathelement path="slf4j-simple-1.7.7.jar"/>
           <pathelement path="xz-1.4.jar"/>
           <pathelement path="redline-1.1.16.jar"/>
       </classpath>
   </taskdef>

Then, you can call this Ant task:

   <pure-java-rpm group="Games" name="mygame" version="0" release="0" destination="rpms">
       <zipfileset prefix="/usr/share/games/mygame" file="user-app.jar"/>
       <depends name="java" version=">= 1.6"/>
   </pure-java-rpm>

The created RPM will use the JRE installed on the operating system.

Redline with Maven

This tutorial explains how to use Redline with Maven.

Debian Package Manager

Dpkg (Debian packager) is the default management system under Debian, Ubuntu, Knoppix, Mint, ...

Platform dependent tools

The following tools only work under GNU Linux or other Unix platforms with native deb support.

dpkg-buildpackage can be used to build DEBs. You can find more information about DEB packaging in the official documentation.

The build system Maven can call this command when you use its Debian Maven plugin.

Cross-platform tools

Jpkg

Jpkg is a pure Java library for manipulating DEB packages. It provides an Ant task. You can find an example of use in its readme file.

JDeb

JDeb is a pure Java library for manipulating DEB packages. It can be use in command line, with Ant and with Maven.

JDeb requires Apache Commons Compress, Bounty Castle and Apache Commons IO.

Using a distinct name space or a different task name for the JDeb deb task is necessary to avoid any conflict with any other library used for the same purpose:

   <taskdef name="pure-java-deb"  classname="org.vafer.jdeb.ant.DebAntTask">
       <classpath>
           <pathelement path="bcpg-jdk15on-151.jar"/>
           <pathelement path="commons-compress-1.8.1.jar"/>
           <pathelement path="commons-io-2.4.jar"/>
           <pathelement path="jdeb-1.3.jar"/>
       </classpath>
   </taskdef>

Then, you can call this Ant task:

   <pure-java-deb destfile="debs" control="controlDir" verbose="true">
       
           <mapper type="perm" prefix="/usr/share/games/mygame"/>
       
   </pure-java-deb>

The attribute "control" must be a directory and the control filename must be named "control" in order to be found by JDeb. You can find an example of control file here.

Cross-platform tools supporting several package managers

JNDT

JNDT is a pure Java library that provides several Ant targets to create some self-contained native application bundles for GNU Linux, Mac OS X and Windows. It supports several package formats under GNU Linux and as it is cross-platform, it doesn't require any support of native build tools, i.e it allows to create a DEB package with a GNU Linux distribution that doesn't support the native DEB build tools, it allows to create a Mac application bundle under Windows, ...