My webblog at evolvis.org

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 betterknown as Maemo 4.0 (Chinook). It uses the deb packagemanagement system.

You can use the following variables:prefix=/bindir=/usr/bindatadir=/usr/share/jalimo-swt-example2datarootdir=/usr/sharesysconfdir=/etcjnidir=/usr/lib/jnibundledjardir=/usr/share/java/jalimo-swt-example2version=0.1.0-0maemo_chinook-r2name=jalimo-swt-example2mainClass=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 betterknown as OpenMoko 2007.11. It uses the ipk packagemanagement system.

You can use the following variables:prefix=/bindir=/usr/bindatadir=/usr/share/jalimo-swt-example2datarootdir=/usr/sharesysconfdir=/etcjnidir=/usr/lib/jnibundledjardir=/usr/share/java/jalimo-swt-example2version=0.1.0-0openmoko-2007.11-r2name=jalimo-swt-example2mainClass=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. :-)

SWT on Maemo updates

Just before FOSDEM I have a nice batch of screenshots to show. What I am going to present today is a new Jalimo demo application which is available in binary form from the Maemo Jalimo repository (sourcecode is in SVN).

It makes use of SWT 3.4′s ability to switch to fullscreen mode (and back). Since a convention for Maemo apps says that toggling fullscreen should be possible by pressing a certain hardware button, I added the neccessary listener as well. It works nicely. :-)

Last but not least while reading through through the Hildon documentation I learned that the environment provides its own file chooser dialog. Since I was fixing a bug in our SWT anyways I added support for this dialog as well.

The results can be seen here:

In related news:

Jalimo is actively contributing and committing stuff to OpenEmbedded now. One of the nice results is that other people start adding the packages into their distributions. Eg. OpenMoko now has GNU Classpath, Cacao, JamVM and SWT in their repositories. The same is going to happen for GPE and AFAIK Angstrom. Nice one!

For the Maemo packages which we provide on our own we lately switched from the manually and Scratchbox-built packages to the ones made by our OpenEmbedded-base autobuilder. For those who used the old repository for their N800/N810 device already I wrote a small migration guide.

And on a completely different topic:

Richard is in Berlin today and does a talk about the philosophy and history of free software. With a little luck a friend and I can organise an interview with him. I spent half the night on getting some interesting background information. :-)