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