Notes on debian packaging - GuillaumeFromage/django-library GitHub Wiki

So I tried to figure out to deploy this package quite a couple of time across development platforms and whatnot, and its been a huge pain, especially considering that it doesn't have an install script that checks for missing libraries. Because wheezy just came out and squeeze will go out the window soon, I thought of giving this a tiny debian package of its own, just so I can reinstall the fucker properly (NOT in a home dir !) as soon as I get wheezy running. With django 1.4 !

I followed the recipe to make a package, that basically says that you need to have a make install that works fine by debian policies. I worked quite a bit on a Makefile and it didn't give much, aside from putting files in the right directories, but obviously, it hardcoded the vhosts. Well that's shit for deploying across hosts.

Having worked way too much with debian-installer, after searching in the package maintener for a while, I winded up installing debconf-doc, to find the miraculous debconf-devel man page, that states clearly that:

It is a little confusing that dpkg refers to running a package’s postinst script as "configuring" the package, since a package that uses debconf is often fully pre-configured, by its config script, before the postinst ever runs. Oh well.

So I'll write one of those postinst script to choose to create a damn vhost. At least I'll understand the debian package management better now.

[... days go by ...]

Back at it, I discovered the joy of "name [two spaces]date" in the changelog that are needed to create a package. Its pretty good that all debian package are distributed with source, so you can get a whole plethora of examples for free. However, the Makefile.in and the configure.in of this world are pretty big bites to swallow. Seems like my usage of ${DESTDIR} is wrong, and I don't wanna cheat and just "cp etc/* debian/etc" like I've seen in other packages. Can't wait to write actual code in preinst script.

[... days go by ...]

I started looking at the package of openstack-dashboard again, but they used setup_tools, so I googled setup-tools, since quite a lot of what they were doing in their package was arcane. Digging for help in the packaging, I found quite an illumination (basically this is mostly what they tell to do on the python setuptools docs http://docs.python.org/2/distutils/setupscript.html), but it confirms that it can actually work for django: http://bruno.im/2010/may/05/packaging-django-reusable-app/ .