8 ms·
Debian packaging lacks a practical guide that is comprehensive enough to cover all modern use cases, but at the same time doesn't lack focus and goes to the poi
by j1elo 6y ago
Debian packaging lacks a practical guide that is comprehensive enough to cover all modern use cases, but at the same time doesn't lack focus and goes to the point. The official docs are very extensive, but then they lack self-references to guide the reader to the interesting parts, or surprisingly lacks information that one would expect to find in there.
You will read about debian/rules file, but then open one from any example project and only see a single rule calling "dh". Turns out debhelper is there doing things for you. On to read about debhelper. But now sometimes you'll see some rules file that uses the target "override_dh_autoreconf", which was not explained, not even hinted, in the previous docs. On to read more.
Did you think you got everything? Not so fast!
You'll document yourself about debian/control files and see that using some variable-like names are common in lots of projects. For example this is used a lot:
Depends: ${misc:Depends}, ${shlibs:Depends}
On with the same issue. For some reason (which new users reading the docs shouldn't really have to care), "shlibs:Depends" seems to be used all over the place, but it is not mentioned, hinted, or even suggested in a mere "see also" paragraph in the docs about debian/control. If you are thorough enough you'll end up seeing a quick mention in a different section (8. Shared Libraries), and turns out the actual definition of this variable has to be checked out from "dpkg-shlibdeps", an independent package.
Now how to actually build a package?
In the old days, the debian/rules file contained all the steps, but all is now helpfully abstracted by simply calling debhelper (dh). But calling debian/rules itself is abstracted also by dpkg-buildpackage. Calling dpkg-buildpackage is itself covered by debuild. And debuild is possibly covered by calling git-buildpackage. There is a crazy pile of tools calling tools calling other tools, that is nothing but extremely confusing for newcomers.
For the 99% of times you just want a local package for local installation, dpkg-buildpackage is what you want. But getting to that conclusion is not something you get pointed to from a brief introduction from an official manual. You get to that conclusion after either studying all tools and putting order to all scattered knowledge in your head, or after blindly following some random blog of forum post (which tend to be correct because thankfully all this tooling doesn't change much over time)
EDIT to stress that all information is there, but the official docs lack a good enough effort of linking or including everything in such a way that it follows a logical learning process for newcomers.
- gorgoiler 6y agoWhere do Debian maintainers collect their institutional knowledge, these days? In the past it felt like DSCs uploaded to the FTP queues were the equivalent of committing code on a software project. Are they all in one git repository now, that can be tracked outside the project? Nothing beats being able to read the code for learning how a system actually works.
- pabs3 6y agoSome packages use git for maintaining the packaging, but the Debian archive and build servers are still based on Debian source packages (.dsc files).
- pabs3 6y agoDebian maintainers collect their institutional knowledge from participating in package maintenance, following Debian mailing lists and other communication forums etc.
- debiandev 6y agoDD here. apt-get install maint-guide ...and then read: file:///usr/share/developers-reference/index.html file:///usr/share/doc/maint-guide/html/index.en.html Also look at existing packages and talk to DDs. Avoid random wikis. I worked on many deployment systems and reading these guides made me a better engineer overall.
- gorgoiler 6y agoThanks! The problem I saw from parent and other posts was that there’s two sets of information you need to build a package: (1) the sources and debian patches, where the last public release of these is available from packages.debian.org (2) knowing the right command to run to build the package. In the old days you could guarantee everything would build via dpkg-buildpackage though you’d need to know to add -r fakeroot. It sounded like nowadays it’s more complicated than that?
- j1elo 6y ago