Packaging for Unix

tux_packaging

For a while now I felt this urge to finally give back to the Unix community in the form of documentation or new software. Unfortunately, despite my knowledge, writing proper documentation still intimidates me so I decided to start with building packages first. Among the many GNU/Linux and BSD operating systems, some are extremely easy to package for. CRUX, Arch Linux and Gentoo, requiring considerable Unix experience, have extremely lean packaging systems. More so, CRUX and Arch Linux are good examples of how package templates should look like. They use basic text files, easy to read and even easier to parse with our programming language of choice. No wonder AUR (Arch Linux User Repository) is perhaps the biggest GNU/Linux repository in existence. Contrary to these “geek distros”, packaging for Debian was a nightmare to me. In the past I tried helping out the Devuan cause by trimming down XFCE4 and removing the various systemd “poisons”. Installing required -devel packages, preparing the environment and finally building was far too complex, in my opinion. There were too many files with too many interrelated parameters. In the end I failed, while a similar process under CRUX took only minor tweaks to the .configure config (I wanted to build without dbus and policykit) and 1 hour of compile time.

It’s fully understandable that each GNU/Linux distribution follows its own packaging practices and that security and integrity are perhaps of highest importance. This is typically done via various signing mechanisms, the simplest of which is a mere MD5 hash sum. Curiously enough, an MD5 sum is in most cases sufficient. Even better of course would be a SHA256 or SHA512 sum. Hence, a simple Shell script to get the sources and a hash sum for integrity verification should be enough to build a software package. With that in mind, I decided to give Fedora another go – as a programming platform and as a packaging environment.

For reasons that Linus Torvalds knows all too well, Fedora is a fantastic operating system for developers. It has up-to-date packages, sane administration practices and robust packaging tools. I found myself a good case study in the form of OpenTTD (open Transport Tycoon Deluxe). It so happens that the game and graphics libraries are available in the repositories, but the sound files are not. After some half hour of build environment preparations I was ready to write my first .spec (specification) file. Fedora’s rpm templates (.spec files) have a very intuitive, Unix-friendly layout. In addition, a well-documented macro system helps improve ease of maintenance. The main tool, rpmbuild, makes building packages a breeze. Once the package is ready, it can be submitted to the COPR system for initial distribution. Everything was made smooth and easy for the Unix everyman.

In the past I had a lot to say about Fedora due to its bleeding-edge approach to software stability and use of systemd. However, in a broader perspective I now begin to comprehend why the necessary “evil”. To improve adoption and efficiency in software development, a certain degree of freedom needs to be sacrificed. It’s not a sin, but a choice that really had to be made. I cannot imagine administering whole infrastructures with the help of self-daemonizing Shell scripts alone. Arguable, but understandable. It’s an entirely different matter on the desktop, though. We can boot kernels with whatever we want – init scripts, OpenRC, nosh, s6, etc. I’m actually tempted to sink systemd on my Fedora install with a powerful shot from the 120 mm nosh. Of course, related .rpm packages would follow so that other citizens of Unix-shire may enjoy a breath of fresh (free) air in their well-mowed, corporate yards.

Of course my craze will end at some point and I shall return where I truly belong. The “me” in FreeBSD…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s