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

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