website view en/doc/cookbook/wok-tools.html @ rev 665

Update copyright year
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Oct 21 09:53:47 2010 +0200 (2010-10-21)
parents b8788d938e18
children 0ae6cfc85e03
line source
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <title>SliTaz Cookbook (en) - Wok &amp; Tools</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz English cookbook" />
8 <meta name="expires" content="never" />
9 <meta name="modified" content="2008-07-16 21:45:00" />
10 <meta name="publisher" content="www.slitaz.org" />
11 <meta name="author" content="Christophe Lincoln, Paul Issot"/>
12 <link rel="shortcut icon" href="favicon.ico" />
13 <link rel="stylesheet" type="text/css" href="book.css" />
14 </head>
15 <body bgcolor="#ffffff">
17 <!-- Header and quick navigation -->
18 <div id="header">
19 <div align="right" id="quicknav">
20 <a name="top"></a>
21 <a href="receipts.html">Receipts</a> |
22 <a href="index.html">Table of contents</a>
23 </div>
24 <h1><font color="#3E1220">SliTaz Cookbook (en)</font></h1>
25 </div>
27 <!-- Content. -->
28 <div id="content">
29 <div class="content-right"></div>
31 <h2><font color="#DF8F06">Wok &amp; Tools</font></h2>
33 <ul>
34 <li><a href="wok-tools.html#tazwok">Overview.</a></li>
35 <li><a href="wok-tools.html#wok">Wok tools.</a></li>
36 <li><a href="wok-tools.html#cook">Compile and generate packages.</a></li>
37 <li><a href="wok-tools.html#opts">Options during compilation of package.</a></li>
38 <li><a href="wok-tools.html#files">Files included or excluded packages.</a></li>
39 <li><a href="wok-tools.html#categories">Categories of packages.</a></li>
40 <li><a href="wok-tools.html#woktree">Structure of packages in the wok.</a></li>
41 <li><a href="wok-tools.html#pkgtree">Structure of Tazpkg package.</a></li>
42 <li><a href="receipts.html">Receipts.</a></li>
43 </ul>
45 <a name="tazwok"></a>
46 <h3>Overview</h3>
47 <p>
48 With the passing of time, the SliTaz project created a variety of small
49 utilities to rebuild the system from source automatically. Tazwok is used
50 to compile and generate code (<em>cook</em> to cook) via instructions found in the
51 receipts. The project also offers an archive of tools (<a href="slitaz-tools.html">SliTaz tools</a>)
52 containing various small utilities, examples and configuration files.
53 The distribution generator Tazlito is designed for users and
54 developers. Tazlito will retrieve and reconstruct a LiveCD ISO image and
55 generate a distribution flavor from a list of packages, a configuration file
56 and a description. The utilities are all distributed as a source archive
57 and are installed by default on SliTaz. Developers and future contributors
58 can refer to the development page that provides information on SliTaz project
59 management.
60 </p>
62 <h4>Tazwok and the wok</h4>
63 <p>
64 The idea is to use a directory (wok) containing all the available packages, each package contains
65 at least one receipt to download, unpack, compile and generate the binary package. To operate,
66 Tazwok also needs to create a directory to store downloaded sources ($SOURCES_REPOSITORY) and a
67 repository of generated packages ($PACKAGES_REPOSITORY), these values can be configured using the
68 <code>/etc/tazwok.conf</code> file.
69 </p>
71 <a name="wok"></a>
72 <h3><font color="#6c0023">Wok tools</font></h3>
73 <p>
74 To begin, Tazwok must already be installed
75 on the system and the main development tools (binutils, compiler, libraries-dev, make) must be downloaded.
76 On Slitaz you need to install the meta-package <code>slitaz-toolchain</code>:
77 </p>
78 <pre> # tazpkg recharge
79 # tazpkg get-install slitaz-toolchain
80 </pre>
81 <p>
82 To access the SliTaz repositories you need to install the <code>mercurial</code> package:
83 </p>
84 <pre> # tazpkg get-install mercurial
85 </pre>
86 <h4>Get the wok</h4>
87 <p>
88 Before working it is necessary to recover the wok from the Mercurial repositories or an archive of
89 the primary mirror (TuxFamily). Example using SliTaz to be built in <code>/home/slitaz</code>:
90 </p>
91 <pre> $ hg clone http://hg.slitaz.org/wok/ /home/slitaz/wok
92 </pre>
93 <p>
94 The archives are also available from the URL:
95 <a href="ftp://download.tuxfamily.org/slitaz/wok/">ftp://download.tuxfamily.org/slitaz/wok/</a>.
96 Just take the latest version from the cooking or undigest directories. Before compiling your first package,
97 Tazwok must know where to look for the files. By default the path is <code>/home/slitaz/wok</code>,
98 you can change this or rename the wok you want to download. To view/check Tazwok paths that will be used
99 and the number of packages in the wok, you can use the Tazwok command <code>stats</code>:
100 </p>
101 <pre> # tazwok stats
102 </pre>
104 <a name="cook"></a>
105 <h3>Compile and generate packages</h3>
106 <p>
107 Configure, compile, strip.., The way SliTaz generates a package can be put into a single command.
108 To avoid frustration, it is advisable to build your package without changing its receipt or seeking
109 dependancies. M4 is an ideal candidate for your first <code>cook</code>:
110 </p>
111 <pre> # tazwok cook m4
112 </pre>
113 <p>
114 Once the work is finished, the package is located in the directory specified by the configuration file
115 (default <code>/home/slitaz/packages</code>). If all went well, you can install the package on the host system
116 or use it to generate a LiveCD distribution via Tazlito. To create a new package you can use <code>new-tree</code>
117 with the option <code>--interactive</code> and read the documentation on the options provided by the
118 <a href="receipts.html">receipt</a>.
119 </p>
120 <h4>Cook-list - List of cooking</h4>
121 <p>
122 To compile several packages with a single command, you can use a cooking list. There are example lists in
123 <code>usr/share/examples/tazwok/cooklists</code> on SliTaz, these are just text files with a package put on every line.
124 Cook-list example using mypkgs.cooklist:
125 </p>
126 <pre> # tazwok cook-list mypkgs.cooklist
127 </pre>
129 <a name="opts"></a>
130 <h3>Options during compilation of package</h3>
131 <p>
132 You are free to use any options you want, it is necessary to respect the FSH, the docs in <code>/usr/share/doc</code>
133 and follow the Freedesktop standards (.desktop). Then it's just a question of choice, for example you can disable
134 support for XML, have smaller binaries for PHP and get rid of libxml2, but in the case of PHP, it's not worth the
135 cost in terms of loss of functionality. If you have any doubts, look at the receipts and compiler options in
136 <code>compile_rules</code>.
137 </p>
138 <h4>Optimization</h4>
139 <p>
140 The official SliTaz packages are optimized for i486, the optimization arguments used to configure are specified in
141 <code>/etc/tazwok.conf</code> and can be called via the variable <code>$CONFIGURE_ARGS</code>.
142 If you want to compile a package with different arguments, you can modify the Tazwok configuration file:
143 </p>
144 <pre class="script">CONFIGURE_ARGS="--build=i486-pc-linux-gnu --host=i486-pc-linux-gnu"
145 </pre>
147 <a name="files"></a>
148 <h3>Files included or excluded packages</h3>
149 <p>
150 Generally the base packages contain no man, info, doc or static libraries, we have to create them via a package-doc
151 or a package-dev. Note that SliTaz is not intending to use the man or info command, so there's no manual or GNU
152 info file. The creation of packages containing docs is really optional, especially if the material is in English
153 (I say). By contrast a piece of text on the package in the Handbook is more appreciated.
154 </p>
155 <p>
156 In terms of configuration, whenever possible, the aim is to offer basic configuration files to run the package
157 directly. In the case of the web server LightTPD package, SliTaz supplies configuration files and startup scripts
158 located in /etc/init.d (documented in the Handbook). For a new package, you are free to choose its default
159 configuration depending on what you think is easiest for the end user. On SliTaz you have <code>/usr/share/examples</code>
160 for example configurations and other kinds of useful infomation.
161 </p>
163 <a name="categories"></a>
164 <h3>Categories of packages</h3>
165 <p>
166 The categories of packages exist only for informational purposes and are not fixed, the idea is to classify
167 packages so that a web page can be generated each night recovering data in the package receipt. For the short term, place
168 developement packages in 'devel', Xorg in 'x-window' and the variety of new packages in 'extra'
169 </p>
171 <a name="woktree"></a>
172 <h3>Structure of a package in the wok</h3>
173 <p>
174 The structure of the packages in the wok should always be respected so that Tazwok can find the correct files and directories.
175 Possible contents of a package (note the directory taz/ is created at time of cooking):
176 </p>
177 <ul>
178 <li><code>stuff/</code> : The material used to configure, compile and generate the package
179 (patch(es), Makefile, pseudo fs, etc).</li>
180 <li><code>taz/</code> : Directory tree containing the package Tazpkg generated, the compressed package is stored
181 in the directory specified by $PACKAGES_REPOSITORY in the Tazwok configuraton file.</li>
182 <li><code>receipt</code> : The receipt (see
183 <a href="receipts.html">receipts</a>).</li>
184 <li><code>description.txt</code> : (optional) The description of the package is copied to the root of the Tazpkg
185 package. Once installed, Tazpkg knows how do deal with this file via 'tazpkg desc pkgname'.</li>
186 </ul>
188 <a name="pkgtree"></a>
189 <h3>Structure of a Tazpkg package </h3>
190 <p>
191 The SliTaz packages are cpio archives containing files and a filesystem compressed with gzip:
192 </p>
193 <ul>
194 <li><code>fs/</code> : Pseudo filesystem containing all the files to install.</li>
195 <li><code>receipt</code> : The receipt (see receipt.txt).</li>
196 <li><code>files.list</code> : A list of files in the package.</li>
197 <li><code>description.txt</code> : The description of the package (optional).</li>
198 </ul>
200 <!-- End of content -->
201 </div>
203 <!-- Footer. -->
204 <div id="footer">
205 <div class="footer-right"></div>
206 <a href="wok-tools.html#top">Top of the page</a> |
207 <a href="index.html">Table of contents</a>
208 </div>
210 <div id="copy">
211 Copyright &copy; 2010 <a href="http://www.slitaz.org/en/">SliTaz</a> -
212 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
213 Documentation is under
214 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
215 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
216 </div>
218 </body>
219 </html>