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

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