cookutils view README @ rev 262

README: small update
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jun 07 12:12:41 2011 +0200 (2011-06-07)
parents 677fbd5cf708
children 9109770afce4
line source
1 SliTaz Cookutils
2 ================================================================================
5 The SliTaz Cookutils provide tools and utils to build SliTaz packages.
8 Cook
9 --------------------------------------------------------------------------------
10 The cook tool should be used in a chroot environment: simply use the command
11 'tazdev gen-chroot' to build one. You can also build packages directly but
12 build deps will not be handled correctly since cook will install missing
13 packages to perform a build and then remove them only if they were not
14 installed before, this way we can keep a clean build environment.
16 We use standard SliTaz paths to work such as /home/slitaz/wok, if you work on
17 cooking from stable or want to keep a clean system: create a chroot.
19 Cook features:
21 * Setup a build env
22 * Check and install missing build deps
23 * Compile and generate the package
24 * Remove installed build deps
25 * Provide a log for each cook
26 * Clean one or all packages in the wok
27 * Check for receipt and package quality
28 * Clean chroot even on Ctrl-C
30 Cook does not:
32 * Depend on Hg but can use it to manage a wok
33 * Do complex work like compiling the whole system from source in
34 one command (but it can rebuild the full system step by step).
35 * Check build deps for you, use: BUILD_DEPENDS
36 * The work of a Build Bot, unix philosophy: one tool for one task
37 * Cook a package if your receipt is crappy :-)
39 Cook paths variables used in receipt:
41 * $src : Package source: wok/pkg/source
42 * $stuff : Package stuff: wok/pkg/stuff
43 * $fs : Package file system: wok/pkg/taz/*/fs
44 * $install : All installed files by the package
45 Old style is $_pkg and cook is compatible
47 Cook internal paths variables:
49 * $pkgdir : Package directory in the wok: wok/pkg
50 * $receipt : Package receipt in wok: wok/pkg/receipt
51 * $taz : The taz directory: wok/pkg/taz
52 * $pack : Package to compress: wok/taz/pkg-*
54 Cook also manages packages lists so they can be used for a personal packages
55 repository or sent to the official mirror. We create and use:
57 * packages.list Simple list of package-versions
58 * packages.md5 MD5sum list of all packages
59 * packages.txt List of packages with version, desc and sizes
60 * packages.desc Packages with name, version, category, desc
61 * packages.equiv Equivalent packages list
62 * files.list.lzma A list of files provided by all packages
65 Cooker
66 --------------------------------------------------------------------------------
67 The Cooker is a Build Bot which automates the build process but doesn't make
68 the dinner for you! We need quality receipts to cook succesfully and the goal
69 is not to have a bloated script so please Keep It Short and Simple.
71 Cmdline tool : /usr/bin/cooker
72 Web interface : /var/www/cooker
73 Cache folder : /home/slitaz/cache
75 The web interface consists of one CGI script and one CSS style. Cook logs can
76 be produced by cook and the cooker just acts as a fronted to check them in
77 a nice way. A web interface also highlights success and error and can show
78 receipts and the cooker logs such as the last ordered list or commits check.
80 Database files in the cache folder
82 * activity : Activity information for the web interface
83 * blocked : List of manually blocked packages
84 * broken : Broken packages list, when cook fails it is added here
85 * commits : List of packages of the last commit check
86 * cooklist : Cooklist for unbuilt packages or custom commands
87 * cooknotes : All the notes added with 'cooker -n "My note"
88 * installed* : Lists used to compare installed packages before and after
89 a package is cooked so we can remove them
91 The Cooker web interface can by highly customized through the CSS style and via
92 an optional header.html file that must be in the same directory as the CGI
93 script, like for style.css and a custom favicon. You can find a header.html
94 example in the data/ directory or in /usr/share/cook if cookutils are installed.
97 Toolchain
98 --------------------------------------------------------------------------------
99 To rebuild the full SliTaz toolchain at once - cook and the Cooker will use the
100 slitaz-toolchain package. No built-in code manages that since it is not a
101 common task. The toolchain package will build all needed packages in the correct
102 order, which is very important.
105 Coding style
106 --------------------------------------------------------------------------------
107 Here are the cookutils coding style notes, follow them if you want your code
108 included in the package.
110 * In all cases: KISS
111 * Use tab and not space to indent
112 * Max 80 char by line (try to edit in a Xterm 80x24)
113 * Use names rather than $1 $2 $3
114 * Variables from config file are $UPPERCASE
115 * Variables initialized by cook are $lowercase
116 * Functions can be a single word or use_underline()
117 my_function() {
118 echo "Hello World"
119 }
120 * Use $(command) and not: `command`
121 * Cook uses gettext for messages, not the cooker
122 * If you add a feature, add also the doc to explain it
123 * Use clean case with space before case end ;;
124 case "$pkg" in
125 a) echo "Hello World" ;;
126 *) continue ;;
127 esac
128 * Make commands and options as short as possible
129 * Think to log everything to help debug
130 * Quote variables if used in a test: [ "$var" ]
133 ================================================================================