cookutils annotate README @ rev 255

cook: remove .hg dir when clonig from Hg
author Christophe Lincoln <pankso@slitaz.org>
date Sun May 29 04:14:18 2011 +0200 (2011-05-29)
parents 1e9981880495
children db0df9e1b946
rev   line source
pankso@0 1 SliTaz Cookutils
pankso@0 2 ================================================================================
pankso@0 3
pankso@0 4
pankso@0 5 The SliTaz Cookutils provide tools and utils to build SliTaz packages.
pankso@0 6
pankso@0 7
pankso@30 8 Cook
pankso@30 9 --------------------------------------------------------------------------------
paul@38 10 The cook tool should be used in a chroot environment: simply use the command
paul@38 11 'tazdev gen-chroot' to build one. You can also build packages directly but
pankso@0 12 build deps will not be handled correctly since cook will install missing
paul@38 13 packages to perform a build and then remove them only if they were not
pankso@0 14 installed before, this way we can keep a clean build environment.
pankso@0 15
paul@38 16 We use standard SliTaz paths to work such as /home/slitaz/wok, if you work on
pankso@0 17 cooking from stable or want to keep a clean system: create a chroot.
pankso@0 18
pankso@0 19 Cook features:
pankso@0 20
pankso@0 21 * Setup a build env
pankso@0 22 * Check and install missing build deps
pankso@0 23 * Compile and generate the package
pankso@0 24 * Remove installed build deps
pankso@0 25 * Provide a log for each cook
pankso@25 26 * Clean one or all packages in the wok
pankso@25 27 * Check for receipt and package quality
pankso@0 28
pankso@0 29 Cook does not:
pankso@0 30
paul@38 31 * Depend on Hg but can use it to manage a wok
pankso@253 32 * Do complex work like compiling the whole system from source in
pankso@253 33 one command, but can rebuild the full system step by step.
pankso@0 34 * Check build deps for you, use: BUILD_DEPENDS
pankso@0 35 If all deps are also build deps do: BUILD_DEPENDS="$DEPENDS"
pankso@0 36 * The work of a Build Bot, unix philosophy: one tool for one task
paul@38 37 * Cook a package if your receipt is crappy :-)
pankso@0 38
pankso@44 39 Cook paths variables used in receipt:
pankso@20 40
pankso@44 41 * $src : Package source: wok/pkg/source
pankso@44 42 * $stuff : Package stuff: wok/pkg/stuff
pankso@44 43 * $fs : Package file system: wok/pkg/taz/*/fs
pankso@44 44 * $install : All installed files by the package
pankso@25 45 Old style is $_pkg and cook is compatible
pankso@20 46
pankso@44 47 Cook internal paths variables:
pankso@44 48
pankso@44 49 * $pkgdir : Package directory in the wok: wok/pkg
pankso@44 50 * $receipt : Package receipt in wok: wok/pkg/receipt
pankso@44 51 * $taz : The taz directory: wok/pkg/taz
pankso@44 52 * $pack : Package to compress: wok/taz/pkg-*
pankso@44 53
paul@38 54 Cook also manages packages lists so they can be used for a personal packages
pankso@0 55 repository or sent to the official mirror. We create and use:
pankso@0 56
paul@38 57 * packages.list Simple list of package-versions
pankso@0 58 * packages.md5 MD5sum list of all packages
pankso@0 59 * packages.desc Packages with name, version, category, desc
paul@38 60 * packages.equiv Equivalent packages list
paul@38 61 * files.list.lzma A list of files provided by all packages
pankso@0 62
pankso@0 63
pankso@30 64 Cooker
pankso@30 65 --------------------------------------------------------------------------------
pankso@44 66 The Cooker is a Build Bot which automates the build process but doesn't make
pankso@44 67 the dinner for you! We need quality receipts to cook succesfully and the goal
pankso@44 68 is not to have a bloated script so please Keep It Short and Simple.
pankso@0 69
pankso@0 70 Cmdline tool : /usr/bin/cooker
pankso@20 71 Web interface : /var/www/cgi-bin/cooker
pankso@0 72 Cache folder : /home/slitaz/cache
pankso@0 73
paul@38 74 The web interface consists of one CGI script and one CSS style. Cook logs can
paul@38 75 be produced by cook and the cooker just acts as a fronted to check them in
pankso@44 76 a nice way. A web interface also highlights success and error and can show
pankso@44 77 receipts and the cooker logs such as the last ordered list or commits check.
pankso@25 78
pankso@59 79 Database files in the cache folder
pankso@59 80
pankso@59 81 * activity : Activity information for the web interface
pankso@59 82 * blocked : List of manually blocked packages
paul@62 83 * broken : Broken packages list, when cook fails it is added here
pankso@59 84 * commits : List of packages of the last commit check
paul@62 85 * cooklist : Cooklist for unbuilt packages or custom commands
pankso@59 86 * cooknotes : All the notes added with 'cooker -n "My note"
paul@62 87 * installed* : Lists used to compare installed packages before and after
paul@62 88 a package is cooked so we can remove them
pankso@59 89
pankso@253 90 The Cooker we interface can by highly customized through the CSS style and via
pankso@253 91 an optionnal header.html file that must be in the same directory than the CGI
pankso@253 92 script, like for style.css and a custom favicon. Yoou can find a header.html
pankso@253 93 example in the data/ directory or in /usr/share/cook if cookutils are installed.
pankso@253 94
pankso@25 95
pankso@30 96 Toolchain
pankso@30 97 --------------------------------------------------------------------------------
paul@38 98 To rebuild the full SliTaz toolchain at once - cook and the Cooker will use the
paul@38 99 slitaz-toolchain package. No built-in code manages that since it is not a
paul@38 100 common task. The toolchain package will build all needed packages in the correct
paul@38 101 order, which is very important.
pankso@30 102
pankso@30 103
pankso@25 104 Coding style
pankso@30 105 --------------------------------------------------------------------------------
pankso@30 106 Here are the cookutils coding style notes, follow them if you want your code
paul@38 107 included in the package.
pankso@25 108
pankso@30 109 * In all cases: KISS
paul@38 110 * Use tab and not space to indent
pankso@44 111 * Max 80 char by line (try to edit in a Xterm 80x24)
paul@38 112 * Use names rather than $1 $2 $3
paul@38 113 * Variables from config file are $UPPERCASE
pankso@25 114 * Variables initialized by cook are $lowercase
paul@38 115 * Functions can be a single word or use_underline()
pankso@25 116 my_function() {
pankso@25 117 echo "Hello World"
pankso@25 118 }
pankso@25 119 * Use $(command) and not: `command`
paul@38 120 * Cook uses gettext for messages, not the cooker
pankso@25 121 * If you add a feature, add also the doc to explain it
pankso@25 122 * Use clean case with space before case end ;;
paul@214 123 case "$pkg" in
pankso@25 124 a) echo "Hello World" ;;
pankso@25 125 *) continue ;;
paul@214 126 esac
paul@214 127 * Make commands and options as short as possible
paul@214 128 * Think to log everything to help debug
paul@214 129 * Quote variables if used in a test: [ "$var" ]
pankso@0 130
pankso@0 131
pankso@0 132 ================================================================================