GPack Packages Howto

$ Id: $

This document will give all the details required to build your own SATPKG
files and GPack packages.

REMEMBER: SATPKG files are specialised [ba]sh scripts, and therefore are
constrained to the same syntax of the [ba]sh.

WARNING: There are many [ba]sh variables which are accesible via the SATPKG
file, these should not be modified in _any_ way. Doing so will most likely
result in a corrupted package and possibly a modified base system.


SATPKG BASIC STRUCTURE:
    GPACK SPECIAL VARIABLES (DO NOT CHANGE!):
    SRC
        The directory where the source files were extracted.

    PKG
        The directory where all files which are to be in the package are
	located.

    PKGMK_SOURCE_DIR
        This variable is present to ensure that GPack can build CRUX
        packages.

    PKGMK_PACKAGE_DIR
        See PKGMK_SOURCE_DIR

    VARIABLES:
    name
        Package Name

    version
        Package Version

    release
        Package Release

    license (optional)
        Package/Program License

    group (optional)
        Package Group

    depends (optional)
        Array of required dependancies.

        Dependancy Element Format:
            DependancyName >= version
                A version requirement (above of equal) for dependancy
		DependancyName.

            DependancyName <= version
                A version requirement (less than of equal) for dependancy
		DependancyName.

            DependancyName
                A simple dependancy without version requirements.

    optdeps (optional)
        Array of optional dependancies.

    source (optional)
        Array of source files required to build the package.

    FUNCTIONS:
    build
        The main function which actually constructs the package.

    pre_install (optional)
        A function which is ran before installing the package.

    post_install (optional)
        A function ran after a package is installed.

    pre_remove (optional)
        A function ran before a package is removed from the system.

    post_remove (optional)
        A function ran after the package has been removed from the system.


PACKAGE BUILD PROCESS:
    The package build process is quite simple and can be followed in 5
    steps.

    1. GPack will check for the required dependancies, handling
    them appropriately.

    2. GPack will check to see if the source files are available
    locally (ie. if they have already been downloaded), if not GPack will
    proceed to download them (using GNU wget).

    3. GPack will extract any tar.gz and tar.bz2 files into the $SRC
    directory and then change the current directory to $SRC.

    4. GPack will then proceed to execute the function 'build', which will
    build the package and install _all_ files prefixed with $PKG.

    5. GPack then adds its own files to the directory $PKG before creating
    a tar.gz archive of the final package.


STANDARD PACKAGE NAMING CONVENTION:
    The standard package naming convention is:
        name-version.gpack.tar.gz

    If needed, the standard package naming convention will change to include
    the package release in the name (eg. name-version-release.gpack.tar.gz).
    Support for bz2 packages may also be added (to allow smaller packages).


EXAMPLES:
    For example of (non-functional) SATPKG file, see SATPKG.template

    *More working examples will be provided here, especially the SATPKG files
    used by SatGNU GNU/Linux.*

- nym

