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