A new Debian package helper: debputy
people.debian.org
people.debian.org
I've had to build a deb package once. It's crazy how few docs and resources there are to do so, and how of poor quality they are.
The package format itself is quite complex, and you don't know if you must do something imperatively or decoratively, when to trigger it in the workflow of the install, if it makes sense to use debconf or not, how to use debconf with something else than bash, good practices, where to put things, to copy files, etc. And that's before you have to deal with dependencies.
Then you have to repeat that for rpm.
No wonder people are attracted to flatpak and snap.
Creating a installer for mac, windows and linux is a hell of a work. Not to mention making sure it compiles and run on all those platforms.
Sometimes more than coding the program itself.
AppImage, FlatPak and Snap may actually be worse in that regard, because they are like other distros you have to take into account. So now, you may have to do all of them: deb, rpm, flatpak, snap, appimage, tgz, whatever that's on Windows and OSX, maybe a Docker container too, app stores and mobile stuff, and upload to some npm, maven, crate.io,... It makes generic package manager even more important.
Debian could fix a lot of the troubles with the existing Debian Helper tools by improving the documentation.
No matter how much I tried I could never grasp deb packaging. The documentation is very sparse and the debhelper commands seem like magic. I couldn't find out what all the different files like .dirs or .install did, so I just gave up.
And nix.
> Creating a installer for mac, windows and linux is a hell of a work
Nix gets you mac, linux and WSL support.
https://nixos.org/download#download-nix <--- I'm bookmarking this cause I keep forgetting that Nix can run atop other systems. I have no excuse to not give it a try
1: https://github.com/DeterminateSystems/nix-installer?tab=read...
I basically have to relearn Debian packaging from scratch every time I have to do that, but learn Alpine and/or Arch once and you're all set.
https://gitlab.archlinux.org/archlinux/packaging/packages/mu...
https://git.alpinelinux.org/aports/tree/community/mutt/APKBU...
Last time I shipped a debian package to clients we just had the build system spit out a ready made binary .deb. Much, much easier than faffing about with dhbuild etc.
After doing the first one, I was able to build binary, Debian packages in 5 minutes tops, while chatting with a friend during the process, too.
flatpak and snap are designed to solve different problems than OS native packaging paradigms.
Also, .deb and .rpm are much more capable and sophisticated than they look on the surface. Lastly, extracting a source and binary Debian package provides great documentation in itself.
Lastly, use lintian. That thing is a godsend (and does binary static analysis, too!).
I've also built in the double digits deb files, and I've always loathed the task. Even just starting from an existing deb src and trying to adapt it to my new package was always painful and as often as not I'd dig through the documentation and end up having to "phone a friend" for help. I'd get a magic incantation that would work, but I'd never quite internalize why or how I was supposed to know that.
I know there are tons of people who produce deb packages, so this is clearly a "me" problem, but as much as I wish I could contribute to the debian packaging world, it has just been impenetrable for me.
Kind of theraputic to hear others here saying similar.
I was surprised the other day that dpkg has no equivalent to rpm's `--last` switch to find when a particular package was installed. At best you can recover this information from the dpkg log (if it hasn't rotated out of existence) and/or modification times of the files under `/var/lib/dpkg/info/` if they've never been touched by accident.
Once I thought I understood it, I've tried to write it down myself, in book form. In case it helps, you can get it here for free for a while: https://leanpub.com/debian/c/hn-2024-01
But to be honest, even though I think I have a pretty good grasp how it works overall, I still sometimes run into hard-to-debug problems, or I think I know which hook to use, but it still doesn't work, inexplicably. dh is very flexible, to the point of sometimes being maybe too flexible to fully understand.
I don't think it's fair to expect third-party developers to keep track of all this and produce fully compliant packages without resorting to hacks like fpm. I have a couple of staging servers running Alpine and am thinking of switching more serious workloads to it. Maybe switching fully some day if that works out fine. I was surprised how easy it is to write Alpine packages, they don't change formats every week so your knowledge stays current, and I wrap even basic shell scripts in packages now. Not something I ever did for Debian systems.
Have a look at official packages for an example:
https://git.alpinelinux.org/aports/tree/main?h=3.12-stable
https://git.alpinelinux.org/aports/tree/community?h=3.12-sta...
- dh: 2008-present
Building something on top of dh at this point, like dh was built on debhelper, does not seem to justify your rant. But what do I know?
I do fear, though, that Debian packaging has absorbed some necessary complexity that Alpine packaging has not --- if only because Debian has been around so much longer.
The naming of tools often gets lost in the way things are built.
I do not know if the centralized approach of using "rpmbuild" (via command line options" is better for workflow or debian multi-tools (via separate executable) is better UNIX approach.
But at any rate, a workflowchart would be "awesome" of Debian.
https://wiki.debian.org/Wajig https://github.com/gjwgit/wajig
If you're willing to absorb that complication, then debhelper really will handle any and every situation. It is a hell of an investment, though.