Weblog

Limit entries displayed: [ 2 ] [ 4 ] [ 6 ] [ 8 ]

I like scripts

As the title says I like scripts and many other people like them, too. In package management systems there are four of them which are especially important, namely prerm, postrm, preinst and postinst.

The maven-pkg-plugin which we are developing for Jalimo to ease the effort to create proper (binary) packages for various GNU/Linux distributions (as well as IzPack installer for all kinds of OSes) just learned to support them. This is important especially for supporting the Maemo platform because according to their guide you have to restart a certain system service after installation.

Here is the output of such a script which is now part of our example application jalimo-swt-example2: 

Nokia-N800-44-4:~# dpkg -i  debs/jalimo-swt-example2_0.1.0-0maemo_chinook-r2_all.deb 
Selecting previously deselected package jalimo-swt-example2.
(Reading database ... 15719 files and directories currently installed.)
Unpacking jalimo-swt-example2 (from .../jalimo-swt-example2_0.1.0-0maemo_chinook-r2_all.deb) ...
Hello user! This is the pre-install script talking.
We are dealing with maemo_chinook distribution. Possibly better
known as Maemo 4.0 (Chinook). It uses the deb package
management system.

You can use the following variables:
prefix=/
bindir=/usr/bin
datadir=/usr/share/jalimo-swt-example2
datarootdir=/usr/share
sysconfdir=/etc
jnidir=/usr/lib/jni
bundledjardir=/usr/share/java/jalimo-swt-example2
version=0.1.0-0maemo_chinook-r2
name=jalimo-swt-example2
mainClass=org.jalimo.examples.swt.SwtExample2

Isn't this great?

Same script different distribution:

root@fic-gta01:~$ ipkg install jalimo-swt-example2_0.1.0-0openmoko-2007.11-r2_all.ipk 
Upgrading jalimo-swt-example2 on root from 0.1.0-0openmoko-2007.11 to 0.1.0-0openmoko-2007.11-r2...
Hello user! This is the pre-install script talking.
We are dealing with openmoko-2007.11 distribution. Possibly better
known as OpenMoko 2007.11. It uses the ipk package
management system.

You can use the following variables:
prefix=/
bindir=/usr/bin
datadir=/usr/share/jalimo-swt-example2
datarootdir=/usr/share
sysconfdir=/etc
jnidir=/usr/lib/jni
bundledjardir=/usr/share/java/jalimo-swt-example2
version=0.1.0-0openmoko-2007.11-r2
name=jalimo-swt-example2
mainClass=org.jalimo.examples.swt.SwtExample2

Isn't this great?

The packaging plugin got vastly improved in the last weeks. IMHO the most important bit is, that it can distinguish between distributions: For the plugin at makes a lot of difference if you want your package to run on Debian Etch or Debian Lenny. The latter contains a lot more Java packages and therefore it tries to make use of them (if there is no package for a specific Maven artifact it will automatically bundle this) which means putting the package name into the dependency list and adding it to the application's classpath.

For this to work the plugin contains a built-in Maven2 artifact (= single jar file) to target distribution package mapping. In the earlier version of the plugin there was only one definition of such mapping, now it supports any number. Also system properties, additional files (including the above mentioned scripts), the main class and many more can be set on a per distribution basis.

The plugin also knows the distribution's packaging system, of course. Finally you can add/modify your own distribution mapping without the need to recompile the plugin. Still some basic information about Maemo Chinook, Debian Etch and Lenny as well as OpenMoko 2007.11 is already provided.

What is additionally nice is that Maven2 itself got packaged for Lenny. :-)

 


[ RSS Feed ]
eZ publish™ copyright © 1999-2008 eZ systems as