cookutils view README @ rev 370

cross: use default system config file or the one in current dir
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 10 21:10:04 2012 +0200 (2012-05-10)
parents 39758ce8dc72
children 9a25f14daae5
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 Cross
115 -------------------------------------------------------------------------------
116 See : doc/cross.txt
117 Istall: make install-cross
118 Usage : cross usage
119 Howto : cross howto
122 Toolchain
123 --------------------------------------------------------------------------------
124 To rebuild the full SliTaz toolchain at once - cook and the Cooker will use the
125 slitaz-toolchain package. No built-in code manages that since it is not a
126 common task. The toolchain package will build all needed packages in the correct
127 order, which is very important.
130 Coding style
131 --------------------------------------------------------------------------------
132 Here are the cookutils coding style notes, follow them if you want your code
133 included in the package.
135 * In all cases: KISS
136 * Use tab and not space to indent
137 * Max 80 char by line (try to edit in a Xterm 80x24)
138 * Use names rather than $1 $2 $3
139 * Variables from config file are $UPPERCASE
140 * Variables initialized by cook are $lowercase
141 * Functions can be a single word or use_underline()
142 my_function() {
143 echo "Hello World"
144 }
145 * Use $(command) and not: `command`
146 * Cook uses gettext for messages, not the cooker
147 * If you add a feature, add also the doc to explain it
148 * Use clean case with space before case end ;;
149 case "$pkg" in
150 a) echo "Hello World" ;;
151 *) continue ;;
152 esac
153 * Make commands and options as short as possible
154 * Think to log everything to help debug
155 * Quote variables if used in a test: [ "$var" ]
158 ================================================================================