Tuesday, May 27, 2008

Building and installing a local debian package

Recently, I ran into trouble with the 'python-zeroc-ice' package on Ubuntu 8.04. It used to work fine on Ubuntu 7.10.

Some digging revealed that the package python-zeroc-ice-3.2.1-2 claims it supports python2.5, but the C module for ICE is built against python2.4.

So I compiled the package and installed it locally. This is how:

1. Downloaded the source package:
$ apt-get source python-zeroc-ice

2. Installed all other packages needed to *build* this pacakge:
$ sudo apt-get build-dep python-zeroc-ice

3. Fixed the problem:
$ cd zeroc-ice-python-3.2.1 # yes, the source package/dir is called zeroc-python-ice
$ vim config/Make.rules
-> set "PYTHON_VERSION = python2.5" in the appropriate place.
$ dch -i # bring up the changelog with new entry
Added a changelog messsage. The package version, at the top of the changelog, is now python-zeroc-ice-3.2.1-2ubuntu1
$ dpkg-buildpackage -uc -us

4. Install the new package
$ cd ..
$ dpkg -i python-zeroc-ice_3.2.1-2ubuntu1_i386.deb

And we are done. However, the change above means Ice won't be available for python2.4 anymore.