Apr 09

Python-Debian Packaging for Maemo

Packaging a software component made using python to a Maemo device could be easier, if CDBS cared about hand-held devices and their limitations.

Knowing that using setup.py was the Right Way of Doing It™ for python applications I tried to push myself into making CDBS work together, but not without a little harassment.

First of all, such scope-limited distributions tend to gather components in customized places as to promote integration between them or just in sake of a plain different organization. This difficulty can be overcome by using pycentral and including the following line at debian/rules file.

Just as the manpage says, this will prevent the build-system from moving the files from the selected install prefix to a central place (like /usr/share/pycentral).

Secondly, because of limited storage capacity and speed-up necessities, usually python components install just their .pyo files. This requirement made me struggle trough CDBS’ python-distutils.mk source code in hope for a simple fix. The answer I’ve found was to overrule the python-install target with the following commands (look here for the diff).

Let’s say it’s inside a file named debian/fixup.mk, then my complete debian/rules file would be like this.

And this is the beauty of CDBS, a file which would be several lines long gets resumed to a few lines.

I’m still trying to find a way to make this code available for all my components without installing it to a globally reachable path, but did not find a thing such as a MAKEFILEPATH variable untill now. I guess a package like cdbs-maemo-dev.deb would be an appropriate place for stuff like this, but pushing it there is for another post.