cookutils view README @ rev 325

Edit cookiso
author Paul Issott <paul@slitaz.org>
date Thu Mar 15 20:52:25 2012 +0000 (2012-03-15)
parents 9109770afce4
children 38fc81ba44de
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 Cookiso
98 -------------------------------------------------------------------------------
99 Cookiso is the official tool to automate the ISO build. The goal is to provide
100 a simple to use, rock solid tool with a web interface à la Cooker. It shares
101 configuration and templates with the Cooker but can be run on its own so it
102 can be used by contributors or customers to automate custom ISO building.
103 Cookiso must be run in a chroot which can be the same chroot as the Cooker.
105 Cookiso is also used to build rolling ISOs by tracking changes in a packages
106 list or Hg repository. The rolling command is designed to be run by cron
107 in a chroot environment. Here are some usage examples:
109 # cookiso setup
110 # cookiso gen --flavors="base justx"
111 # cookiso gen --flavors=base --version=cooking
114 Toolchain
115 --------------------------------------------------------------------------------
116 To rebuild the full SliTaz toolchain at once - cook and the Cooker will use the
117 slitaz-toolchain package. No built-in code manages that since it is not a
118 common task. The toolchain package will build all needed packages in the correct
119 order, which is very important.
122 Coding style
123 --------------------------------------------------------------------------------
124 Here are the cookutils coding style notes, follow them if you want your code
125 included in the package.
127 * In all cases: KISS
128 * Use tab and not space to indent
129 * Max 80 char by line (try to edit in a Xterm 80x24)
130 * Use names rather than $1 $2 $3
131 * Variables from config file are $UPPERCASE
132 * Variables initialized by cook are $lowercase
133 * Functions can be a single word or use_underline()
134 my_function() {
135 echo "Hello World"
136 }
137 * Use $(command) and not: `command`
138 * Cook uses gettext for messages, not the cooker
139 * If you add a feature, add also the doc to explain it
140 * Use clean case with space before case end ;;
141 case "$pkg" in
142 a) echo "Hello World" ;;
143 *) continue ;;
144 esac
145 * Make commands and options as short as possible
146 * Think to log everything to help debug
147 * Quote variables if used in a test: [ "$var" ]
150 ================================================================================