SliTaz GNU/Linux official and community documentation wiki.
.png
Translations of this page:

This is an old revision of the document!


Wok & Tools

Overview

The SliTaz project uses a variety of small utilities to automatically rebuild the distribution from source. Tazwok is used to compile and generate code (cooking) via instructions found in the receipts. The project also offers an archive of tools containing various small utilities, examples and configuration files. The distribution generator Tazlito is designed for users and developers; it can retrieve and reconstruct a LiveCD ISO image and generate a distribution flavor from a list of packages, a configuration file and a description. The utilities are all distributed as a source archive and are installed by default on SliTaz.

Developers and future contributors can refer to the development page that provides information on SliTaz project management.

Wok Structure and Organisation

The wok is a directory structure that houses all the available packages. Each directory contains at least one receipt to download, unpack, compile and generate a package. Tazwok also needs to create a directory to store downloaded sources ($SOURCES_REPOSITORY, usually /home/slitaz/src) and a repository of generated packages ($PACKAGES_REPOSITORY, usually /home/slitaz/packages); these values can be configured in the /etc/tazwok.conf file.

There is more than one Wok on the Mercurial repositories:

  • wok-undigest: contributions awaiting testing/bug-fixing for inclusion in the unstable Wok
  • wok: packages for the unstable, Cooking release
  • wok-stable: packages for the stable SliTaz release

Initially, any contributions will be committed to the undigest repository. When the package has seen sufficient testing with regards to automatic generation, it can be moved to the Wok.

Preparation

To begin using the Wok, Tazwok must already be installed on the system along with the main development tools (binutils, compiler, libraries-dev, make). This requires you to install the meta-package slitaz-toolchain:

tazpkg recharge
tazpkg get-install slitaz-toolchain

To access the SliTaz repositories, you will need to install the mercurial package:

tazpkg get-install mercurial

Cloning the Wok

If you are to generate a package for inclusion in the SliTaz repositories, it is necessary to first obtain the current wok by using Mercurial. This is called cloning the Wok, a procedure that downloads the entire Wok and all its history to a working directory. If you wish to only use Tazwok to build packages for personal use, this is not necessary.

The Wok is one of many projects hosted in the Mercurial repositories. Individual packages are grouped as a large project (the Wok, Wok-Stable or Wok-Undigest) and is not its own sub-project but merely a sub-directory; Mercurial cannot (yet) clone specific parts of a project thus you cannot clone an individual package.

The usual destination for a Wok clone is /home/slitaz/wok:

hg clone http://hg.slitaz.org/wok/ /home/slitaz/wok 

The archives are also available from TuxFamily via FTP; just take the latest version from the cooking or undigest directories.

Before compiling your first package, Tazwok must know where your working directory is. By default the path is /home/slitaz/wok but you can change this or rename the wok that you want to download. To view and check Tazwok paths that will be used, and the number of packages in the wok, you can ask Tazwok for statistics:

 tazwok stats 

Compiling and Generating Packages

The process for generating a SliTaz package from source can be summerised thus: configure, compile & strip.

We do not carry out the 'make install'-style step ourselves; the built files are not to be installed in the system but left in the output directory, ready for packaging.

When generating your first package, it is advisable to keep it simple and build your package without changing its receipt or seeking dependencies. M4 is an ideal candidate for your first cook:

 tazwok cook m4 

When Tazwok has finished building M4, its package is placed in the directory specified by the configuration file (/home/slitaz/packages by default). If all went well, you can install the package on the host system or use it to generate a LiveCD distribution via Tazlito!

To create a new package, you can use new-tree with the option –interactive, and begin to build your receipt. Be sure to read the documentation on the options provided by the receipt and the Tazwok Tips to avoid frustration!

Cook-list - List of cooking

To compile several packages with a single command, you can use a cooking list. There are example lists in usr/share/examples/tazwok/cooklists on SliTaz, these are just text files with a package put on every line. Cook-list example using mypkgs.cooklist:

 tazwok cook-list mypkgs.cooklist 

Options during compilation of package

You are free to use any options you want, it is necessary to respect the FSH, the docs in /usr/share/doc and follow the Freedesktop standards (.desktop). Then it's just a question of choice, for example you can disable support for XML, have smaller binaries for PHP and get rid of libxml2, but in the case of PHP, it's not worth the cost in terms of loss of functionality. If you have any doubts, look at the receipts and compiler options in compile_rules.

Optimization

The official SliTaz packages are optimized for i486, the optimization arguments used to configure are specified in /etc/tazwok.conf and can be called via the variable $CONFIGURE_ARGS. If you want to compile a package with different arguments, you can modify the Tazwok configuration file:

CONFIGURE_ARGS="--build=i486-pc-linux-gnu --host=i486-pc-linux-gnu"

Files included or excluded package

Generally the base packages contain no man, info, doc or static libraries, we have to create them via a package-doc or a package-dev. Note that SliTaz is not intending to use the man or info command, so there's no manual or GNU info file. The creation of packages containing docs is really optional, especially if the material is in English (I say). By contrast a piece of text on the package in the Handbook is more appreciated.

In terms of configuration, whenever possible, the aim is to offer basic configuration files to run the package directly. In the case of the web server LightTPD package, SliTaz supplies configuration files and startup scripts located in /etc/init.d (documented in the Handbook). For a new package, you are free to choose its default configuration depending on what you think is easiest for the end user. On SliTaz you have /usr/share/examples for example configurations and other kinds of useful infomation.

Categories of packages

The categories of packages exist only for informational purposes and are not fixed, the idea is to classify packages so that a web page can be generated each night recovering data in the package receipt. For the short term, place developement packages in 'devel', Xorg in 'x-window' and the variety of new packages in 'extra'

Structure of a package in the wok

The structure of the packages in the wok should always be respected so that Tazwok can find the correct files and directories. Possible contents of a package (note the directory taz/ is created at time of cooking):

  • stuff/ : The material used to configure, compile and generate the package (patch(es), Makefile, pseudo fs, etc).
  • taz/ : Directory tree containing the package Tazpkg generated, the compressed package is stored in the directory specified by $PACKAGES_REPOSITORY in the Tazwok configuraton file.
  • receipt : The receipt (see receipts).
  • description.txt : (optional) The description of the package is copied to the root of the Tazpkg package. Once installed, Tazpkg knows how do deal with this file via 'tazpkg desc pkgname'.

Structure of a Tazpkg package

The SliTaz packages are cpio archives containing files and a filesystem compressed with gzip:

  • fs/ : Pseudo filesystem containing all the files to install.
  • receipt : The receipt (see receipt.txt).
  • files.list : A list of files in the package.
  • description.txt : The description of the package (optional).
 
en/cookbook/wok.1276961910.txt.gz · Last modified: 2010/07/08 17:17 (external edit)