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

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