What to do if you do not understand Debian Packaging
Up until now I had only been a consumer of debian packages and had a mostly pleasant experience. Dependancy resolving works and apt-get & friends are reasonable efficient. If everything fails there is always apt-get source. So it was about time to get on the other side of the fence! However, simply searching for HowTos was already irritating enough =) Not that you wouldn't find any documentation, quite the opposite! You find way too many, many of them describing different ways of How To Do It Right TM.
The easy way perhaps is to just start with an already debianized project and perform an update of the sources. That got me to my first debian package quickly (copy this debian folder here, dch -i into a quick "edit-the-changelog" session, debuild the new packages, DONE!) but I didn't understand much at all . Then I thought I'd learn more by debianizing some toy code of mine. Since I was already using autotools it should have been straight forward - get everything created by a "make install" into a binary, or so. Well, I only got the executable included in the end =) The mysteries of the dh_* universe.
Then Daniel pointed me to the Common Debian Build System. It required even more reading (I managed to pick the director's cut, instead of the plot summary) but at least this beast called debian/rules was tame-able now!
CDBS is a true winner in debian maintainer land I guess. Though one detail kept me occupied, and that was how the call to "dh_install -p
Oh something that I personally found quite clever was the debian/rules shebang: "#!/usr/bin/make -f". I have called Makefiles from other Makefiles in the past but this solution takes the cake, unless of course you think "include /some/other/Makefile" doesn't look nice.
Other useful commands:
- dpkg-checkbuilddeps shows (developer) dependencies of the current source package
- apt-cache depends
shows the dependencies of a package - dpkg -L
shows the files contained by an installed package.
Comments
Post a Comment
This site's webmaster failed misserably in upgrading the underlaying web framework.
The comment system is entirely broken right now. Sorry!
If you just now look at Debian packaging, maybe debhelper 7 is better suited than CDBS. CDBS has its followers, but there is also a big crowd who don't like it due to its "black box" nature (people disregard the Makefiles in /usr/share/cdbs as unreadable).
debhelper 7 is about as easy to use in debian/rules, but might get the full community mindshare and corner cases might be easier. Of course, if you have trouble, you will have to look at its perl code.
See http://kitenet.net/~joey/blog/entry/c... and http://kitenet.net/~joey/blog/entry/d... they are a bit convoluted, but in the general case, the design looks simple yet flexible.
Disclaimer: I have not yet used it on my own packages.
Thanks for the links! Well, it certainly tackles the same problem - I'll have to give it a try. Interesting how perl code is preferred over Makefiles though =)
More documentation links for CDBS
This is long, too [1]. But it has nice pictures to explain the build process [2] and the makefile dependencies [3].
[1] http://build-common.alioth.debian.org...
[2] http://build-common.alioth.debian.org...
[3] http://build-common.alioth.debian.org...