Package Specification 1.0 Working draft
Rolf Veen, 12 Nov 2004. License TBD.

1. Introduction

The package format described in this document is based the following principles:

2. Life cycle

FunctionTasks
Download
  • Get the files from URLs found in a descriptor. This includes external patches.
  • Place the files in a local repository. Files should not overwrite any previous version or files from other packages.
  • Files can also come from a CVS or similar repository .
Unpack
  • Unpack the files corresponding to a package release into a working directory. This includes patches (but we should be able to select which ones).
Build
  • Cope with non-standard procedures, such as java or binary packages (no build).
  • Dependencies and the ./configure script.
  • Different needs: cross-compiling, merge into system, make chroot system, /packages versus /.
Install
  • Preserve configuration information
  • Some packages can be installed more than once (slotted).
  • Virtual packages (webserver, mailserver ...).
  • Package information database formats.
  • Init and cron tasks
Uninstall

When installing a package there are some defined phases:

2.1. Versioning

Several versions of the same package can be installed on one system, but only one is the default, the one that has unversioned system-wide names.

2.2. Dependecies

Dependencies between source packages can be required or optional. The optional dependecies may need to be controlled throught configuration switches or they may be detected at build time. Dependencies between binary packages can also be required or optional, but should in general not need any runtime switch or adjustment.

The package descriptor lists only the runtime dependencies, in the form of package names and optionally a version number. It is responsibility of the package manager to solve any required dependencies.

2.3. Package archive names

Binary packages:  pkg-version.arch.ext
Source packages:  pkg-version.ext | pkg-version.src.ext

3. The (binary) package descriptor (pkg.g)

name grep
version 2.4.2

web www.gnu.org/software/grep/

needs make

description \
    The GNU family of grep utilities may be the "fastest grep in the west".
    GNU grep is based on a fast lazy-state deterministic matcher (about
    twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper
    search for a fixed string that eliminates impossible text from being
    considered by the full regexp matcher without necessarily having to
    look at every character. The result is typically many times faster
    than Unix grep or egrep. (Regular expressions containing backreferencing
    will run more slowly, however.)

scripts
    pre-install \
        cd work || exit -1
        rm -rf *
        unarchive
        cd $package-$version || exit -1

        export CPPFLAGS=-Dre_max_failures=re_max_failures2 &&
        ./configure --prefix=$PWD/dist --disable-nls &&
        unset CPPFLAGS &&
        make LDFLAGS=-static &&
        make install

    install \
        # remove busybox link
        rm -f $destdir/bin/grep

        cd work/$package-$version || exit -1
        cp dist/bin/* $desdir/bin/

4. Package layout

Package hierarchy (an example)
.
|-- bin
|-- data
|-- doc
|   |-- info
|   |-- man
|   `-- web
|-- include
|-- lib
|-- log
|-- pkg.g
|-- share
`-- src.g




packages.htm