OrbitalAir Slackware - www.slackware.com
Home| Linux| Programming| Digital HiNote| Motorcycle

Slackware Package System

1. Nature of Slackware Packages

Slackware packages are a nicely arranged setting of source files and 3 install scripts. These scripts are executed by installpkg and pkgtool. While simplistic, it gets the job done, rarely fails and is simple to operate, maintain and extend. This document is my sum knowledge of the workings of this system by examining code. Feel free to contact me with updates, changes and proposals.

1.1 MakePkg

Understanding how packages are constructed is a key element. A tool called makepkg is provided by the base Slackware installation. When run like so:

bash /usr/local/mysql$: makepkg mysql

All the files and directories under /usr/local/mysql will be tarred and gzipped into a file named 'mysql.tgz'. Symbolic links are turned into code and appended to the doinst.sh script that is executed after unpacking.

1.2 Scripts

In order for the install scripts to work, they need to be added into the directory structure of the package. All scripts should be written for the ash shell.

1.2.1 Install script

The install script is executed after all the files are extracted, by setup, pkgtool or installpkg. This file located in ./install and named 'doinst.sh'.

1.2.2 Config script

A configuration script is run by setup after installing all packages (netconfig being one). They can also be run from pkgtool. This file is located in ./var/log/setup and the filename should be setup.

1.2.3 Only Once script

A script that is run one time only by setup. This file is located ./var/log/setup and is named setup.onlyonce.

1.3 Install Log

The installpkg script logs various bits of information to a file, usually in /var/log/packages. The log name is the package name without the .tgz extension.

1.3.1 Log Contents

PACKAGE NAME: -> comes from the package name, minus the .tgz extension
COMPRESSED PACKAGE SIZE: -> calculated
UNCOMPRESSED PACKAGE SIZE: -> calculated using tar/gzip tool
PACKAGE LOCATION: -> input filename
PACKAGE DESCRIPTION: -> read from one of 2 sources, if a 'disk*' file exists it scans that file for lines that start with the package name. Else it looks for a file named 'package_descriptions'.
FILE LIST: is an echo of the tar output piped to this log file.

2. Issues regarding Dependancy Checking

2.1 This section deals with Proposed NEW Items to Slackware Packaging

2.2 Version Numbers

Versioning of packages is in all respects the easiest item to add to Slackware packaging. I propose adding 2 text files to the system. One a data file and the other a system script, callable from setup or the other package utils. Having a strict filename format with the version number as part of the filename would also work.

2.3 Dependancy Checking

With a mechanism in place to add version numbers the second phase becomes much more complicated.

The issues are:

  • How to handle option of check or ignore versions
  • Handle the option of auto-installing any deps if they can be located
  • How to handle 'legacy' packages, i.e. backwards compatible
  • Handle failures inthe process (can't find dep pkg, extract fails, etc)
  • Changes to current tools
  • New tools to support packages in general

2.4 Proposed Solution:

The proposed solution involves 2 files. First, a package information file I call a deps file. Each package should contain a file called deps.id. Probably in the ./install dir. The deps.id file will contain the package version number, and a line for each dependancy. Like so:

deps.id
	VERSION: 1.1.2
	DEP: amp > 0.7.6 -a  /usr/src/amp.tgz
	DEP: gtk++ = 1.1.1   ftp://ftp.gtk.org/latest/gtklib.tar.gz \
             -b custom-build-script?

The DEP pattern is:
	packagename operator version number options location

	operators are: 	>, <, >=, <=, =
	options are: 	-a auto install deps
			-b custom build script, a script for  \
                           ./configure, make, make install, etc.

This info would be pumped into the log files.

The Second is a 'verchk' script that can read the dep.id and log files and proceed with version checking before extracting all the files.

3.0 Tools

3.1 New Tools


Comments, constructs, code, ideas: email to Joe Robertson at the link below.
Flames, negative waves: /dev/null
NetRunner card images
Copyright Wizards of the Coast.
jmrobert5@mchsi.com
ssrobert5@mchsi.com
Last modified: Sun Mar 10 21:29:04 CST 2002