Tag Archives: ubuntu

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.
$ diff -u zeroc-ice-python_3.2.1/config/Make.rules zeroc-ice-python_3.2.1-new/config/Make.rules
--- zeroc-ice-python_3.2.1/config/Make.rules    2007-08-09 03:00:54.000000000 +0800
+++ zeroc-ice-python_3.2.1-new/config/Make.rules        2008-08-11 20:13:09.000000000 +0800
@@ -69,7 +69,8 @@
     # version used for building the Ice extension, then set PYTHON_VERSION
     # to "python2.3" or "python2.4".
-    PYTHON_VERSION     ?= $(word 1,$(notdir $(wildcard /usr/include/python2.[345]*)))
+    #PYTHON_VERSION    ?= $(word 1,$(notdir $(wildcard /usr/include/python2.[345]*)))
+    PYTHON_VERSION      = python2.5
     ifeq ($(PYTHON_VERSION),)
       python_darwin_home = /System/Library/Frameworks/Python.framework/Versions/Current
       PYTHON_VERSION   = $(word 1,$(notdir $(wildcard $(python_darwin_home)/include/python2.[345]*)))
$ 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.