Chapter 3. Using list2pkg

Table of Contents

Customizing your package
Changing makepkg's behavior
Changing the content of the install/ directory
Changing the package tree's content
Users and groups handling
The perfect package
The package's file name
Install locations
Permissions and Ownership
Tricky cases
Symbolic links

Customizing your package

Sometimes, you might want to change the default way list2pkg acts, or do something special that list2pkg could not do for you on your package. This section gives some example of things you can do using list2pkg's options.

Changing makepkg's behavior

As mentioned previously, the last step of list2pkg's creation of a package is to call makepkg . The --linkadd, --prepend and --chown options will be passed to it as is.

Changing the content of the install/ directory

The install/ directory contains special files the slackware package management tools use to know how to install the package. The only file that must exist is the slack-desc file which gives a plain text description of the package. The slack-desc file which list2pkg creates is not especially good in that respect, so you might want to add your own slack-desc. To do that, you can use the --slack-desc option.

Another important file is the script, which gets executed after an installation. You can give your own custom script using the --doinst option. List2pkg will then append its own commands to it.

There are other files which can be in install/ that list2pkg does not support. Among them are files like slack-required or slack-conflicts. You can specify a directory with other files to copy to install using the --install-files option.

Changing the package tree's content

Once the package tree has been created, you might want to change a few details. For example, you might want to move all files in /usr/local to /usr in order to create a more standard-compliant package. List2pkg cannot do that directly, but it lets you run any script you want once the package tree directory has been created. The script will be invoked with the tree's path as first argument. The option to use is --changetree .

Users and groups handling

List2pkg handles file owners and groups in a peculiar way. For each of the package's file, it will check if its owner or group is special. A special owner or group name is not standard and matters enough for it to be re-created explicitly on any system the package is installed on.

If, for example you are creating a package for the cron daemon, you will want the cron user to be created on the target system, since some of the package's file will likely be set user id. On the other hand, the user root is generally not special, since it exists on virtually all UNIX-like systems.

Note that by default, all files in the package will have root as owner and group, meaning that files with non-special owners or groups will lose them and be installed with root owner and group on the target system. You can use the --no-root-ownership to prevent list2pkg from resetting the owner and group of every file to root.

By default, all user and group names are special except root . Any user or group beginning with urpkg- or urpkgrp- is also considered non-special, for reasons that will become obvious to you if you use urpkg . If you don't you shouldn't have any user or group name formatted that way.

The exclude rules configuration file

Those default rules can be changed. In fact, they are read from a configuration file in ${SYSCONFDIR}/list2pkg.conf (by default /usr/local/etc/list2pkg.conf). You can either modify that file or override it when calling list2pkg using the --exclude-ownership option.

The format of the file is simple. Each line contains a regular expression that will be matched against each owner or group name. Assuming the line's content is held in the variable EXPR , the matching Perl code will be the following.

$NAME =~ /^$EXPR$/

If the expression matches, the name will be considered as non-special, otherwise it will be considered special.