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
|
paul@38
|
32 * Do complex work like compiling the whole system from source
|
pankso@0
|
33 * Check build deps for you, use: BUILD_DEPENDS
|
pankso@0
|
34 If all deps are also build deps do: BUILD_DEPENDS="$DEPENDS"
|
pankso@0
|
35 * The work of a Build Bot, unix philosophy: one tool for one task
|
paul@38
|
36 * Cook a package if your receipt is crappy :-)
|
pankso@0
|
37
|
pankso@20
|
38 Cook variables used in receipt:
|
pankso@20
|
39
|
pankso@20
|
40 * $src : Path to package source: wok/pkg/source
|
pankso@20
|
41 * $stuff : Path to package stuff: wok/pkg/stuff
|
pankso@20
|
42 * $fs : Path to package file system: wok/pkg/taz/*/fs
|
pankso@20
|
43 * $install : Path to all installed files by the package
|
pankso@25
|
44 Old style is $_pkg and cook is compatible
|
pankso@20
|
45
|
paul@38
|
46 Cook also manages packages lists so they can be used for a personal packages
|
pankso@0
|
47 repository or sent to the official mirror. We create and use:
|
pankso@0
|
48
|
paul@38
|
49 * packages.list Simple list of package-versions
|
pankso@0
|
50 * packages.md5 MD5sum list of all packages
|
pankso@0
|
51 * packages.desc Packages with name, version, category, desc
|
paul@38
|
52 * packages.equiv Equivalent packages list
|
paul@38
|
53 * files.list.lzma A list of files provided by all packages
|
pankso@0
|
54
|
pankso@0
|
55
|
pankso@30
|
56 Cooker
|
pankso@30
|
57 --------------------------------------------------------------------------------
|
paul@38
|
58 The Cooker is a Build Bot which automates the build process but doesn't make the dinner
|
paul@38
|
59 for you! We need quality receipts to cook succesfully and the goal is not to have
|
pankso@0
|
60 a bloated script so please Keep It Short and Simple.
|
pankso@0
|
61
|
pankso@0
|
62 Cmdline tool : /usr/bin/cooker
|
pankso@20
|
63 Web interface : /var/www/cgi-bin/cooker
|
pankso@0
|
64 Cache folder : /home/slitaz/cache
|
pankso@0
|
65
|
paul@38
|
66 The web interface consists of one CGI script and one CSS style. Cook logs can
|
paul@38
|
67 be produced by cook and the cooker just acts as a fronted to check them in
|
paul@38
|
68 a nice way. A web interface also highlights success and error and can show receipts
|
pankso@25
|
69 and the cooker logs such as the last ordered list or commits check.
|
pankso@25
|
70
|
pankso@25
|
71
|
pankso@30
|
72 Toolchain
|
pankso@30
|
73 --------------------------------------------------------------------------------
|
paul@38
|
74 To rebuild the full SliTaz toolchain at once - cook and the Cooker will use the
|
paul@38
|
75 slitaz-toolchain package. No built-in code manages that since it is not a
|
paul@38
|
76 common task. The toolchain package will build all needed packages in the correct
|
paul@38
|
77 order, which is very important.
|
pankso@30
|
78
|
pankso@30
|
79
|
pankso@25
|
80 Coding style
|
pankso@30
|
81 --------------------------------------------------------------------------------
|
pankso@30
|
82 Here are the cookutils coding style notes, follow them if you want your code
|
paul@38
|
83 included in the package.
|
pankso@25
|
84
|
pankso@30
|
85 * In all cases: KISS
|
paul@38
|
86 * Use tab and not space to indent
|
paul@38
|
87 * Use names rather than $1 $2 $3
|
paul@38
|
88 * Variables from config file are $UPPERCASE
|
pankso@25
|
89 * Variables initialized by cook are $lowercase
|
paul@38
|
90 * Functions can be a single word or use_underline()
|
pankso@25
|
91 my_function() {
|
pankso@25
|
92 echo "Hello World"
|
pankso@25
|
93 }
|
pankso@25
|
94 * Use $(command) and not: `command`
|
paul@38
|
95 * Cook uses gettext for messages, not the cooker
|
pankso@25
|
96 * If you add a feature, add also the doc to explain it
|
pankso@25
|
97 * Use clean case with space before case end ;;
|
pankso@25
|
98 case "$pkg" in
|
pankso@25
|
99 a) echo "Hello World" ;;
|
pankso@25
|
100 *) continue ;;
|
pankso@25
|
101 esac
|
pankso@25
|
102 * Make commands and options as short as possible
|
pankso@25
|
103 * Think to log everything to help debug
|
pankso@0
|
104
|
pankso@0
|
105
|
pankso@0
|
106 ================================================================================
|