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

improve doc and small fix
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 06 04:46:36 2011 +0200 (2011-05-06)
parents 93bb4bfc8c26
children 62fa13d02142
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
35 the command:
36 </p>
37 <pre>
38 # cook usage
39 </pre>
41 <h3>Howto work</h3>
42 <p>
43 The first thing you will have to do before building packages is to setup
44 your environment. These 2 recommended way to work: cook directly on host
45 or cook in chroot to protect your host. In the case you want to work in a
46 chroot you can install and use Tazdev to create one and chroot in it:
47 </p>
48 <pre>
49 # tazdev gen-chroot &amp;&amp; tazdev chroot
50 </pre>
51 <p>
52 By default Tazdev create a chrrot in /home/slitaz/cooking/chroot but you
53 can specify a custome path in argument. The chroot place is not important,
54 when you will be in the chroot you will use standard SliTaz path such as
55 /home/slitaz/wok for the wok directory or /home/slitaz/log for all the cook
56 logs. As usual you can diplay tazdev help usage with: tazdev usage
57 </p>
59 <h3>Getting started</h3>
60 <p>
61 So you decided the way you want to work, so let prepare the cook environement.
62 Cook use cook.conf configuration file, if you want to use custom path for
63 SliTaz directories and files, you have to modify it. The setup will create
64 some directories and files to keep trace on activity and error, all files
65 are pure plain text files that you can open in a text editor. To prepare
66 you environment:
67 </p>
68 <pre>
69 # cook setup
70 </pre>
71 <p>
72 The setup command have a --wok option who let you clone SliTaz wok while
73 setting up your cook environment. Even if you not yet an official developers
74 you can clone it and use existing packages as example to create your own.
75 To setup and clone the wok:
76 </p>
77 <pre>
78 # cook setup --wok
79 </pre>
81 <h3>Test your environment</h3>
82 <p>
83 Cook provide a test command who will create a package and cook it. This let
84 you see if your enviroment and by the it provide and example package with
85 a receipt. The create package is named 'cooktest' and can be removed after
86 testing. To cook the cooktest:
87 </p>
88 <pre>
89 # cook test
90 </pre>
92 <h3>Create and cook</h3>
93 <p>
94 If you environment is setup corectly you can start creating and compiling
95 SliTaz packages from your wok. To create a new package with an empty receipt:
96 </p>
97 <pre>
98 # cook new pkgname
99 </pre>
100 <p>
101 If you just created a new package, you have to edit the receipt with your
102 favorite text editor. When the receipt is ready or if you have existing
103 packages, you can cook it:
104 </p>
105 <pre>
106 # cook pkgname
107 </pre>
108 <p>
109 If all went well you will find your packages in $SLITAZ/packages
110 directory and produced files in $SLITAZ/wok/pkgname. If you want to cook
111 and install the package in one command:
112 </p>
113 <pre>
114 # cook pkgname --install
115 </pre>
117 <h3>Clean packages</h3>
118 <p>
119 After compilation and packaging ther is several files in the wok that take
120 disk space. To clean a single package:
121 </p>
122 <pre>
123 # cook pkgname --clean
124 </pre>
125 <p>
126 You can also clean the full wok at once or you can choose to keep SliTaz
127 related files and just remove the source:
128 </p>
129 <pre>
130 # cook clean-wok
131 # cook clean-src
132 </pre>
134 <h3>Packages lists</h3>
135 <p>
136 Cook can list packages in the wok but also create suitable packages list
137 for Tazpkg. That let you create a locale packages repository quiet easily
138 and is used to create official SliTaz packages list found on mirrors. To
139 list the current wok used by cook (you dont need to be root):
140 </p>
141 <pre>
142 $ cook list-wok
143 </pre>
144 <p>
145 To create packages lists:
146 </p>
147 <pre>
148 # cook pkglist
149 </pre>
151 <a name="cooker"></a>
152 <h3>The Cooker</h3>
153 <p>
154 The Cooker is a Build Bot, it first usage is to check for commits in a wok,
155 create an ordered cooklist and cook all modified packages. It can also be
156 used as a frontend to cook since they use the same files. The Cooker can
157 also be used to cook a big list of packages at once such has all package
158 of a flavor. The Cooker provide a nice CGI/Web interface that works by
159 default on any SliTaz system since we provide CGI support via Busybox httpd
160 web server.
161 </p>
162 <p>
163 The Cooker provide a small built-in help usage that you can display with
164 the command:
165 </p>
166 <pre>
167 # cooker --usage
168 </pre>
170 <h3>Cooker setup</h3>
171 <p>
172 Like cook, the Cooker needs a working environment before starting using it.
173 The main difference with the cook environment is that the Cooker needs 2 wok.
174 One Hg and clean wok as reference and one build wok, in this way is is easy
175 to compare both wok and get modifications. If you already have a cook
176 environement, you must move your wok before setting up the Cooker or it
177 will complain:
178 </p>
179 <pre>
180 # cooker --setup
181 </pre>
182 <p>
183 If all went well you have now 2 wok, base developement packages installed
184 and all needed files created. The default behavor is to check for commits,
185 you can run a test:
186 </p>
187 <pre>
188 # cooker
189 </pre>
191 <h3>Cooker cook</h3>
192 <p>
193 Again, 2 way to work now: make change in the clean Hg wok and launch the
194 cooker without any argument or cook packages manually. The cooker let you
195 cook a single package, all packages of a category or a flavor. You can also
196 try to build all unbuilt packages, but be aware the Cooker was not designed
197 to handle thousand of packages.
198 </p>
199 <p>
200 To cook a single package wich is the same than 'cook pkgname' but with more
201 logs:
202 </p>
203 <pre>
204 # cooker --pkg=pkgname
205 </pre>
206 <p>
207 To cook more than one package at once you have different kind of choices.
208 You use an existing package such as used for Live flavors, you can also
209 use a custom list with packages name line by line. Finaly you can build
210 all packages of a category.
211 </p>
212 <pre>
213 # cooker --flavor=flavor
214 # cooker --list=/path/to/list
215 # cooker --cat=category
216 </pre>
218 <h3>Cooker CGI/Web</h3>
219 <p>
220 To let you view log files in a nice way, keep activity trace and help find
221 errors, you can use the Cooker Web interface located by default in the folder
222 /var/www/cgi-bin/cooker. If you dont use a chroot and the Busybox httpd
223 web server is running, the web interface will work without configuration and
224 should be reachable at: <a href="http://localhost/cgi-bin/cooker/cooker.cgi">
225 http://localhost/cgi-bin/cooker/cooker.cgi</a>
226 </p>
227 <p>
228 If you used a chroot environment, you should also install cookutils on your
229 host and modify the SLITAZ path variable. A standard working way is to have
230 a chroot in:
231 </p>
232 <pre>
233 /home/slitaz/cooking/chroot
234 </pre>
235 <p>
236 With /etc/slitaz/cook.conf modified as bellow:
237 </p>
238 <pre>
239 SLITAZ="/home/slitaz/cooking/chroot/home/slitaz"
240 </pre>
241 <p>
242 Note: It's not obligatory to install the cookutils on your host to use the
243 web interface, you can also copy the cooker.cgi and style.css files for
244 example in your ~/Public directory and use a custom cook.conf with it. The
245 advantage of installing cookutils on the host is to get regular update via
246 Tazpkg packages manager. Say you have cloned or downloaded the cookutils:
247 </p>
248 <pre>
249 $ cp -a cookutils/web ~/Public/cgi-bin/cooker
250 $ cp -f cookutils/cook.conf ~/Public/cgi-bin/cooker
251 </pre>
252 <p>
253 Edit the configuration file: ~/Public/cgi-bin/cooker/cook.conf to set
254 SLITAZ path and you all done!
255 </p>
257 <h3>Cooknotes</h3>
258 <p>
259 The cooknotes feature let you write small personnal notes about packaging
260 and is usefull for collaboration. The cooknotes was coded to let SliTaz
261 Cooker bot maintainer share notes between them self and other contributors.
262 The Cooker can block packages build or recook packages manually, for example
263 it's nice to make a note if a package is blocked so the maintainer know why
264 admin did that. Cooknotes are displayed on the web interface and can be
265 checked from cmdline:
266 </p>
267 <pre>
268 # cooker --note="Blocked pkgname due to heavy CPU load"
269 # cooker --notes
270 </pre>
272 <!-- End content -->
273 </div>
275 <div id="footer">
276 Copyright &copy; 2011 SliTaz contributors
277 </div>
279 </body>
280 </html>