Plain old tarballs
Before getting into the details of Slackware packages I would like to explain a few basic characteristics of Slackware packages. These days most package managers are quite complex. For example, the most important feature of many package managers is dependency handling. This means that if a package requires other packages the package manager will take care of installing them too. Most of the times this works, but dependencies can get a bit annoying. For example, if you install software that is not in the main distribution, version numbering conflicts can arise. The Slackware package tools do not handle dependencies. The means to handle dependencies does not exist in the "format" of Slackware packages either. This can initially scare away users, but it is (at least in my opinion) more flexible and provides more freedom. Since there is no dependency management at all you are in control.
Well, what is a Slackware package? A Slackware package is a tarball (an archive created with tar and compressed by gzip) which contains information about the package and an installation script. The information about a package is stored in two ways, first of all in the filename of the package, besides that the tarball contains a desctiption file. Both will be covered lateron. Last but not least a package contains an installation script. This script is automatically executed when installing or upgrading a package. Most packages only use an installation script for making symlinks. Correct Slackware packages do not have symlinks in the tarball, symlinks are set up using the install script.
The package filename
The package filename provides some information about the package. This information is also used by the Slackware package tools, for example to decide whether some package is newer than the installed version. A package filename has the following syntax:name-version-architecture-revision.tgz
The different variables in a package filename are seperated by by a '-'. Naturally, it is not wise to use the separation character in one of the variables. The filename is usally in lower case. The first variable defines the name of the package, usually this is just the name of the software. For example, for Mozilla this is 'mozilla'. The second field determines which version of the software the package provides. This is usually used te determine when to upgrade a package and when not. The third field specifies the architecture of the package. Nowadays the official Slackware distibution only supports x86 machines. Up to Slackware Linux 9.0 packages were compiled with '-march=i386', so the name of this variable is usually 'i386'. Starting with Slackware-Current after Slackware 9.0 support for 386 machines is dropped due to some glibc issues. So new -current packages are compiled with the '-march=i486' gcc parameter. So, the architecture variable is 'i486' in Slackware-Current. Last but not least the revision number is specified. This is used when a newer version of a package is released, but the package is still at the same version. Usually this parameter is '1' and increases after revisions.
More information about the package is in the /install/slack-desc file in the package tarball. This file contains the package description which is shown during the installation of a package. If you have ever installed Slackware you have probably noticed these descriptions during the installation. Basically this file just contains the description on multiple lines behind a 'name:' part on each line. I will discuss the slack-desc file in detail in the article about creating a package.
The install script
Until we discuss package creation there is not much to say about the install script. There are a few things you should be aware of. First of all the script is in the /install/doinst.sh file. The second thing I should notice is that, though symlinks need to be created by the install script, you do not have to write the symlink (ln -s) lines manually. The makepkg script can take care of this.
Some final words
This first article is not an introduction to pkgtools, but I hope you have an idea what a Slackware package consists of. In the following articles we will dive into package maintainance a little deeper. In the meanwhile: happy Slacking;).