cookutils rev 19

Add documentation (nor only manual but also howto) and put cooker.cgi in a cgi-bin dir so it works with Busybox httpd and LightTPD
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 05 21:14:03 2011 +0200 (2011-05-05)
parents 58496d7c2c18
children c7af43cc8a07
files Makefile doc/cookutils.en.html doc/cookutils.html doc/style.css
line diff
     1.1 --- a/Makefile	Thu May 05 19:09:32 2011 +0200
     1.2 +++ b/Makefile	Thu May 05 21:14:03 2011 +0200
     1.3 @@ -11,9 +11,9 @@
     1.4  	install -m 0777 cooker $(DESTDIR)$(PREFIX)/bin
     1.5  	install -m 0644 cook.conf $(DESTDIR)/etc/slitaz
     1.6  	install -m 0644 cook.site $(DESTDIR)/etc/slitaz
     1.7 -	install -m 0777 -d $(DESTDIR)/var/www/cooker
     1.8 +	install -m 0777 -d $(DESTDIR)/var/www/cgi-bin/cooker
     1.9  	install -m 0777 -d $(DESTDIR)$(PREFIX)/share/cook
    1.10 -	install -m 0644 web/* $(DESTDIR)/var/www/cooker
    1.11 +	install -m 0644 web/* $(DESTDIR)/var/www/cgi-bin/cooker
    1.12  	cp -r data/* $(DESTDIR)$(PREFIX)/share/cook
    1.13  
    1.14  uninstall:
    1.15 @@ -21,4 +21,4 @@
    1.16  		$(DESTDIR)$(PREFIX)/bin/cook \
    1.17  		$(DESTDIR)$(PREFIX)/bin/cooker \
    1.18  		$(DESTDIR)/etc/slitaz/cook.* \
    1.19 -		$(DESTDIR)/var/www/cooker
    1.20 +		$(DESTDIR)/var/www/cgi-bin/cooker
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/doc/cookutils.en.html	Thu May 05 21:14:03 2011 +0200
     2.3 @@ -0,0 +1,229 @@
     2.4 +<!DOCTYPE html>
     2.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     2.6 +<head>
     2.7 +	<title>Cookutils Documentation</title>
     2.8 +	<meta charset="utf-8" />
     2.9 +	<link rel="stylesheet" type="text/css" href="style.css" />
    2.10 +</head>
    2.11 +<body>
    2.12 +	
    2.13 +<div id="header">
    2.14 +	<h1>Cookutils Documentation</h1>
    2.15 +</div>
    2.16 +
    2.17 +<!-- Start content -->
    2.18 +<div id="content">
    2.19 +
    2.20 +<h2>SliTaz Cook &amp; Cooker</h2>
    2.21 +
    2.22 +<p>
    2.23 +	The SliTaz Cookutils provide tools and utils to build SliTaz packages. They
    2.24 +	are easy to use and learn, fast and light. You will be able to create SliTaz
    2.25 +	in a few commands. The cookutils provide the 'cook' utility and the
    2.26 +	<a href="#cooker">Cooker</a>.
    2.27 +</p>
    2.28 +<p>
    2.29 +	Cook let you compile and create a package, provide a log file and check
    2.30 +	receipt/package quality. The Cooker is a build bot with more automation
    2.31 +	and can be used as a frontend to cook, since it provide a CGI/web interface
    2.32 +	who let you view cook logs in a nice and colored way.
    2.33 +</p>
    2.34 +
    2.35 +<h3>Howto work</h3>
    2.36 +<p>
    2.37 +	The first thing you will have to do before building packages is to setup
    2.38 +	your environment. These 2 recommended way to work: cook directly on host
    2.39 +	or cook in chroot to protect your host. In the case you want to work in a
    2.40 +	chroot you can use Tazdev to create one and chroot in it: 
    2.41 +</p>
    2.42 +<pre>
    2.43 +# tazdev gen-chroot &amp;&amp; tazdev chroot
    2.44 +</pre>
    2.45 +
    2.46 +<h3>Getting started</h3>
    2.47 +<p>
    2.48 +	So you decided the way you want to work, so let prepare the cook environement.
    2.49 +	Cook use cook.conf configuration file, if you want to use custom path for
    2.50 +	SliTaz directories and files, you have to modify it. The setup will create
    2.51 +	some directories and files to keep trace on activity and error, all files
    2.52 +	are pure plain text files that you can open in a text editor. To prepare
    2.53 +	you environment:
    2.54 +</p>
    2.55 +<pre>
    2.56 +# cook setup
    2.57 +</pre>
    2.58 +
    2.59 +<h3>Test your environment</h3>
    2.60 +<p>
    2.61 +	Cook provide a test command who will create a package and cook it. This let
    2.62 +	you see if your enviroment and by the it provide and example package with
    2.63 +	a receipt. The create package is named 'cooktest' and can be removed after
    2.64 +	testing. To cook the cooktest:
    2.65 +</p>
    2.66 +<pre>
    2.67 +# cook test
    2.68 +</pre>
    2.69 +
    2.70 +<h3>Create and cook</h3>
    2.71 +<p>
    2.72 +	If you environment is setup corectly you can start creating and compiling
    2.73 +	SliTaz packages from your wok. To create a new package with an empty receipt:
    2.74 +</p>
    2.75 +<pre>
    2.76 +# cook new pkgname
    2.77 +</pre>
    2.78 +<p>
    2.79 +	If you just created a new package, you have to edit the receipt with your
    2.80 +	favorite text editor. When the receipt is ready or if you have existing
    2.81 +	packages, you can cook it:
    2.82 +</p>
    2.83 +<pre>
    2.84 +# cook pkgname
    2.85 +</pre>
    2.86 +<p>
    2.87 +	If all went well you will find your packages in $SLITAZ/packages
    2.88 +	directory and produced files in $SLITAZ/wok/pkgname. If you want to cook
    2.89 +	and install the package in one command:
    2.90 +</p>
    2.91 +<pre>
    2.92 +# cook pkgname --install
    2.93 +</pre>
    2.94 +
    2.95 +<h3>Clean packages</h3>
    2.96 +<p>
    2.97 +	After compilation and packaging ther is several files in the wok that take
    2.98 +	disk space. To clean a single package:
    2.99 +</p>
   2.100 +<pre>
   2.101 +# cook pkgname --clean
   2.102 +</pre>
   2.103 +<p>
   2.104 +	You can also clean the full wok at once or you can choose to keep SliTaz
   2.105 +	related files and just remove the source:
   2.106 +</p>
   2.107 +<pre>
   2.108 +# cook clean-wok
   2.109 +# cook clean-src
   2.110 +</pre>
   2.111 +
   2.112 +<h3>Packages lists</h3>
   2.113 +<p>
   2.114 +	Cook can list packages in the wok but also create suitable packages list
   2.115 +	for Tazpkg. That let you create a locale packages repository quiet easily
   2.116 +	and is used to create official SliTaz packages list found on mirrors. To
   2.117 +	list the current wok used by cook (you dont need to be root):
   2.118 +</p>
   2.119 +<pre>
   2.120 +$ cook list-wok
   2.121 +</pre>
   2.122 +<p>
   2.123 +	To create packages lists:
   2.124 +</p>
   2.125 +<pre>
   2.126 +# cook pkglist
   2.127 +</pre>
   2.128 +
   2.129 +<a name="cooker"></a>
   2.130 +<h3>The Cooker</h3>
   2.131 +<p>
   2.132 +	The Cooker is a Build Bot, it first usage is to check for commits in a wok,
   2.133 +	create an ordered cooklist and cook all modified packages. It can also be
   2.134 +	used as a frontend to cook since they use the same files. The Cooker can
   2.135 +	also be used to cook a big list of packages at once such has all package
   2.136 +	of a flavor. The Cooker provide a nice CGI/Web interface that works by
   2.137 +	default on any SliTaz system since we provide CGI support via Busybox httpd
   2.138 +	web server.
   2.139 +</p>
   2.140 +
   2.141 +<h3>Cooker setup</h3>
   2.142 +<p>
   2.143 +	Like cook, the Cooker needs a working environment before starting using it.
   2.144 +	The main difference with the cook environment is that the Cooker needs 2 wok.
   2.145 +	One Hg and clean wok as reference and one build wok, in this way is is easy
   2.146 +	to compare both wok and get modifications. If you already have a cook
   2.147 +	environement, you must move your wok before setting up the Cooker or it
   2.148 +	will complain:
   2.149 +</p>
   2.150 +<pre>
   2.151 +# cooker --setup
   2.152 +</pre>
   2.153 +<p>
   2.154 +	If all went well you have now 2 wok, base developement packages installed
   2.155 +	and all needed files created. The default behavor is to check for commits,
   2.156 +	you can run a test:
   2.157 +</p>
   2.158 +<pre>
   2.159 +# cooker
   2.160 +</pre>
   2.161 +
   2.162 +<h3>Cooker cook</h3>
   2.163 +<p>
   2.164 +	Again, 2 way to work now: make change in the clean Hg wok and launch the
   2.165 +	cooker without any argument or cook packages manually. The cooker let you
   2.166 +	cook a single package, all packages of a category or a flavor. You can also
   2.167 +	try to build all unbuilt packages, but be aware the Cooker was not designed
   2.168 +	to handle thousand of packages.
   2.169 +</p>
   2.170 +<p>
   2.171 +	To cook a single package wich is the same than 'cook pkgname' but with more
   2.172 +	logs:
   2.173 +</p>
   2.174 +<pre>
   2.175 +# cooker --pkg=pkgname
   2.176 +</pre>
   2.177 +<p>
   2.178 +	To cook more than one package at once you have different kind of choices.
   2.179 +	The currently implemeted way (more will come such as --list= --flavor=)
   2.180 +</p>
   2.181 +<pre>
   2.182 +# cooker --cat=pkg-category
   2.183 +</pre>
   2.184 +
   2.185 +<h3>Cooker CGI/Web</h3>
   2.186 +<p>
   2.187 +	To let you view log files in a nice way, keep activity trace and help find
   2.188 +	errors, you can use the Cooker Web interface located by default in
   2.189 +	/var/www/cooker. If you dont use a chroot and the Busybox httpd web server
   2.190 +	is running, the web interface will work without modifiaction and should be
   2.191 +	reachable at: <a href="http://localhost/cgi-bin/cooker/cooker.cgi">
   2.192 +		http://localhost/cgi-bin/cooker/cooker.cgi</a> 
   2.193 +</p>
   2.194 +<p>
   2.195 +	If you used a chroot environment, you should also install cookutils on your
   2.196 +	host and modify the SLITAZ path variable. A standard working way is to have
   2.197 +	a chroot in:
   2.198 +</p>
   2.199 +<pre>
   2.200 +/home/slitaz/cooking/chroot
   2.201 +</pre>
   2.202 +<p>
   2.203 +With /etc/slitaz/cook.conf modified as bellow:
   2.204 +</p>
   2.205 +<pre>
   2.206 +SLITAZ="/home/slitaz/cooking/chroot/home/slitaz"
   2.207 +</pre>
   2.208 +<p>
   2.209 +	Note: It's not obligatory to install the cookutils on your host to use the
   2.210 +	web interface, you can also copy the cooker.cgi and style.css files for
   2.211 +	example in your ~/Public directory and use a custom cook.conf with it. Say
   2.212 +	you have cloned or downloaded the cookutils:
   2.213 +</p>
   2.214 +<pre>
   2.215 +$ cp cookutils/web ~/Public/cgi-bin/cooker
   2.216 +$ cp cookutils/cook.conf ~/Public/cgi-bin/cooker
   2.217 +</pre>
   2.218 +<p>
   2.219 +Edit ~/Public/cgi-bin/cooker/cook.conf and you all done!
   2.220 +</p>
   2.221 +
   2.222 +
   2.223 +<!-- End content -->
   2.224 +</div>
   2.225 +
   2.226 +<div id="footer">
   2.227 +	Copyright &copy; 2011 SliTaz contributors
   2.228 +</div>
   2.229 +
   2.230 +</body>
   2.231 +</html>
   2.232 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/doc/cookutils.html	Thu May 05 21:14:03 2011 +0200
     3.3 @@ -0,0 +1,1 @@
     3.4 +cookutils.en.html
     3.5 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/doc/style.css	Thu May 05 21:14:03 2011 +0200
     4.3 @@ -0,0 +1,29 @@
     4.4 +/* CSS style for SliTaz Doc */
     4.5 +
     4.6 +body { font: 88% sans-serif, vernada, arial; margin: 0; }
     4.7 +h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; }
     4.8 +h2 { color: #444; } h3 { color: #666; font-size: 140%; }
     4.9 +a:hover { text-decoration: none; }
    4.10 +pre {
    4.11 +	background-color: #f8f8f8;
    4.12 +	border: 1px solid #ddd;
    4.13 +	padding: 10px;
    4.14 +	border-radius: 4px;
    4.15 +}
    4.16 +
    4.17 +#header {
    4.18 +	background: #351a0a;
    4.19 +	height: 40px;
    4.20 +	border-bottom: 8px solid #d66018;
    4.21 +}
    4.22 +
    4.23 +#content {
    4.24 +	margin: 40px 80px;
    4.25 +	text-align: justify;
    4.26 +}
    4.27 +
    4.28 +#footer {
    4.29 +	text-align: center;
    4.30 +	padding: 20px;
    4.31 +	border-top: 1px solid #ddd;
    4.32 +}