cookutils view doc/cookutils.en.html @ rev 40

doc: add information about src and packages mounted with bind
author Christophe Lincoln <pankso@slitaz.org>
date Sat May 07 02:14:20 2011 +0200 (2011-05-07)
parents e1a3c5900648
children 7281d806c7ea
line source
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <title>Cookutils Documentation</title>
5 <meta charset="utf-8" />
6 <link rel="stylesheet" type="text/css" href="style.css" />
7 </head>
8 <body>
10 <div id="header">
11 <h1>Cookutils Documentation</h1>
12 </div>
14 <!-- Start content -->
15 <div id="content">
17 <h2>SliTaz Cook &amp; Cooker</h2>
19 <p>
20 The SliTaz Cookutils provide tools and utils to build SliTaz packages. They
21 are easy to use and learn, fast and light. You will be able to create SliTaz
22 in a few commands. The cookutils provide the 'cook' utility and the
23 <a href="#cooker">Cooker</a>.
24 </p>
25 <p>
26 Cook let you compile and create a package, provide a log file and check
27 receipt/package quality. The Cooker is a build bot with more automation
28 and can be used as a frontend to cook, since it provide a CGI/web interface
29 who let you view cook logs in a nice and colored way.
30 </p>
32 <h3>Cook usage</h3>
33 <p>
34 Cook provide a small built-in help usage that you can display with the
35 command 'usage'. It also have some options to perform special task on
36 a package, rater before cooking it or after. To get help and usage:
37 </p>
38 <pre>
39 # cook usage
40 </pre>
42 <h3>Howto work</h3>
43 <p>
44 The first thing you will have to do before building packages is to setup
45 your environment. These 2 recommended way to work: cook directly on host
46 or cook in chroot to protect your host. In the case you want to work in a
47 chroot you can install and use Tazdev to create one and chroot in it:
48 </p>
49 <pre>
50 # tazdev gen-chroot &amp;&amp; tazdev chroot
51 </pre>
52 <p>
53 By default Tazdev create a chroot in /home/slitaz/cooking/chroot but you
54 can specify a custome path in argument. The chroot location is not
55 important, when you will be in the chroot you will use standard SliTaz
56 path such as /home/slitaz/wok for the wok directory or /home/slitaz/log
57 for all the cook logs. As usual you can diplay tazdev help usage with:
58 tazdev usage.
59 </p>
60 <p>
61 When you use a chroot they is 2 special directories mounted with the bind
62 option: src and packages. The sources for all packages are stored by default
63 in /home/slitaz/src, this directory is mounted into the chroot so the utils
64 can use them. This method let you share sources between many chroots such
65 as one for cooking and one for stable. The packages directory default
66 location is: /home/slitaz/[version]/packages so they are not in the chroot
67 and safe in case the chroot is removed by error.
68 </p>
70 <h3>Getting started</h3>
71 <p>
72 So you decided the way you want to work, so let prepare the cook environement.
73 Cook use cook.conf configuration file, if you want to use custom path for
74 SliTaz directories and files, you have to modify it. The setup will create
75 some directories and files to keep trace on activity and error, all files
76 are pure plain text files that you can open in a text editor. To prepare
77 you environment:
78 </p>
79 <pre>
80 # cook setup
81 </pre>
82 <p>
83 The setup command have a --wok option who let you clone SliTaz wok while
84 setting up your cook environment. Even if you not yet an official developers
85 you can clone it and use existing packages as example to create your own.
86 To setup and clone the wok:
87 </p>
88 <pre>
89 # cook setup --wok
90 </pre>
92 <h3>Test your environment</h3>
93 <p>
94 Cook provide a test command who will create a package and cook it. This let
95 you see if your enviroment and by the it provide and example package with
96 a receipt. The create package is named 'cooktest' and can be removed after
97 testing. To cook the cooktest:
98 </p>
99 <pre>
100 # cook test
101 </pre>
103 <h3>Create and cook</h3>
104 <p>
105 If you environment is setup corectly you can start creating and compiling
106 SliTaz packages from your wok. To create a new package with an empty receipt:
107 </p>
108 <pre>
109 # cook new pkgname
110 </pre>
111 <p>
112 If you just created a new package, you have to edit the receipt with your
113 favorite text editor. When the receipt is ready or if you have existing
114 packages, you can cook it:
115 </p>
116 <pre>
117 # cook pkgname
118 </pre>
119 <p>
120 If all went well you will find your packages in $SLITAZ/packages
121 directory and produced files in $SLITAZ/wok/pkgname.
122 </p>
124 <h3>Cook and install</h3>
125 <p>
126 If you want to cook and install the package in one command:
127 </p>
128 <pre>
129 # cook pkgname --install
130 </pre>
132 <h3>Get sources</h3>
133 <p>
134 If you want or need to download only the sources of a package but without
135 building it, you can use the option --getsrc as bellow:
136 </p>
137 <pre>
138 # cook pkgname --getsrc
139 </pre>
141 <h3>Clean packages</h3>
142 <p>
143 After compilation and packaging ther is several files in the wok that take
144 disk space. To clean a single package:
145 </p>
146 <pre>
147 # cook pkgname --clean
148 </pre>
149 <p>
150 You can also clean the full wok at once or you can choose to keep SliTaz
151 related files and just remove the source:
152 </p>
153 <pre>
154 # cook clean-wok
155 # cook clean-src
156 </pre>
158 <h3>Packages lists</h3>
159 <p>
160 Cook can list packages in the wok but also create suitable packages list
161 for Tazpkg. That let you create a locale packages repository quiet easily
162 and is used to create official SliTaz packages list found on mirrors. To
163 list the current wok used by cook (you dont need to be root):
164 </p>
165 <pre>
166 $ cook list-wok
167 </pre>
168 <p>
169 To create packages lists:
170 </p>
171 <pre>
172 # cook pkglist
173 </pre>
175 <a name="cooker"></a>
176 <h3>The Cooker</h3>
177 <p>
178 The Cooker is a Build Bot, it first usage is to check for commits in a wok,
179 create an ordered cooklist and cook all modified packages. It can also be
180 used as a frontend to cook since they use the same files. The Cooker can
181 also be used to cook a big list of packages at once such has all package
182 of a flavor. The Cooker provide a nice CGI/Web interface that works by
183 default on any SliTaz system since we provide CGI support via Busybox httpd
184 web server.
185 </p>
186 <p>
187 The Cooker provide a small built-in help usage and short command switch.
188 For example to display usage you can use:
189 </p>
190 <pre>
191 # cooker usage
192 # cooker -u
193 </pre>
195 <h3>Cooker setup</h3>
196 <p>
197 Like cook, the Cooker needs a working environment before starting using it.
198 The main difference with the cook environment is that the Cooker needs 2 wok.
199 One Hg and clean wok as reference and one build wok, in this way is is easy
200 to compare both wok and get modifications. If you already have a cook
201 environement, you must move your wok before setting up the Cooker or it
202 will complain. Setup will also install a set of development packages that
203 can be configured in the cook.conf configuration file and the variable
204 SETUP_PKGS. To setup your cooker environment:
205 </p>
206 <pre>
207 # cooker setup
208 </pre>
209 <p>
210 If all went well you have now 2 wok, base developement packages installed
211 and all needed files created. The default behavor is to check for commits,
212 you can run a test:
213 </p>
214 <pre>
215 # cooker
216 </pre>
218 <h3>Cooker cook</h3>
219 <p>
220 Again, 2 way to work now: make change in the clean Hg wok and launch the
221 cooker without any argument or cook packages manually. The cooker let you
222 cook a single package, all packages of a category or a flavor. You can also
223 try to build all unbuilt packages, but be aware the Cooker was not designed
224 to handle thousand of packages.
225 </p>
226 <p>
227 To cook a single package wich is the same than 'cook pkgname' but with more
228 logs:
229 </p>
230 <pre>
231 # cooker pkg pkgname
232 </pre>
233 <p>
234 To cook more than one package at once you have different kind of choices.
235 You use an existing package such as used for Live flavors, you can also
236 use a custom list with packages name line by line. Finaly you can build
237 all packages of a category.
238 </p>
239 <pre>
240 # cooker flavor [name]
241 # cooker list [/path/to/cooklist]
242 # cooker cat [category]
243 </pre>
245 <h3>Cooker CGI/Web</h3>
246 <p>
247 To let you view log files in a nice way, keep activity trace and help find
248 errors, you can use the Cooker Web interface located by default in the folder
249 /var/www/cgi-bin/cooker. If you dont use a chroot and the Busybox httpd
250 web server is running, the web interface will work without configuration and
251 should be reachable at: <a href="http://localhost/cgi-bin/cooker/cooker.cgi">
252 http://localhost/cgi-bin/cooker/cooker.cgi</a>
253 </p>
254 <p>
255 If you used a chroot environment, you should also install cookutils on your
256 host and modify the SLITAZ path variable. A standard working way is to have
257 a chroot in:
258 </p>
259 <pre>
260 /home/slitaz/cooking/chroot
261 </pre>
262 <p>
263 With /etc/slitaz/cook.conf modified as bellow:
264 </p>
265 <pre>
266 SLITAZ="/home/slitaz/cooking/chroot/home/slitaz"
267 </pre>
268 <p>
269 Note: It's not obligatory to install the cookutils on your host to use the
270 web interface, you can also copy the cooker.cgi and style.css files for
271 example in your ~/Public directory and use a custom cook.conf with it. The
272 advantage of installing cookutils on the host is to get regular update via
273 Tazpkg packages manager. Say you have cloned or downloaded the cookutils:
274 </p>
275 <pre>
276 $ cp -a cookutils/web ~/Public/cgi-bin/cooker
277 $ cp -f cookutils/cook.conf ~/Public/cgi-bin/cooker
278 </pre>
279 <p>
280 Edit the configuration file: ~/Public/cgi-bin/cooker/cook.conf to set
281 SLITAZ path and you all done!
282 </p>
284 <h3>Cooknotes</h3>
285 <p>
286 The cooknotes feature let you write small personnal notes about packaging
287 and is usefull for collaboration. The cooknotes was coded to let SliTaz
288 Cooker bot maintainer share notes between them self and other contributors.
289 The Cooker can block packages build or recook packages manually, for example
290 it's nice to make a note if a package is blocked so the maintainer know why
291 admin did that. Cooknotes are displayed on the web interface and can be
292 checked from cmdline:
293 </p>
294 <pre>
295 # cooker note "Blocked pkgname due to heavy CPU load"
296 # cooker notes
297 </pre>
299 <!-- End content -->
300 </div>
302 <div id="footer">
303 Copyright &copy; 2011 SliTaz contributors
304 </div>
306 </body>
307 </html>