Foreign Packaging

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.

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.

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:

Then, you can call this Ant task:

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

= 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.

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:

Then, you can call this Ant task: 

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.