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

ru: in fact, two sections has not yet been translated
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Apr 04 18:48:52 2012 +0300 (2012-04-04)
parents da8915a01dcc
children 0c3d5d5f927e
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 Web boot, Build Bot and SliTaz Pro:
68 <a href="http://tank.slitaz.org/" target="_blank">tank.slitaz.org</a>
69 </p>
70 <!-- p>
71 SliTaz also have servers for their needs:
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 run 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 Building official is done with the Cookutils suite. The package is installed
234 on each SliTaz system as well as the documentation about using cook and
235 <a href="http://hg.slitaz.org/cookutils/raw-file/tip/doc/cookutils.en.html">creating SliTaz Packages</a> suitable for TazPKG packages manager.
236 </p>
237 <p>
238 The tazpkg packages in SliTaz are automatically created via the
239 <a href="http://cook.slitaz.org/">Cooker</a> from Cookutils package
240 and a receipt in the wok. The Cookbook describes the format of
241 <a href="http://doc.slitaz.org/en:cookbook:receipt">receipts</a>.
242 Cook and receipt documentation are required reading before we begin.
243 </p>
244 <p>
245 In terms of choice of package, the idea is to offer a package by task or
246 functionality, ie. the lightest application in the field and not duplicated.
247 Note that the current packages are not immutable, if you find an alternative
248 that is lighter, with more features or more <em>sexy</em> for a few extra KB,
249 you can suggest it on the Mailing List. Particular attention is given to
250 packages for the LiveCD, these should be stripped, removing unnecessary
251 dependencies and compiler options. In general candidate packages for the core
252 LiveCD are discussed on the Mailing List.
253 </p>
254 <p>
255 Before you begin to compile and create packages for SliTaz, be sure that the
256 work doesn't already exist in the
257 <a href="http://download.tuxfamily.org/slitaz/packages/undigest/">undigest</a>
258 wok provided by the primary SliTaz mirror. Don't forget that the members
259 of the list are there to help you and that the documentation of the
260 <a href="http://doc.slitaz.org/en:cookbook:wok">wok and tools</a>
261 exists to help you get started.
262 </p>
264 <h3 id="pkgs-naming">Naming of packages</h3>
266 <p>
267 In most cases the package name is the same as the source, except for
268 Python, Perl, PHP, Ruby and Lua modules. For example, the package
269 providing a Kid template system written in Python and XML is named:
270 <code>python-kid</code>.
271 </p>
273 <h2 id="website">Website Management</h2>
275 <p>
276 The website is managed via a mercurial repository, they can be cloned by:
277 </p>
278 <pre>
279 $ hg clone http://hg.slitaz.org/website
280 Or if you have the proper permissions:
281 $ hg clone http://repos.slitaz.org/website
282 </pre>
284 <h3>xHTML coding style</h3>
286 <p>
287 The pages and different <em>books</em> are coded in xHTML 1.0
288 transitional. The title of level 1 is used only once (at the top),
289 level 2 is the title of the document and levels 3 and 4 are then used for
290 the subtitles. If a list is used instead using smart anchors;
291 then that starts at the top, just after the title of level 2.
292 Paragraphs are contained in the tags <code>&lt;p&gt;&lt;/p&gt;</code>.
293 For indentation, we use tabs - the reason being semantics and to take
294 up less space in terms of octets (bytes). To put code, like the name of
295 a command inside a paragraph: <code>&lt;code&gt;</code> is the preferred
296 method. To view commands or to utilize a terminal, the web pages use
297 <code>&lt;pre&gt;</code> to display the formatted text. Example:
298 </p>
299 <pre>
300 $ command
301 </pre>
302 <p>
303 To view text that can be copied and pasted, such as scripts,
304 bits of code, sample configuration files, etc - we also use
305 <code>&lt;pre&gt;</code>, but with a CSS class named "script". Example:
306 </p>
307 <pre class="script">
308 &lt;pre class="script"&gt;
310 code...
312 &lt;/pre&gt;
313 </pre>
314 <p>
315 The <em>emphasized</em> words put themselves in the tag <code>&lt;em&gt;</code>
316 and internal links are relative. Remember to check the validity
317 of the code via the online <em>validator</em> of the W3C.
318 </p>
320 <h2 id="diff">Diff and patch</h2>
322 <p>
323 The utilities <code>diff</code> and <code>patch</code> are command-line tools
324 for creating and implementing a file containing differences between two files.
325 This technique is often used for collaboration and the changes made to the
326 original file can be clearly extracted. To create a <code>diff</code> file
327 readable by humans in a simple text editor, you must supply the <code>-u</code> option:
328 </p>
329 <pre>
330 $ diff -u file.orig file.new &gt; file.diff
331 </pre>
332 <p>
333 To apply a patch:
334 </p>
335 <pre>
336 $ patch file.orig file.diff
337 </pre>
339 <!-- End of content -->
340 </div>
342 <?php include("../../lib/html/footer.html"); ?>
344 </body>
345 </html>