Skip to content

Use of jdeb in Kura

dwoodard1 edited this page Jun 12, 2014 · 2 revisions

The jdeb library is a Maven plugin and Ant task that assists in creating Debian packages from Java builds. This wiki only focuses on the Maven plugin as it applies to the Kura project. For more detailed information visit the jdeb page.

Table of Contents

Pom Plugin

To add jdeb to your project, add the below to your pom. An example of this plugin in Kura can be found in kura/distrib/pom.xml.

<groupId>org.vafer</groupid>
<artifactId>jdeb</artifactid>
<version>1.0</version>
<executions>
  <execution>
    <id>your-id</id>
    <phase>install</phase>
    <goals>
        <goal>jdeb</goal>
    </goals>
    <configuration>
        <verbose>true</verbose>
        <deb>path_to_output/output_name.deb</deb>
        <controlDir>path_to_control_directory</controldir>
        <dataSet>
            <data>
                <src>files_to_include_in_pacakge</src>
                <type>file</type>
                <mapper>
                    <type>perm</type>
                    <prefix>/tmp</prefix>
                </mapper>
            </data>
        </dataset>
    </configuration>
  </execution>
</executions>

Configuration

Control Directory

A control file must be present to create a Debian package. By default, jdeb will look in src/deb/control for this file. Use the 'controlDir' element to override this default. In Kura, these files are located in kura/distrib/src/main/deb. Below is the main control file for the Raspberry Pi. More information on Debian control file can be found here.

Package: KURA
Version: [[project.version]]
Section: misc
Priority: low
Depends: [[project.raspbian.dependencies]]
Architecture: all
Maintainer: [email protected]
Description: Kura is an inclusive software framework that puts a layer
  between the operating system and the customer application, with industry
  standard interfaces that shorten custom development time, simplified coding
  and software that can be easily ported from one hardware platform
  to another.

The entries within the brackets are properties defined in Maven. Pre and post scripts may also be included in the Debian package. These scripts are named preinst, postinst, prerm, postrm and must be located within the control directory.

Data Set

The dataSet element is used to define files to include in the Debian package. In Kura, we include a single zip file that the postinst script unpackages. Within this zip file is the main installer shell script. In Kura, the mapper element is used to prepend "/tmp" to to any files in the data set. This mapper will place the zip file in a tmp directory to be cleaned up after the install.

Clone this wiki locally