Saturday, January 30, 2010

sun-java5-plugin for Seamonkey on Ubuntu 9.10 (Karmic)

I'm currently using Ubuntu with sun-java5-* packages installed because I need Java 1.5 to build Android and because my home banking requires an applet that sometimes does not work with later versions. I'm also using the seamonkey-mozilla-build package, because its mail reader is much better than Evolution.

Everything went well until I decided to remove Firefox, the default Ubuntu browser, because I did not need it anymore. The problem is that the sun-java5-plugin package depends on firefox. Googling for help I did not find any help. Time to hack!

1. Install the required tools:
apt-get install autotools-dev fakeroot dh-make build-essential
2. Add these lines to /etc/apt/sources.list in order to get the repo for java5:
## For sun-java5-jdk
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
3. Get the package source code:
apt-get update
apt-get source sun-java5-plugin

4. Adapt the package for Seamonkey:
vi sun-java5-1.5.0-19/debian/rules
vi
sun-java5-1.5.0-19/debian/control

In both files, search for the word “konqueror” and add “ | seamonkey” just after it.
5. Build and install the new package:
cd sun-java5-1.5.0-19
dpkg-buildpackage -rfakeroot
dpkg -i ../sun-java5-plugin_1.5.0-19-0ubuntu0.9.04_i386.deb

6. Edit /etc/apt/sources.list and remove or comment-out the lines added in step 2.

7. Remove the traces of the old package, otherwise the update manager will try to upgrade it and reinstall Firefox:
rm -f /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_jaunty*

No comments: