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.

Post a comment or leave a trackback: Trackback URL.


  • Luis  On August 11, 2008 at 7:29 pm

    It didn’t work for me, maybe I didn’t set the PYTHON_VERSION variable in the appropiate place. Could you please tell me which is the appropiate line?

  • parijatmishra  On August 11, 2008 at 8:15 pm

    I’ve updated the post with a diff, which points to the correct line number.


  • Andrea Montefusco  On August 31, 2009 at 3:10 pm

    Great mini-howto !
    Many thanks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: