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

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