website rev 830

en: Add GUI guideline info in forge
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 28 15:43:10 2011 +0200 (2011-04-28)
parents afa852ea51a0
children c179925b46d5
files en/devel/forge.php
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/en/devel/forge.php	Thu Apr 28 15:43:10 2011 +0200
     1.3 @@ -0,0 +1,378 @@
     1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     1.5 +    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     1.7 +<head>
     1.8 +    <title>SliTaz - Forge (en)</title>
     1.9 +    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    1.10 +    <meta name="description" content="slitaz developers forge" />
    1.11 +    <meta name="keywords" lang="en" content="slitaz, devel, hg, bugs" />
    1.12 +    <meta name="robots" content="index, follow, all" />
    1.13 +    <meta name="modified" content="<?php echo (date( "Y-m-d H:i:s", getlastmod())); ?>" />
    1.14 +    <meta name="author" content="Christophe Lincoln"/>
    1.15 +    <link rel="shortcut icon" href="../../favicon.ico" />
    1.16 +    <link rel="stylesheet" type="text/css" href="../../slitaz.css" />
    1.17 +</head>
    1.18 +<body>
    1.19 +
    1.20 +<!-- Header -->
    1.21 +<div id="header">
    1.22 +	<div id="logo"></div>
    1.23 +	<div id="network">
    1.24 +		<a href="http://www.slitaz.org/netmap.php">
    1.25 +			<img src="../../images/network.png" alt="network.png" /></a>
    1.26 +		<a href="http://scn.slitaz.org/">Community</a>
    1.27 +		<a href="http://doc.slitaz.org/">Doc</a>
    1.28 +		<a href="http://forum.slitaz.org/">Forum</a>
    1.29 +		<a href="http://bugs.slitaz.org">Bugs</a>
    1.30 +		<a href="http://hg.slitaz.org/">Hg</a>
    1.31 +	</div>
    1.32 +	<h1><a href="http://www.slitaz.org/">SliTaz GNU/Linux</a></h1>
    1.33 +</div>
    1.34 +
    1.35 +<!-- Block -->
    1.36 +<div id="block">
    1.37 +	<!-- Navigation -->
    1.38 +	<div id="block_nav">
    1.39 +		<h4>Navigation</h4>
    1.40 +		<div class="right_box">
    1.41 +			<ul>
    1.42 +				<li><a href="../mailing-list.html">Mailing List</a></li>
    1.43 +				<li><a href="../devel/">Development</a></li>
    1.44 +				<li><a href="../packages/">Packages</a></li>
    1.45 +				<li><a href="../artwork/">Artwork</a></li>
    1.46 +				<li><a href="../search.html">Search</a></li>
    1.47 +			</ul>
    1.48 +		</div>
    1.49 +		<div class="left_box">
    1.50 +			<ul>
    1.51 +				<li><a href="../">Headlines</a></li>
    1.52 +				<li><a href="../about/">About</a></li>
    1.53 +				<li><a href="../get/">Download</a></li>
    1.54 +				<li><a href="../asso/">Association</a></li>
    1.55 +				<li><a href="../doc/">Documentation</a></li>
    1.56 +			</ul>
    1.57 +		</div>
    1.58 +	</div>
    1.59 +	<!-- Information/image -->
    1.60 +	<div id="block_info">
    1.61 +		<h4>Forge</h4>
    1.62 +		<p>
    1.63 +			Tools, guideline and services used to created and build SliTaz
    1.64 +		</p>
    1.65 +		<p>
    1.66 +			<img src="../../images/users.png" alt="users.png" />
    1.67 +			<a href="http://scn.slitaz.org/">Join us on SCN</a> and
    1.68 +			the <a href="../mailing-list.html">mailing list</a>
    1.69 +		</p>
    1.70 +	</div>
    1.71 +</div>
    1.72 +
    1.73 +<!-- Content -->
    1.74 +<div id="content">
    1.75 +
    1.76 +<h2>Collaborative management</h2>
    1.77 +
    1.78 +<ul>
    1.79 +	<li><a href="#kiss">KISS and comply to standards.</a></li>
    1.80 +	<li><a href="#tank">Build host &amp; home.</a></li>
    1.81 +	<li><a href="#repos">Mercurial repositories.</a></li>
    1.82 +	<li><a href="#gui">GUI in GTK and CGI/web</a></li>
    1.83 +	<li><a href="#iconv">Implementation of iconv().</a></li>
    1.84 +	<li><a href="#pkgs">Tazpkg packages.</a></li>
    1.85 +	<li><a href="#website">Website Management.</a></li>
    1.86 +</ul>
    1.87 +
    1.88 +<a name="kiss"></a>
    1.89 +<h2>KISS and comply to standards</h2>
    1.90 +<p>
    1.91 +	Keep it simple: follow the best standards, carefully draft and write
    1.92 +	high quality documentation, provide a stable and robust system and keep
    1.93 +	the <em>rootfs</em> on the LiveCD light enough to run on machines with at 
    1.94 +	least 128 MB RAM. It's also possible to use GTK+2, Dialog, SHell scripts, 
    1.95 +	or PHP coding tools on the distribution. The idea is not to duplicate and 
    1.96 +	to think small...
    1.97 +</p>
    1.98 +
    1.99 +<a name="tank"></a>
   1.100 +<h2>Tank - Build host &amp; home</h2>
   1.101 +<p>
   1.102 +	Each contributor may have an account on the project server with secure 
   1.103 +	access, disk space, a public directory and all development tools. 
   1.104 +	Developers can compile packages and maintainers of the mirror can handle 
   1.105 +	sychronization. Tank also hosts the website, web boot and mercurial 
   1.106 +	repositories: <a href="http://tank.slitaz.org/">tank.slitaz.org</a>
   1.107 +</p>
   1.108 +<p>
   1.109 +	Instructions on using the build host are described in the Cookbook:
   1.110 +	<a href="http://doc.slitaz.org/en:cookbook:buildhost">
   1.111 +		SliTaz Build Host (tank)</a>.
   1.112 +</p>
   1.113 +
   1.114 +<a name="repos"></a>
   1.115 +<h2>Mercurial repositories</h2>
   1.116 +<p>
   1.117 +	SliTaz Mercurial or Hg repos can be browsed or cloned by anyone using
   1.118 +	the URL: <a href="http://hg.slitaz.org/">http://hg.slitaz.org/</a>. People
   1.119 +	with write access can directly use <code>repos.slitaz.org</code> which
   1.120 +	requires authentication. Mercurial uses Python and is installable with: 
   1.121 +	<code>tazpkg get-install mercurial</code>
   1.122 +</p>
   1.123 +
   1.124 +<h3>~/.hgrc</h3>
   1.125 +<p>
   1.126 +	Before you push your first commit onto the server, be sure that you have a
   1.127 +	correct Hg configuration file with your name and email address, and remember
   1.128 +	to check that you are not root. Personal ~/.hgrc file example:
   1.129 +</p>
   1.130 +<pre class="script">
   1.131 +[ui]
   1.132 +username = FirstName LastName &lt;you@example.org&gt;
   1.133 +</pre>
   1.134 +<h4>Clone, modify, commit and push</h4>
   1.135 +<p>
   1.136 +Clone a repo, example for wok:
   1.137 +</p>
   1.138 +<pre>
   1.139 + $ hg clone http://repos.slitaz.org/wok
   1.140 +</pre>
   1.141 +<p>
   1.142 +Change directory to wok, note you must be in the repository to be able 
   1.143 +to use 'hg' commands. To check all logs or just the last log:
   1.144 +</p>
   1.145 +<pre>
   1.146 + $ hg log
   1.147 + $ hg head
   1.148 +</pre>
   1.149 +<p>
   1.150 +Add or modify one or more files and commit:
   1.151 +</p>
   1.152 +<pre>
   1.153 + $ hg add
   1.154 + $ hg status
   1.155 + $ hg commit -m "Log message..."
   1.156 + $ hg log
   1.157 +</pre>
   1.158 +<p>
   1.159 +Note that you can use the command <code>rollback</code> to roll back to the last 
   1.160 +transaction. Before pushing changes to the server, it is safe to pull once:
   1.161 +</p>
   1.162 +<pre>
   1.163 + $ hg pull
   1.164 + $ hg push
   1.165 +</pre>
   1.166 +<p>
   1.167 +Done, your changes, code or corrections are now on the server.
   1.168 +</p>
   1.169 +<h4>Updating a local wok</h4>
   1.170 +<p>
   1.171 +To update your wok with the local server (<em>pull</em> to pull the changes):
   1.172 +</p>
   1.173 +<pre>
   1.174 + $ hg pull -u
   1.175 +</pre>
   1.176 +<h4>Useful commands</h4>
   1.177 +<p>
   1.178 +Hg commands that can be used.
   1.179 +</p>
   1.180 +<ul>
   1.181 +	<li><code>hg help</code> : Display the full list of commands.</li>
   1.182 +	<li><code>hg rollback</code> : Undo the last action performed (commit,
   1.183 +	pull, push).</li>
   1.184 +	<li><code>hg log &lt;package&gt;</code> : Display a package log.</li>
   1.185 +	<li><code>hg head</code> : Display the last log.</li>
   1.186 +</ul>
   1.187 +
   1.188 +<a name="gui"></a>
   1.189 +<h2>GUI - Pure C/GTK, Yad, Vala/Genie and CGI/web</h2>
   1.190 +
   1.191 +<p>
   1.192 +	We have many way to create user interface in the open source world. From
   1.193 +	the start of the project until 3.0 we mainly used a tool called Gtkdialo
   1.194 +	who let us create nice and quiet complex interfaces in GTK but with a
   1.195 +	scripting language, no compilation, just run. But gtkdialog in unmaintained
   1.196 +	and lack about new GTK features, so we switched to Yad for simple GUI boxes.
   1.197 +	For all the admin, packages and configuration tools we switched to TazPanel,
   1.198 +	a CGI/web interface with all the gui in xHTML 5 and CSS 3.
   1.199 +</p>
   1.200 +<p>
   1.201 +	Now we Yad is very simple and dont allow us to create complex interface even
   1.202 +	if we just need 2 or 3 entry with label and a few buttons, so an other way
   1.203 +	must be used. The advantage of a scripting language is the fact we dont need
   1.204 +	to compile and can code in relatime, but it produce a slower applications.
   1.205 +	All in C is complex and we got less contributor since SHell script are easier
   1.206 +	to understand, so the guide line now is to keep and continue improving our
   1.207 +	cmdline tools and provide frontend in GTK or CGI/web.
   1.208 +</p>
   1.209 +<p>
   1.210 +	They is many new languages who let use GTK such as Genie, Vala or GTKaml.
   1.211 +	But keep in mind ther are not so popular than C and GTK and finaly not realy
   1.212 +	easier to learn and use, at least for simple fronted you finally use SHell
   1.213 +	scripts to perform tasks. Use can use Vala if you like but look at a pure
   1.214 +	GTK single window, it only 12 lines:
   1.215 +</p>
   1.216 +<pre>
   1.217 +#include &gt;gtk/gtk.h&lt;
   1.218 +
   1.219 +int main(int argc, char *argv[])
   1.220 +{
   1.221 +  GtkWidget *window;
   1.222 +  
   1.223 +  gtk_init(&amp;argc, &amp;argv);
   1.224 +  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   1.225 +  gtk_widget_show(window);
   1.226 +  gtk_main();
   1.227 +  return 0;
   1.228 +}
   1.229 +</pre>
   1.230 +<p>
   1.231 +	If you not sure about the language to use, discuss it on the mailing list.
   1.232 +	If you just want a small GUI function, look at tazbox in the slitaz-tools
   1.233 +	repo, it have tiny desktop tools such as a logout box. By the way the first
   1.234 +	SliTaz sub-project all written in pure GTK is TazWeb and you may learn
   1.235 +	some way to use system() to include system commands in your frontend. For
   1.236 +	example TazWeb use wget for downloads and sed to add bookmarks.
   1.237 +</p>
   1.238 +<p>
   1.239 +	Yad scripts should follow TazYad guidelines:
   1.240 +	<a href="http://hg.slitaz.org/slitaz-dev-tools/raw-file/tip/tazyad/README">
   1.241 +		README</a> and
   1.242 +	<a href="http://hg.slitaz.org/slitaz-dev-tools/raw-file/tip/tazyad/tazyad">
   1.243 +		exmaple code</a>
   1.244 +</p>
   1.245 +
   1.246 +<a name="iconv"></a>
   1.247 +<h2>Implementation of iconv()</h2>
   1.248 +<p>
   1.249 +SliTaz uses iconv() provided by GNU glibc - any packages that offer 
   1.250 +<code>libiconv</code> must use the library contained in <code>glibc-locale</code>. 
   1.251 +There is therefore no longer a libiconv package (1.2 MB) in SliTaz.
   1.252 +</p>
   1.253 +
   1.254 +<a name="pkgs"></a>
   1.255 +<h2>Tazpkg Packages</h2>
   1.256 +<p>
   1.257 +The tazpkg packages in SliTaz are automatically created via Tazwok and a 
   1.258 +receipt in the wok. The Cookbook describes the 
   1.259 +<a href="../doc/cookbook/wok-tools.html">use of tools</a> 
   1.260 +and the format of <a href="../doc/cookbook/receipts.html">receipts</a>.
   1.261 +These are required reading before we begin.
   1.262 +</p>
   1.263 +<p>
   1.264 +In terms of choice of package, the idea is to offer a package by task or 
   1.265 +functionality, ie. the lightest application in the field and not duplicated. 
   1.266 +Note that the current packages are not immutable, if you find an alternative 
   1.267 +that is lighter, with more features or more <em>sexy</em> for a few extra KB, 
   1.268 +you can suggest it on the Mailing List. Particular attention is given to 
   1.269 +packages for the LiveCD, these should be stripped, removing unnecesary 
   1.270 +dependancies and compiler options. In general candidate packages for the core 
   1.271 +LiveCD are discussed on the Mailing List.
   1.272 +</p>
   1.273 +<p>
   1.274 +Before you begin to compile and create packages for SliTaz, be sure that the 
   1.275 +work doesn't already exist in the 
   1.276 +<a href="http://download.tuxfamily.org/slitaz/packages/undigest/">undigest</a> 
   1.277 +wok provided by the primary SliTaz mirror. Don't forget that the members 
   1.278 +of the list are there to help you and that the documentation of the 
   1.279 +<a href="../doc/cookbook/wok-tools.html">wok and tools</a> 
   1.280 +exists to help you get started.
   1.281 +</p>
   1.282 +
   1.283 +<a name="pkgs-naming"></a>
   1.284 +<h3>Naming of packages</h3>
   1.285 +<p>
   1.286 +In most cases the package name is the same as the source, except for
   1.287 +Python, Perl, PHP, Ruby and Lua modules. For example, the package
   1.288 +providing a Kid template system written in Python and XML is named:
   1.289 +<code>python-kid</code>.
   1.290 +</p>
   1.291 +
   1.292 +<a name="website"></a>
   1.293 +<h2>Website Management</h2>
   1.294 +<p>
   1.295 +	The website is managed via a mercurial repository, they can be cloned by:
   1.296 +</p>
   1.297 +<pre>
   1.298 + $ hg clone http://hg.slitaz.org/website
   1.299 +  Or if you have the proper permissions:
   1.300 + $ hg clone http://repos.slitaz.org/website
   1.301 +</pre>
   1.302 +
   1.303 +<h3>xHTML coding style</h3>
   1.304 +<p>
   1.305 +The pages and different <em>books</em> are coded in xHTML 1.0
   1.306 +transitional. The title of level 1 is used only once (at the top), 
   1.307 +level 2 is the title of the document and levels 3 and 4 are then used for
   1.308 +the subtitles. If a list is used instead using smart anchors;
   1.309 +then that starts at the top, just after the title of level 2.
   1.310 +Paragraphs are contained in the tags <code>&lt;p&gt;&lt;/p&gt;</code>. 
   1.311 +For indentation, we use tabs - the reason being semantics and to take 
   1.312 +up less space in terms of octets (bytes). To put code, like the name of
   1.313 +a command inside a paragraph: <code>&lt;code&gt;</code> is the preferred 
   1.314 +method. To view commands or to utilize a terminal, the web pages use
   1.315 +<code>&lt;pre&gt;</code> to display the formatted text. Example:
   1.316 +</p>
   1.317 +<pre>
   1.318 + $ command
   1.319 +</pre>
   1.320 +<p>
   1.321 +To view text that can be copied and pasted, such as scripts,
   1.322 +bits of code, sample configuration files, etc - we also use
   1.323 +<code>&lt;pre&gt;</code>, but with a CSS class named "script". Example:
   1.324 +</p>
   1.325 +<pre class="script">
   1.326 +&lt;pre class="script"&gt;
   1.327 +
   1.328 +code...
   1.329 +
   1.330 +&lt;/pre&gt;
   1.331 +</pre>
   1.332 +<p>
   1.333 +The <em>emphasized</em> words put themselves in the tag <code>&lt;em&gt;</code> 
   1.334 +and internal links are relative. Remember to check the validity
   1.335 +of the code via the online <em>validator</em> of the W3C.
   1.336 +</p>
   1.337 +
   1.338 +<a name="diff"></a>
   1.339 +<h2>Diff and patch</h2>
   1.340 +<p>
   1.341 +The utilities <code>diff</code> and <code>patch</code> are command-line tools 
   1.342 +for creating and implementing a file containing differences between two files. 
   1.343 +This technique is often used for collaboration and the changes made to the 
   1.344 +original file can be clearly extracted. To create a <code>diff</code> file 
   1.345 +readable by humans in a simple text editor, you must supply the <code>-u</code> option:
   1.346 +</p>
   1.347 +<pre>
   1.348 + $ diff -u file.orig file.new &gt; file.diff
   1.349 +</pre>
   1.350 +<p>
   1.351 +To apply a patch:
   1.352 +</p>
   1.353 +<pre>
   1.354 + $ patch file.orig file.diff
   1.355 +</pre>
   1.356 +
   1.357 +<!-- End of content -->
   1.358 +</div>
   1.359 +
   1.360 +<!-- Footer -->
   1.361 +<div id="footer">
   1.362 +	Copyright &copy; <span class="year"></span>
   1.363 +	<a href="http://www.slitaz.org/">SliTaz</a> - Network:
   1.364 +	<a href="http://scn.slitaz.org/">Community</a>
   1.365 +	<a href="http://doc.slitaz.org/">Doc</a>
   1.366 +	<a href="http://forum.slitaz.org/">Forum</a>
   1.367 +	<a href="http://pkgs.slitaz.org/">Packages</a>
   1.368 +	<a href="http://bugs.slitaz.org">Bugs</a>
   1.369 +	<a href="http://hg.slitaz.org/">Hg</a>
   1.370 +	<p>
   1.371 +		SliTaz @
   1.372 +		<a href="http://twitter.com/slitaz">Twitter</a>
   1.373 +		<a href="http://www.facebook.com/slitaz">Facebook</a>
   1.374 +		<a href="http://distrowatch.com/slitaz">Distrowatch</a>
   1.375 +		<a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
   1.376 +		<a href="http://flattr.com/profile/slitaz">Flattr</a>
   1.377 +	</p>
   1.378 +</div>
   1.379 +
   1.380 +</body>
   1.381 +</html>