SliTaz Cook & Cooker
The SliTaz Cookutils provide tools and utils to build SliTaz packages. They are easy to use and learn, fast and light. You will be able to create SliTaz in a few commands. The cookutils provide the 'cook' utility and the Cooker.
Cook let you compile and create a package, provide a log file and check receipt/package quality. The Cooker is a build bot with more automation and can be used as a frontend to cook, since it provide a CGI/web interface who let you view cook logs in a nice and colored way.
Cook usage
Cook provide a small built-in help usage that you can display with the command:
# cook usage
Howto work
The first thing you will have to do before building packages is to setup your environment. These 2 recommended way to work: cook directly on host or cook in chroot to protect your host. In the case you want to work in a chroot you can install and use Tazdev to create one and chroot in it:
# tazdev gen-chroot && tazdev chroot
By default Tazdev create a chrrot in /home/slitaz/cooking/chroot but you can specify a custome path in argument. The chroot place is not important, when you will be in the chroot you will use standard SliTaz path such as /home/slitaz/wok for the wok directory or /home/slitaz/log for all the cook logs. As usual you can diplay tazdev help usage with: tazdev usage
Getting started
So you decided the way you want to work, so let prepare the cook environement. Cook use cook.conf configuration file, if you want to use custom path for SliTaz directories and files, you have to modify it. The setup will create some directories and files to keep trace on activity and error, all files are pure plain text files that you can open in a text editor. To prepare you environment:
# cook setup
The setup command have a --wok option who let you clone SliTaz wok while setting up your cook environment. Even if you not yet an official developers you can clone it and use existing packages as example to create your own. To setup and clone the wok:
# cook setup --wok
Test your environment
Cook provide a test command who will create a package and cook it. This let you see if your enviroment and by the it provide and example package with a receipt. The create package is named 'cooktest' and can be removed after testing. To cook the cooktest:
# cook test
Create and cook
If you environment is setup corectly you can start creating and compiling SliTaz packages from your wok. To create a new package with an empty receipt:
# cook new pkgname
If you just created a new package, you have to edit the receipt with your favorite text editor. When the receipt is ready or if you have existing packages, you can cook it:
# cook pkgname
If all went well you will find your packages in $SLITAZ/packages directory and produced files in $SLITAZ/wok/pkgname. If you want to cook and install the package in one command:
# cook pkgname --install
Clean packages
After compilation and packaging ther is several files in the wok that take disk space. To clean a single package:
# cook pkgname --clean
You can also clean the full wok at once or you can choose to keep SliTaz related files and just remove the source:
# cook clean-wok # cook clean-src
Packages lists
Cook can list packages in the wok but also create suitable packages list for Tazpkg. That let you create a locale packages repository quiet easily and is used to create official SliTaz packages list found on mirrors. To list the current wok used by cook (you dont need to be root):
$ cook list-wok
To create packages lists:
# cook pkglist
The Cooker
The Cooker is a Build Bot, it first usage is to check for commits in a wok, create an ordered cooklist and cook all modified packages. It can also be used as a frontend to cook since they use the same files. The Cooker can also be used to cook a big list of packages at once such has all package of a flavor. The Cooker provide a nice CGI/Web interface that works by default on any SliTaz system since we provide CGI support via Busybox httpd web server.
The Cooker provide a small built-in help usage and short command switch. For example to display usage you can use:
# cooker usage # cooker -u
Cooker setup
Like cook, the Cooker needs a working environment before starting using it. The main difference with the cook environment is that the Cooker needs 2 wok. One Hg and clean wok as reference and one build wok, in this way is is easy to compare both wok and get modifications. If you already have a cook environement, you must move your wok before setting up the Cooker or it will complain. Setup will also install a set of development packages that can be configured in the cook.conf configuration file and the variable SETUP_PKGS. To setup your cooker environment:
# cooker setup
If all went well you have now 2 wok, base developement packages installed and all needed files created. The default behavor is to check for commits, you can run a test:
# cooker
Cooker cook
Again, 2 way to work now: make change in the clean Hg wok and launch the cooker without any argument or cook packages manually. The cooker let you cook a single package, all packages of a category or a flavor. You can also try to build all unbuilt packages, but be aware the Cooker was not designed to handle thousand of packages.
To cook a single package wich is the same than 'cook pkgname' but with more logs:
# cooker pkg pkgname
To cook more than one package at once you have different kind of choices. You use an existing package such as used for Live flavors, you can also use a custom list with packages name line by line. Finaly you can build all packages of a category.
# cooker flavor [name] # cooker list [/path/to/cooklist] # cooker cat [category]
Cooker CGI/Web
To let you view log files in a nice way, keep activity trace and help find errors, you can use the Cooker Web interface located by default in the folder /var/www/cgi-bin/cooker. If you dont use a chroot and the Busybox httpd web server is running, the web interface will work without configuration and should be reachable at: http://localhost/cgi-bin/cooker/cooker.cgi
If you used a chroot environment, you should also install cookutils on your host and modify the SLITAZ path variable. A standard working way is to have a chroot in:
/home/slitaz/cooking/chroot
With /etc/slitaz/cook.conf modified as bellow:
SLITAZ="/home/slitaz/cooking/chroot/home/slitaz"
Note: It's not obligatory to install the cookutils on your host to use the web interface, you can also copy the cooker.cgi and style.css files for example in your ~/Public directory and use a custom cook.conf with it. The advantage of installing cookutils on the host is to get regular update via Tazpkg packages manager. Say you have cloned or downloaded the cookutils:
$ cp -a cookutils/web ~/Public/cgi-bin/cooker $ cp -f cookutils/cook.conf ~/Public/cgi-bin/cooker
Edit the configuration file: ~/Public/cgi-bin/cooker/cook.conf to set SLITAZ path and you all done!
Cooknotes
The cooknotes feature let you write small personnal notes about packaging and is usefull for collaboration. The cooknotes was coded to let SliTaz Cooker bot maintainer share notes between them self and other contributors. The Cooker can block packages build or recook packages manually, for example it's nice to make a note if a package is blocked so the maintainer know why admin did that. Cooknotes are displayed on the web interface and can be checked from cmdline:
# cooker note "Blocked pkgname due to heavy CPU load" # cooker notes