logo Autopackage - Easy Linux Software Installation

System Overview

Autopackage is, essentially, a framework for building files that install and configure your software for the users system. It is designed to abstract differences between Linux distributions behind an API designed specifically for installing files.

Having said that, it also provides functionality to the user, developer and system administrator. This document will introduce you to the key concepts behind how autopackage works, and will show you the basics of how to operate it. It's targetted at developers.

Key concepts

The first thing that you must understand is that autopackage is designed for portability between forms of Linux. In fact, any reasonably Linux-like system will do, with some work it could probably, for instance, work on FreeBSD as well.

This is achieved by providing an API that allows the packager to specify how their software is to be installed, in a way that lets autopackage take care of the obscure differences. The API provides functions such as installLib(), which takes care of copying the ELF shared library file, updating the linker cache, ensuring the necessary symlinks are present, and potentially updating the linker configuration file, if the prefix to be installed to is non-standard.

It also provides APIs for specifying dependencies. Dependencies in autopackage are heavyweight, that is, they are backed by what are called skeleton files. These files describe a dependency, how to detect it, and how to fulfil it if it missing on the users system.

A dependency that a package has is typically a dependency on an interface. Software meant to be reused by other software exposes a set of interfaces. For ELF shared libraries, that interface is the ABI of the library. There are strict rules about what can and cannot change, and how to version them. However, other packages have interfaces too. For instance, XMMS exposes a plugin interface to other software. Programs written in emacs lisp take advantage of the interface emacs provides. An interface can be something as simple as the location of a file.

Versions and root names

Packages are identified using root names. A root name has two different forms:

Example root name Type Comments
@autopackage.org/libfoobar Unversioned root name This type of root name represents a particular set of software, namely all possible versions of the libprefixdb library.
@autopackage.org/libfoobar:1.0.0:2 Versioned root name The number after the first colon is what we call a software version (see below).

Version numbers

Autopackage distinguishes between several different kinds of version numbers. Here is a list of them:

Skeleton Files

Skeletons are identified by an unversioned root name. They are also versioned, but by a simple integer. The latest version of a skeleton always takes precedence, they cannot break backwards compatability.

They typically consist of a small amount of metadata, followed by a test script, and a retrieval script. The test script examines the system and produces a list of interfaces supported by the system, and stores them in the INTERFACE_VERSIONS variable. The Notes section can be used to record any oddities in the way INTERFACE_VERSIONS is calculated.

The autopackage APIs run this script and match against a given interface version. If no match is found, the skeletons Retrieval script is executed. Normally that will simply palm off to another autopackage provided function, retrieve(), which does its best to locate a package file for the given unversioned root name that fulfils the requested interface. In fact this is the default behaviour if the Retrieval section is missing.

APIs provided

Autopackage provides a large library of functions that make writing install scripts easier. For instance, there are functions to copy files and install common file types, which perform any special actions such as updating databases that are needed.

There are also APIs for performing dependency resolution. These are normally what you'd use in your own scripts and skeleton files, but it's not a hard requirement.

You can read the API reference online.