cookutils view README @ rev 256

Tiny edits
author Paul Issott <paul@slitaz.org>
date Sun May 29 21:00:54 2011 +0100 (2011-05-29)
parents edcda368442c
children 677fbd5cf708
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
29 Cook does not:
31 * Depend on Hg but can use it to manage a wok
32 * Do complex work like compiling the whole system from source in
33 one command (but it can rebuild the full system step by step).
34 * Check build deps for you, use: BUILD_DEPENDS
35 If all deps are also build deps do: BUILD_DEPENDS="$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.desc Packages with name, version, category, desc
60 * packages.equiv Equivalent packages list
61 * files.list.lzma A list of files provided by all packages
64 Cooker
65 --------------------------------------------------------------------------------
66 The Cooker is a Build Bot which automates the build process but doesn't make
67 the dinner for you! We need quality receipts to cook succesfully and the goal
68 is not to have a bloated script so please Keep It Short and Simple.
70 Cmdline tool : /usr/bin/cooker
71 Web interface : /var/www/cgi-bin/cooker
72 Cache folder : /home/slitaz/cache
74 The web interface consists of one CGI script and one CSS style. Cook logs can
75 be produced by cook and the cooker just acts as a fronted to check them in
76 a nice way. A web interface also highlights success and error and can show
77 receipts and the cooker logs such as the last ordered list or commits check.
79 Database files in the cache folder
81 * activity : Activity information for the web interface
82 * blocked : List of manually blocked packages
83 * broken : Broken packages list, when cook fails it is added here
84 * commits : List of packages of the last commit check
85 * cooklist : Cooklist for unbuilt packages or custom commands
86 * cooknotes : All the notes added with 'cooker -n "My note"
87 * installed* : Lists used to compare installed packages before and after
88 a package is cooked so we can remove them
90 The Cooker web interface can by highly customized through the CSS style and via
91 an optional header.html file that must be in the same directory as the CGI
92 script, like for style.css and a custom favicon. You can find a header.html
93 example in the data/ directory or in /usr/share/cook if cookutils are installed.
96 Toolchain
97 --------------------------------------------------------------------------------
98 To rebuild the full SliTaz toolchain at once - cook and the Cooker will use the
99 slitaz-toolchain package. No built-in code manages that since it is not a
100 common task. The toolchain package will build all needed packages in the correct
101 order, which is very important.
104 Coding style
105 --------------------------------------------------------------------------------
106 Here are the cookutils coding style notes, follow them if you want your code
107 included in the package.
109 * In all cases: KISS
110 * Use tab and not space to indent
111 * Max 80 char by line (try to edit in a Xterm 80x24)
112 * Use names rather than $1 $2 $3
113 * Variables from config file are $UPPERCASE
114 * Variables initialized by cook are $lowercase
115 * Functions can be a single word or use_underline()
116 my_function() {
117 echo "Hello World"
118 }
119 * Use $(command) and not: `command`
120 * Cook uses gettext for messages, not the cooker
121 * If you add a feature, add also the doc to explain it
122 * Use clean case with space before case end ;;
123 case "$pkg" in
124 a) echo "Hello World" ;;
125 *) continue ;;
126 esac
127 * Make commands and options as short as possible
128 * Think to log everything to help debug
129 * Quote variables if used in a test: [ "$var" ]
132 ================================================================================