Debian Packaging from First Principles
mikecoats.com
mikecoats.com
but still, that was a pretty interesting write up.
Arch packaging is a breeze in comparison. You indeed only need one file and that's it.
Best way to discourage anyone from generating a .deb package is recommending him read the official "new maintainers guide"
After years of maintaining packages, I think I decided that much of the complexity is unfortunately warranted. You want stuff to work in all sorts of situations, with all sorts of different other things installed at the same time. You want upgrades to work. You want tests to work and to run, but probably you want to skip them when cross-building. You want the package to be co-installable across architectures. You want the package to be cross-buildable and to be usable to cross-build other packages. And you want your builds to be reproducible. And lots and lots of other things, all the while having to deal with upstreams that often don't care about many of these things.
I haven't seen any other packaging system that is both nicer and maintains Debian's high standards. Maybe something exists. I think Debian's biggest problem in this area is the documentation. The official docs should be more accessible, but that's a big job that nobody has stepped up to do. Yet.
I must emphasize, I'm not saying, to quote you, that the documentation should more accessible, but nobody has stepped up to do yet. I'm saying, they're completely fixated in their approach to tailor packaging tools and documentation for creating packages for inclusion in official repository. Debian's tools and documentation for creating ".deb" packages are completely intermingled with their policies for including packages in the official repository. That's where all the complexity comes from. They're mixing the policy (Debian repository rules) and mechanism (deb format), and unless they recognize this, no amount of packaging tools or documentation improvements will solve it.
Which is such a shame by the way, because like you said, Debian packaging ecosystem is really powerful and would render a lot of complex machinery devops people use today unnecessary. You can distribute out-of-band updates to data files, push configuration (instead of configuration management) [1], do deployments with virtualenv/gems included (instead of containers) [2], proxy/partial repo mirrors for staged updates/deployments etc. Unfortunately if you decide to it, you'll either have to go with the Debian sanctioned way and tear your hairs because of unnecessary complexity, or you'll go look for 3rd party tools and hunt for blogs posts all over the internet as substitute documentation.
[1] https://wiki.debian.org/ConfigPackages [2] I recommend checking out Vincent Bernat's excellent "Pragmatic Debian Packaging" series (https://github.com/vincentbernat/pragmatic-debian-packages) for some examples
Barely anybody uses Arch outside the HN bubble, it's a blip compared to the amount of Redhat/Debian out there in Enterprise/Web 1.9
But that doesn't make it superior, or something to be proud of.
> arch, nix, docker, flatpak, snaps etc
Lumping all of these into the same category doesn't even make sense, other from a "they're all things invented after 2000 and I don't wanna learn anything new" perspective.
> The latter will all "win" on their merits at some point and become fat and lazy themselves as they evolve and grow
Can you back up your nihilism?
> those companies prefer reliable, predictable and boring.
They prefer what they're used to, even if it's neither reliable nor predictable due to having too many moving parts (that don't even make sense any more), and are only boring in the sense that you know exactly how wasteful and brittle they're gonna be and how much effort you will waste interacting with them.
And even then, their preferences don't stop most "boring big enterprise" companies from using newer technologies, just look at docker. Your condescending false dichtomy is entirely pointless.
Once you start adding things like pre-inst, post-inst scripts, binary redirections with update-alternatives, I suspect the complications start to pay off.
In practice, how would one make it simpler?
i'd note it's simplicity (and the fact that ipkg/ipk format was based on it), was what enabled me to help the people who "jailbroke" (really just install homebrew apps) the palm pre: https://www.engadget.com/2009-06-22-pre-apps-successfully-in...
I was able to assist people that had the device without even having one as the format (to me at least) was very simple.
This article is great for understanding the deb format. Lots of tools can make deb archives e.g. https://fpm.readthedocs.io/ . However making a binary package for users is a quite different thing to making a deb suitable for inclusion in Debian itself. A debian source package is a tuple of three .dsc + .tar.gz + .debian.tar.gz files.
I appreciate first principles, but i just used dkpg-deb --build
Once you have a feel for that stuff, use debhelper to create a new package 'from scratch' (from an upstream source tarball).
This 'tutorial'¹ presents basically the same info as the Debian packaging docs² but it feels more easily digestible to me because of how it's chopped up into slides.
Some of the manpages are also good. The debhelper manpage³ refers you to other small docs, notably dh_make⁴, which is probably your best starting point for creating a package from scratch.
--
1: https://www.debian.org/doc/manuals/packaging-tutorial/packag...
2: https://www.debian.org/doc/manuals/debmake-doc/ch05.en.html#...
3: https://manpages.debian.org/bullseye/debhelper/debhelper.7.e...
4: https://manpages.debian.org/testing/dh-make/dh_make.1.en.htm...