rev |
line source |
al@906
|
1 Brief info about SliTaz receipts v2
|
al@906
|
2 ===================================
|
al@906
|
3
|
al@906
|
4 Version 2 was developed as an extension of the receipts in order to facilitate
|
al@906
|
5 the maintenance of packages by small forces.
|
al@906
|
6
|
al@906
|
7 In order to switch to version 2, you must specify 'v2' in the first line of the
|
al@906
|
8 receipt:
|
al@906
|
9
|
al@906
|
10 # SliTaz package receipt v2.
|
al@906
|
11
|
al@906
|
12 You can write the single receipt v2 to compile, for example `attr` sources and
|
al@906
|
13 then make two packages: `attr` and `attr-dev` using compiled files. Next we will
|
al@906
|
14 call `attr` the *main package*, while `attr-dev` -- the *split package*.
|
al@906
|
15
|
al@906
|
16 You must specify all the names of *split packages* that must be created after
|
al@906
|
17 the compilation in the SPLIT variable. Example for our `attr` receipt:
|
al@906
|
18
|
al@906
|
19 SPLIT="attr-dev"
|
al@906
|
20
|
al@906
|
21 You must specify rules to generate each package inside the genpkg_rules().
|
al@906
|
22 Example for package `attr`:
|
al@906
|
23
|
al@906
|
24 genpkg_rules()
|
al@906
|
25 {
|
al@906
|
26 case $PACKAGE in
|
al@906
|
27 attr) copy @std ;;
|
al@906
|
28 attr-dev) copy @dev ;;
|
al@906
|
29 esac
|
al@906
|
30 }
|
al@906
|
31
|
al@906
|
32 Here, in every rule you can:
|
al@906
|
33
|
al@906
|
34 * use the `copy()` function or other methods to copy specified files from
|
al@906
|
35 $install to $fs.
|
al@906
|
36 * define the DEPENDS variable for specified package; you may omit this
|
al@906
|
37 definition, then it will mean the following:
|
al@906
|
38 * for the *main package*: it don't depends on any package;
|
al@906
|
39 * for the *split packages*: it depends exclusively on *main package*.
|
al@906
|
40 Note, receipt is the shell script with all its restrictions: there's no
|
al@906
|
41 difference if you define empty DEPENDS variable or not define it at all.
|
al@906
|
42 Here's the small trick: if you really want to define empty dependency,
|
al@906
|
43 put single space between the quotes: `DEPENDS=" "`.
|
al@906
|
44 * define the two-in-one CAT variable for *split packages*. Variable format:
|
al@906
|
45
|
al@906
|
46 ```
|
al@906
|
47 CAT="category|addition"
|
al@906
|
48 ```
|
al@906
|
49
|
al@906
|
50 Where `category` is just the choosed category for the specified *split
|
al@906
|
51 package*. And `addition` you will find in the brackets at the end of
|
al@906
|
52 short description of the specified *split package*. You may omit this
|
al@906
|
53 definition for the "dev" packages. In this case it will be implicitly
|
al@906
|
54 defined as:
|
al@906
|
55
|
al@906
|
56 ```
|
al@906
|
57 CAT="development|development files"
|
al@906
|
58 ```
|
al@906
|
59 * define some other variables, like COOKOPTS.
|
al@906
|
60
|
al@906
|
61
|
al@906
|
62 Long descriptions
|
al@906
|
63 -----------------
|
al@906
|
64
|
al@906
|
65 You may provide `description.txt` for the *main package* and/or
|
al@906
|
66 `description.package-name.txt` for any of the *split package*.
|
al@906
|
67
|
al@906
|
68
|
al@906
|
69 `post_install()` and friends
|
al@906
|
70 ----------------------------
|
al@906
|
71
|
al@906
|
72 You may define one of the following functions:
|
al@906
|
73
|
al@906
|
74 * `pre_install()`;
|
al@906
|
75 * `post_install()`;
|
al@906
|
76 * `pre_remove()`;
|
al@906
|
77 * `post_remove()`.
|
al@906
|
78
|
al@906
|
79 These functions may be defined for every of *main* or *split package*, so
|
al@906
|
80 you need to extend function name with underscore (`_`) and the package name.
|
al@906
|
81 Like this for `cookutils` package:
|
al@906
|
82
|
al@906
|
83 post_install_cookutils()
|
al@906
|
84
|
al@906
|
85 Attention! You should know that some characters that are valid in package names
|
al@906
|
86 are not allowed in function names. Please, substitute each symbol that not
|
al@906
|
87 belongs to the intervals `A-Z, a-z, 0-9` by yet another underscore (`_`).
|
al@906
|
88 Example for `coreutils-disk`:
|
al@906
|
89
|
al@906
|
90 post_install_coreutils_disk()
|
al@906
|
91
|