Receipts
This document describes the opportunities offered by the receipt used by Tazwok to compile and generate packages for SliTaz and tazpkg through The wok and tools. The receipt for a package is also used by tazpkg to install/uninstall and provide information about a .tazpkg package. Each receipt begins with a comment in English:
# SliTaz package receipt.
Variables
The first 5 variables should always be present and defined. They respectively configure the package ($PACKAGE), its version, its category, provide a short description and the name of the maintainer. Example for the package, file manager Clex:
PACKAGE="clex" VERSION="3.16" CATEGORY="base-apps" SHORT_DESC="Text mode file manager." MAINTAINER="pankso@slitaz.org"
Variables (optional)
Tazwok also knows how to use various optional variables. It can, for example, use the name of another source package. There are also variables that are used by tazpkg to manage dependencies or provide information about the package.
$DEPENDS
: Set dependencies, there may be several dependencies
seperated by a space or on several lines. This variable is used mainly by
tazpkg when installing the package and tazwok to build large packages such
as Xorg. Example for Clex which depends on ncurses:
DEPENDS="ncurses"
$BUILD_DEPENDS
: Set compilation dependencies, again seperated
by a space or several lines. This variable is used by tazwok during the
cooking of a package. Example:
BUILD_DEPENDS="ncurses-dev"
$TARBALL
: The archive is a source with the extension (tar.gz,
tgz or tar.bz2). In general, the variables $PACKAGE and $VERSION are used to
just change the extension, it helps to upgrade the package without changing
the $VERSION variable. Generic example (see also $SOURCE example):
TARBALL="$PACKAGE-$VERSION.tar.gz"
$WEB_SITE
: The official website of the package. It may be that
some libraries have no website, in this case, there is no need to specify a
URL. Note tazwok and tazpkg both expect to find a URL with the complete HTTP:
WEB_SITE="http://www.clex.sk/"
$WGET_URL
: URL to download the source file. In general the
variable $TARBALL should be used to facilitate the updating of the package
without changing the $VERSION. Using a configuration file, tazwok also
configures by default 3 mirrors: $GNU_MIRROR for the GNU mirror, $SF_MIRROR
for SourceForge and XORG_MIRROR for mirroring the graphical server Xorg.
Example for Clex:
WGET_URL="http://www.clex.sk/download/$TARBALL"
$WANTED
: SliTaz packages normally depend on the compilation of
a source package. Sometimes the receipt of a package requires no compilation
of rules, then $WANTED is used to copy files from the source of another
package by using the variable $ src.
$SOURCE
: It may be that the tazpkg package name differs from
the name of the source package. Example for Xorg packages, the name of tazpkg
library X11 is 'xorg-libX11' and the name of the package source is libX11.
$SOURCE allows you to use the variables $src and $_pkg during the cooking of
a package. It should be noted that in the case of libX11, the name of the
source archive becomes $SOURCE-$VERSION.tar.gz.
Variables used in functions
Tazwok configures several variables that facilitate the compilation and construction of tazpkg packages. These variables are controlled automatically by tazwok using the information contained in the receipt; they can be used by the functions compile_rules and genpkg_rules described in the chapter Functions.
$src
: Defines the path to the directory of unarchived sources.
$_pkg
: Defines the path to the compiled binaries installed via
'make DESTDIR=$PWD/_pkg install'. This variable is used to copy the generated
files and create tazpkg packages.
$fs
: Defines the path to the pseudo filesystem (fs) in each
package. The 'fs' of the package corresponds to the root of the system, a bit
like Clex will for example be in $fs/usr/bin/clex. Note the need to create the
necessary directories via function genpkg_rules() before copying the files.
$CONFIGURE_ARGS
: This variable is defined in the Tazwok
configuration file (tazwok.conf). It allows you to specify generic optimization
arguments during construction of a package. Default is the i486 architecture.
Functions
A receipt may contain 4 functions. Tazwok knows how to deal with functions containing compilation rules (compile_rules) and rules used to generate a package (genpkg_rules). These functions may contain all sorts of GNU/Linux standard commands, such as sed, awk, patch and variables automatically configured.
compile_rules()
To compile a package you can use the variable $src to move (cd) in the directory of sources and use $CONFIGURE_ARGS to include arguments from the tazwok configuration file. To build the package you usually launch 'make' without any arguments, and to install the package into the directory _pkg, it is necessary to use the command 'make DESTDIR=$PWD/_pkg install'. Generic example:
# Rules to configure and make the package. compile_rules() { cd $src ./configure --prefix=/usr --infodir=/usr/share/info \ --mandir=/usr/share/man $CONFIGURE_ARGS make make DESTDIR=$PWD/_pkg install }
genpkg_rules()
To generate a tazkg package we must specify commands in the function
genpkg_rules
. In this example we create a psuedo directory
usr/
in the filesystem of the package, copy the whole
binary(s) and finally use strip to clean the files:
# Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr cp -a $_pkg/usr/bin $fs/usr strip -s $fs/usr/bin/* }
pre_install() and post_install()
These 2 functions are initiated by tazpkg when installing the package. They must be defined before generating the .tazpkg package with tazwok. If no rules are given for these functions, they have no raison d'etre and can be removed. Example using echo to display some text (no function should be empty):
# Pre and post install commands for Tazpkg. pre_install() { echo "Processing pre-install commands..." } post_install() { echo "Processing post-install commands..." }