Table of Contents

Recipes

This document describes the opportunities offered by the recipes used by Tazwok to compile and generate packages for SliTaz and Tazpkg through The wok and tools. The recipe for a package is also used by Tazpkg to install/uninstall and provide information about a .tazpkg package. Each recipe 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="ncurses"
BUILD_DEPENDS="ncurses-dev"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://www.clex.sk/"
WGET_URL="http://www.clex.sk/download/$TARBALL"
CONFIG_FILES="/etc/netatalk/AppleVolumes.* /etc/netatalk/*.conf"

You can also define virtual packages with this variable. The lines PROVIDE=“libgl” in the mesa package and PROVIDE=“libgl:nvidia” in the nvidia-glx package, define that libgl is an optimized version when the nvidia package is installed.

Variables generated by Tazwok

Certain factors are known only during the cooking of a package or after the package has been cooked. Tazwok will add them to the recipe automatically.

Variables used in functions

Cookutils configures several variables that facilitate the compilation and construction of Tazpkg packages. These variables are controlled automatically by cookutils using the information contained in the recipe; they can be used by the functions compile_rules and genpkg_rules described in the chapter Functions.

Functions

A recipe 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's 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 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..."
}

pre_remove() and post_remove()

These functions are initiated by Tazpkg when removing 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 remove commands for Tazpkg.
pre_remove()
{
	echo "Processing pre-remove commands..."
}
post_remove()
{
	echo "Processing post-remove commands..."
}

clean_wok() (deprecated)

This is useless with latest cookutils, source are all uncompressed in wok/pkg/source to keep build wok clean and structured.

This function helps to define additional commands to be run when cleaning the wok, it is useful to delete files or directories that are not supported by Tazwok:

# clean commands for Tazwok.
clean_wok()
{
	rm -rf $WOK/$PACKAGE/vim71
}