website view en/devel/forge.php @ rev 1013

cn, da, de, en, es, id, it, ru: lib/lang.php applied to all pages
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Mar 30 03:53:36 2012 +0300 (2012-03-30)
parents c2f9d5d0f314
children e366582685d1
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 - Forge (en)</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <meta name="description" content="slitaz developers forge" />
8 <meta name="keywords" lang="en" content="slitaz, devel, hg, bugs" />
9 <meta name="robots" content="index, follow, all" />
10 <meta name="modified" content="<?php echo (date( "Y-m-d H:i:s", getlastmod())); ?>" />
11 <meta name="author" content="Christophe Lincoln"/>
12 <link rel="shortcut icon" href="../../favicon.ico" />
13 <link rel="stylesheet" type="text/css" href="../../slitaz.css" />
14 </head>
15 <body>
17 <?php include("../../lib/html/header.html"); ?>
19 <!-- Block -->
20 <div id="block">
21 <?php include("../../lib/html/nav.en.html"); ?>
22 <!-- Information/image -->
23 <div id="block_info">
24 <h4>Forge</h4>
25 <p>
26 Misc tools, guidelines and services used to create and build SliTaz.
27 </p>
28 <p>
29 <img src="../../images/users.png" alt="users.png" />
30 <a href="http://scn.slitaz.org/">Join us on SCN</a> and
31 the <a href="../mailing-list.php">mailing list</a>
32 </p>
33 </div>
34 </div>
36 <?php include("../../lib/lang.php"); ?>
38 <!-- Content -->
39 <div id="content">
41 <h2>Collaborative management</h2>
43 <ul>
44 <li><a href="#kiss">KISS and comply to standards.</a></li>
45 <li><a href="#tank">Build host &amp; home.</a></li>
46 <li><a href="#repos">Mercurial repositories.</a></li>
47 <li><a href="#gui">GUI in GTK and CGI/web</a></li>
48 <li><a href="#iconv">Implementation of iconv().</a></li>
49 <li><a href="#pkgs">Building SliTaz packages.</a></li>
50 <li><a href="#website">Website Management.</a></li>
51 </ul>
53 <a name="kiss"></a>
54 <h2>KISS and comply to standards</h2>
55 <p>
56 Keep it simple: follow the best standards, carefully draft and write
57 high quality documentation, provide a stable and robust system and keep
58 the <em>rootfs</em> on the LiveCD light enough to run on machines with at
59 least 128 MB RAM. It's also possible to use GTK+2, Dialog, SHell scripts,
60 or PHP coding tools on the distribution. The idea is not to duplicate and
61 to think small...
62 </p>
64 <a name="tank"></a>
65 <h2>Tank - Build host &amp; home</h2>
66 <p>
67 Each contributor may have an account on the project server with secure
68 access, disk space, a public directory and all development tools.
69 Developers can compile packages and maintainers of the mirror can handle
70 sychronization. Tank also hosts the website, web boot and mercurial
71 repositories: <a href="http://tank.slitaz.org/">tank.slitaz.org</a>
72 </p>
73 <p>
74 Instructions on using the build host are described in the Cookbook:
75 <a href="http://doc.slitaz.org/en:cookbook:buildhost">
76 SliTaz Build Host (tank)</a>.
77 </p>
79 <a name="repos"></a>
80 <h2>Mercurial repositories</h2>
81 <p>
82 SliTaz Mercurial or Hg repos can be browsed or cloned by anyone using
83 the URL: <a href="http://hg.slitaz.org/">http://hg.slitaz.org/</a>. People
84 with write access can directly use <code>repos.slitaz.org</code> which
85 requires authentication. Mercurial uses Python and is installable with:
86 <code>tazpkg get-install mercurial</code>
87 </p>
89 <h3>~/.hgrc</h3>
90 <p>
91 Before you push your first commit onto the server, be sure that you have a
92 correct Hg configuration file with your name and email address, and remember
93 to check that you are not root. Personal ~/.hgrc file example:
94 </p>
95 <pre class="script">
96 [ui]
97 username = FirstName LastName &lt;you@example.org&gt;
98 </pre>
99 <h4>Clone, modify, commit and push</h4>
100 <p>
101 Clone a repo, example for wok:
102 </p>
103 <pre>
104 $ hg clone http://repos.slitaz.org/wok
105 </pre>
106 <p>
107 Change directory to wok, note you must be in the repository to be able
108 to use 'hg' commands. To check all logs or just the last log:
109 </p>
110 <pre>
111 $ hg log
112 $ hg head
113 </pre>
114 <p>
115 Add or modify one or more files and commit:
116 </p>
117 <pre>
118 $ hg add
119 $ hg status
120 $ hg commit -m "Log message..."
121 $ hg log
122 </pre>
123 <p>
124 Note that you can use the command <code>rollback</code> to roll back to the last
125 transaction. Before pushing changes to the server, it is safe to pull once:
126 </p>
127 <pre>
128 $ hg pull
129 $ hg push
130 </pre>
131 <p>
132 Done, your changes, code or corrections are now on the server.
133 </p>
134 <h4>Updating a local wok</h4>
135 <p>
136 To update your wok with the local server (<em>pull</em> to pull the changes):
137 </p>
138 <pre>
139 $ hg pull -u
140 </pre>
141 <h4>Useful commands</h4>
142 <p>
143 Hg commands that can be used.
144 </p>
145 <ul>
146 <li><code>hg help</code> : Display the full list of commands.</li>
147 <li><code>hg rollback</code> : Undo the last action performed (commit,
148 pull, push).</li>
149 <li><code>hg log &lt;package&gt;</code> : Display a package log.</li>
150 <li><code>hg head</code> : Display the last log.</li>
151 </ul>
153 <a name="gui"></a>
154 <h2>GUI - Pure C/GTK, Yad, Vala/Genie and CGI/web</h2>
156 <p>
157 There are many ways to create user interfaces in the open source world. From
158 the start of the project until 3.0 we mainly used a tool called Gtkdialog
159 which let us create quite nice and complex interfaces in GTK, but using a
160 scripting language that just run without having to be compiled. But gtkdialog is
161 unmaintained and lacks many new GTK features, so we switched to Yad for simple GUI boxes.
162 For all the administration, packages and configuration tools we switched to TazPanel,
163 a CGI/web interface with a gui coded in xHTML 5 and CSS 3.
164 </p>
165 <p>
166 Yad is very simple but doesn't allow us to create complex interfaces even if we
167 only need 2 or 3 entries with labels and a few buttons, so another way
168 must be found. The advantage of a scripting language is the fact that it doesn't need
169 to be compiled and can be coded in realtime (but it produces slower applications).
170 Writing tools in C is complex and gets less contributions since SHell scripts are easier
171 to understand, so the guidelines are now to keep and continue to improve our
172 cmdline tools and provide frontends in GTK or CGI/web.
173 </p>
174 <p>
175 There are many new languages that use GTK such as Genie, Vala or GTKaml.
176 But keep in mind that they are not as popular as C and GTK and not really
177 easier to learn and use (for simple frontends you can use SHell
178 scripts to perform tasks). You can use Vala but look at a pure
179 GTK single window, it uses only 14 lines:
180 </p>
181 <pre>
182 #include &lt;gtk/gtk.h&gt;
184 int main(int argc, char *argv[])
185 {
186 GtkWidget *window;
188 gtk_init(&amp;argc, &amp;argv);
189 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
190 g_signal_connect (G_OBJECT (window), "destroy",
191 G_CALLBACK (gtk_main_quit), NULL);
193 gtk_widget_show(window);
194 gtk_main();
195 return 0;
196 }
197 </pre>
198 <p>
199 If you are not sure about which language to use, discuss it on the mailing list.
200 If you just want a small GUI function, look at tazbox in the slitaz-tools
201 repo, it has tiny desktop tools such as a logout box. The first
202 SliTaz sub-project written in pure GTK is TazWeb and you can use it to learn
203 ways to use system() to include system commands in your frontend. For
204 example TazWeb uses wget for downloads and sed to add bookmarks.
205 </p>
206 <p>
207 Yad scripts should follow TazYad guidelines:
208 <a href="http://hg.slitaz.org/slitaz-dev-tools/raw-file/tip/tazyad/README">
209 README</a> and
210 <a href="http://hg.slitaz.org/slitaz-dev-tools/raw-file/tip/tazyad/tazyad">
211 example code</a>
212 </p>
214 <a name="iconv"></a>
215 <h2>Implementation of iconv()</h2>
216 <p>
217 SliTaz uses iconv() provided by GNU glibc - any packages that offer
218 <code>libiconv</code> must use the library contained in <code>glibc-locale</code>.
219 There is therefore no longer a libiconv package (1.2 MB) in SliTaz.
220 </p>
222 <a name="pkgs"></a>
223 <h2>Building SliTaz packages</h2>
224 <p>
225 Building official is done with the Cookutils suite. The package is installed
226 on each SliTaz system as well as the documentation about using cook and
227 <a href="http://hg.slitaz.org/cookutils/raw-file/tip/doc/cookutils.en.html">creating SliTaz Packages</a> suitable fot TazPKG packages manager.
228 </p>
229 <p>
230 The tazpkg packages in SliTaz are automatically created via the
231 <a href="http://cook.slitaz.org/">Cooker</a> from Cookutils package
232 and a receipt in the wok. The Cookbook describes the format of
233 <a href="http://doc.slitaz.org/en:cookbook:receipt">receipts</a>.
234 Cook and receipt documentation are required reading before we begin.
235 </p>
236 <p>
237 In terms of choice of package, the idea is to offer a package by task or
238 functionality, ie. the lightest application in the field and not duplicated.
239 Note that the current packages are not immutable, if you find an alternative
240 that is lighter, with more features or more <em>sexy</em> for a few extra KB,
241 you can suggest it on the Mailing List. Particular attention is given to
242 packages for the LiveCD, these should be stripped, removing unnecesary
243 dependencies and compiler options. In general candidate packages for the core
244 LiveCD are discussed on the Mailing List.
245 </p>
246 <p>
247 Before you begin to compile and create packages for SliTaz, be sure that the
248 work doesn't already exist in the
249 <a href="http://download.tuxfamily.org/slitaz/packages/undigest/">undigest</a>
250 wok provided by the primary SliTaz mirror. Don't forget that the members
251 of the list are there to help you and that the documentation of the
252 <a href="http://doc.slitaz.org/en:cookbook:wok">wok and tools</a>
253 exists to help you get started.
254 </p>
256 <a name="pkgs-naming"></a>
257 <h3>Naming of packages</h3>
258 <p>
259 In most cases the package name is the same as the source, except for
260 Python, Perl, PHP, Ruby and Lua modules. For example, the package
261 providing a Kid template system written in Python and XML is named:
262 <code>python-kid</code>.
263 </p>
265 <a name="website"></a>
266 <h2>Website Management</h2>
267 <p>
268 The website is managed via a mercurial repository, they can be cloned by:
269 </p>
270 <pre>
271 $ hg clone http://hg.slitaz.org/website
272 Or if you have the proper permissions:
273 $ hg clone http://repos.slitaz.org/website
274 </pre>
276 <h3>xHTML coding style</h3>
277 <p>
278 The pages and different <em>books</em> are coded in xHTML 1.0
279 transitional. The title of level 1 is used only once (at the top),
280 level 2 is the title of the document and levels 3 and 4 are then used for
281 the subtitles. If a list is used instead using smart anchors;
282 then that starts at the top, just after the title of level 2.
283 Paragraphs are contained in the tags <code>&lt;p&gt;&lt;/p&gt;</code>.
284 For indentation, we use tabs - the reason being semantics and to take
285 up less space in terms of octets (bytes). To put code, like the name of
286 a command inside a paragraph: <code>&lt;code&gt;</code> is the preferred
287 method. To view commands or to utilize a terminal, the web pages use
288 <code>&lt;pre&gt;</code> to display the formatted text. Example:
289 </p>
290 <pre>
291 $ command
292 </pre>
293 <p>
294 To view text that can be copied and pasted, such as scripts,
295 bits of code, sample configuration files, etc - we also use
296 <code>&lt;pre&gt;</code>, but with a CSS class named "script". Example:
297 </p>
298 <pre class="script">
299 &lt;pre class="script"&gt;
301 code...
303 &lt;/pre&gt;
304 </pre>
305 <p>
306 The <em>emphasized</em> words put themselves in the tag <code>&lt;em&gt;</code>
307 and internal links are relative. Remember to check the validity
308 of the code via the online <em>validator</em> of the W3C.
309 </p>
311 <a name="diff"></a>
312 <h2>Diff and patch</h2>
313 <p>
314 The utilities <code>diff</code> and <code>patch</code> are command-line tools
315 for creating and implementing a file containing differences between two files.
316 This technique is often used for collaboration and the changes made to the
317 original file can be clearly extracted. To create a <code>diff</code> file
318 readable by humans in a simple text editor, you must supply the <code>-u</code> option:
319 </p>
320 <pre>
321 $ diff -u file.orig file.new &gt; file.diff
322 </pre>
323 <p>
324 To apply a patch:
325 </p>
326 <pre>
327 $ patch file.orig file.diff
328 </pre>
330 <!-- End of content -->
331 </div>
333 <?php include("../../lib/html/footer.html"); ?>
335 </body>
336 </html>