website view en/doc/cookbook/wok-tools.html @ rev 186
en: Minor edit
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Mon Nov 03 20:13:17 2008 +0000 (2008-11-03) |
parents | e66b0f865f65 |
children | b70c36f0c9c5 |
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 & 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 & Tools</font></h2>
33 <ul>
34 <li><a href="#tazwok">Overview.</a></li>
35 <li><a href="#wok">Wok tools.</a></li>
36 <li><a href="#cook">Compile and generate packages.</a></li>
37 <li><a href="#opts">Options during compilation of package.</a></li>
38 <li><a href="#files">Files included or excluded packages.</a></li>
39 <li><a href="#categories">Categories of packages.</a></li>
40 <li><a href="#woktree">Structure of packages in the wok.</a></li>
41 <li><a href="#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 - Tazwok and the wok</h3>
47 <p>
48 The idea is to use a directory (wok) containing all the available packages, each package contains
49 at least one receipt to download, unpack, compile and generate the binary package. To operate,
50 tazwok also needs to create a directory to store downloaded sources ($SOURCES_REPOSITORY) and a
51 repository of generated packages ($PACKAGES_REPOSITORY), these values can be configured using the
52 <code>/etc/tazwok.conf</code> file.
53 </p>
55 <a name="wok"></a>
56 <h3><font color="#6c0023">Wok tools</font></h3>
57 <p>
58 To begin, tazwok must already be installed
59 on the system and the main development tools (binutils, compiler, libraries-dev, make) must be downloaded.
60 On Slitaz you need to install the meta-package <code>slitaz-toolchain</code>:
61 </p>
62 <pre> # tazpkg recharge
63 # tazpkg get-install slitaz-toolchain
64 </pre>
65 <p>
66 To access the SliTaz repositories you need to install the <code>mercurial</code> package:
67 </p>
68 <pre> # tazpkg get-install mercurial
69 </pre>
70 <h4>Get the wok</h4>
71 <p>
72 Before working it is necessary to recover the wok from the Mercurial repositories or an archive of
73 the primary mirror (TuxFamily). Example using SliTaz to be built in <code>/home/slitaz</code>:
74 </p>
75 <pre> $ hg clone http://hg.slitaz.org/wok/ /home/slitaz/wok
76 </pre>
77 <p>
78 The archives are also available from the URL:
79 <a href="ftp://download.tuxfamily.org/slitaz/wok/">ftp://download.tuxfamily.org/slitaz/wok/</a>.
80 Just take the latest version from the cooking or undigest directories. Before compiling your first package,
81 tazwok must know where to look for the files. By default the path is <code>/home/slitaz/wok</code>,
82 you can change this or rename the wok you want to download. To view/check tazwok paths that will be used
83 and the number of packages in the wok, you can use the tazwok command <code>stats</code>:
84 </p>
85 <pre> # tazwok stats
86 </pre>
88 <a name="cook"></a>
89 <h3>Compile and generate packages</h3>
90 <p>
91 Configure, compile, strip.., The way SliTaz generates a package can be put into a single command.
92 To avoid frustration, it is advisable to build your package without changing its receipt or seeking
93 dependancies. M4 is an ideal candidate for your first <code>cook</code>:
94 </p>
95 <pre> # tazwok cook m4
96 </pre>
97 <p>
98 Once the work is finished, the package is located in the directory specified by the configuration file
99 (default <code>/home/slitaz/packages</code>). If all went well, you can install the package on the host system
100 or use it to generate a LiveCD distribution via tazlito. To create a new package you can use <code>new-tree</code>
101 with the option <code>--interactive</code> and read the documentation on the options provided by the
102 <a href="receipts.html">receipt</a>.
103 </p>
104 <h4>Cook-list - List of cooking</h4>
105 <p>
106 To compile several packages with a single command, you can use a cooking list. There are example lists in
107 <code>usr/share/examples/tazwok/cooklists</code> on SliTaz, these are just text files with a package put on every line.
108 Cook-list example using mypkgs.cooklist:
109 </p>
110 <pre> # tazwok cook-list mypkgs.cooklist
111 </pre>
113 <a name="opts"></a>
114 <h3>Options during compilation of package</h3>
115 <p>
116 You are free to use any options you want, it is necessary to respect the FSH, the docs in <code>/usr/share/doc</code>
117 and follow the Freedesktop standards (.desktop). Then it's just a question of choice, for example you can disable
118 support for XML, have smaller binaries for PHP and get rid of libxml2, but in the case of PHP, it's not worth the
119 cost in terms of loss of functionality. If you have any doubts, look at the receipts and compiler options in
120 <code>compile_rules</code>.
121 </p>
122 <h4>Optimization</h4>
123 <p>
124 The official SliTaz packages are optimized for i486, the optimization arguments used to configure are specified in
125 <code>/etc/tazwok.conf</code> and can be called via the variable <code>$CONFIGURE_ARGS</code>.
126 If you want to compile a package with different arguments, you can modify the tazwok configuration file:
127 </p>
128 <pre class="script">CONFIGURE_ARGS="--build=i486-pc-linux-gnu --host=i486-pc-linux-gnu"
129 </pre>
131 <a name="files"></a>
132 <h3>Files included or excluded packages</h3>
133 <p>
134 Generally the base packages contain no man, info, doc or static libraries, we have to create them via a package-doc
135 or a package-dev. Note that SliTaz is not intending to use the man or info command, so there's no manual or GNU
136 info file. The creation of packages containing docs is really optional, especially if the material is in English
137 (I say). By contrast a piece of text on the package in the Handbook is more appreciated.
138 </p>
139 <p>
140 In terms of configuration, whenever possible, the aim is to offer basic configuration files to run the package
141 directly. In the case of the web server LightTPD package, SliTaz supplies configuration files and startup scripts
142 located in /etc/init.d (documented in the Handbook). For a new package, you are free to choose its default
143 configuration depending on what you think is easiest for the end user. On SliTaz you have <code>/usr/share/examples</code>
144 for example configurations and other kinds of useful infomation.
145 </p>
147 <a name="categories"></a>
148 <h3>Categories of packages</h3>
149 <p>
150 The categories of packages exist only for informational purposes and are not fixed, the idea is to classify
151 packages so that a web page can be generated each night recovering data in the package receipt. For the short term, place
152 developement packages in 'devel', Xorg in 'x-window' and the variety of new packages in 'extra'
153 </p>
155 <a name="woktree"></a>
156 <h3>Structure of a package in the wok</h3>
157 <p>
158 The structure of the packages in the wok should always be respected so that tazwok can find the correct files and directories.
159 Possible contents of a package (note the directory taz/ is created at time of cooking):
160 </p>
161 <ul>
162 <li><code>stuff/</code> : The material used to configure, compile and generate the package
163 (patch(es), Makefile, pseudo fs, etc).</li>
164 <li><code>taz/</code> : Directory tree containing the package tazpkg generated, the compressed package is stored
165 in the directory specified by $PACKAGES_REPOSITORY in the tazwok configuraton file.</li>
166 <li><code>receipt</code> : The receipt (see
167 <a href="receipts.html">receipts</a>).</li>
168 <li><code>description.txt</code> : (optional) The description of the package is copied to the root of the tazpkg
169 package. Once installed, tazpkg knows how do deal with this file via 'tazpkg desc pkgname'.</li>
170 </ul>
172 <a name="pkgtree"></a>
173 <h3>Structure of a tazpkg package </h3>
174 <p>
175 The SliTaz packages are cpio archives containing files and a filesystem compressed with gzip:
176 </p>
177 <ul>
178 <li><code>fs/</code> : Pseudo filesystem containing all the files to install.</li>
179 <li><code>receipt</code> : The receipt (see receipt.txt).</li>
180 <li><code>files.list</code> : A list of files in the package.</li>
181 <li><code>description.txt</code> : The description of the package (optional).</li>
182 </ul>
184 <!-- End of content -->
185 </div>
187 <!-- Footer. -->
188 <div id="footer">
189 <div class="footer-right"></div>
190 <a href="#top">Top of the page</a> |
191 <a href="index.html">Table of contents</a>
192 </div>
194 <div id="copy">
195 Copyright © 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
196 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
197 Documentation is under
198 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
199 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
200 </div>
202 </body>
203 </html>