What's new? | Help | Directory | Sign in
Google
                
Code License: New BSD License
Labels: java, ant, debian, dpkg

Description

Jpkg is both a library and a set of Apache Ant tasks for building operating system packages.

Features

Usage

Basic pattern for including the Ant task in your build: <taskdef resource="antlib.xml" classpath="path/to/jpkg-combined.jar"/>

Most of the common fields are shown in this example. See the full Ant task schema for more details.

<dpkg output="dist/dpkg_out" prefix="/usr/local/" distribution="unstable">
  <package destroot="dist/destroot">
    <info>
        <name>packagename</name>
        <version>1.2</version>
        <arch>i386</arch>
        <description>Package description</description>
        <maintainer>
            <name>Package Maintainer</name>
            <email>maintainer@package.com</email>
        </maintainer>
        <priority>optional</priority>
        <section>misc</section>
    </info>
    <permissions> 
        <permission user="username" group="groupname" mode="755" recursive="true">
            <path>bin/</path>
        </permission> 
    </permissions>
    <dependencies>
      <require package="packagename">
          <equalTo>1.4</equalTo>
      </require>
      <conflict package="conflictswith"/>
      <replacement package="replacethis"/>
      <alternatives>
          <require package="option1">
              <equalOrLesserThan>12.1a</equalOrLesserThan>
          </require>
          <require package="option2"/>
      </alternatives>
    </dependencies>
    <scripts>
        <postinst source="script_source/postinst.sh"/>
        <prerm command="echo test prerm message"/>
    </scripts>
  </package>
</dpkg>

Distribution Files

Dependencies

For both the library and ant tasks:

For the library:

For the Ant tasks [commons-collections for velocity]:

For the Antidote library:

Custom Maintainer Scripts

See com/threerings/jpkg/ant/dpkg/scripts/standard/HelloWorld.java for an example. If you create any custom TemplateScript classes you will need to do something like the following.

Example custom-scripts.xml:

<?xml version="1.0"?>
<antlib>
    <typedef name="customscript" classname="com.example.CustomScript"/>
</antlib>

Pattern for including the Ant task in your build with custom TemplateScript classes:

<path id="jpkg.classpath">
  <pathelement location="${buildlibs.dir}/jpkg-combined.jar"/>
  <pathelement location="${buildlibs.dir}/custom-scripts.jar"/>
</path>
<taskdef resource="antlib.xml" classpathref="jpkg.classpath" loaderref="jpkg.loader"/>
<typedef resource="custom-scripts.xml" classpathref="jpkg.classpath" loaderref="jpkg.loader"/>

Release Notes

Author

Jpkg was written by Jonathan Le Plastrier, based on an original Python implementation by Landon Fuller. It is copyright Three Rings Design and is released under a BSD license.