cookutils rev 906

Add doc/receipts-v2.md (unfinished)...
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat May 27 17:40:33 2017 +0300 (2017-05-27)
parents c711ef2e51a9
children ae08a6458965
files doc/receipts-v2.md
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/receipts-v2.md	Sat May 27 17:40:33 2017 +0300
     1.3 @@ -0,0 +1,91 @@
     1.4 +Brief info about SliTaz receipts v2
     1.5 +===================================
     1.6 +
     1.7 +Version 2 was developed as an extension of the receipts in order to facilitate
     1.8 +the maintenance of packages by small forces.
     1.9 +
    1.10 +In order to switch to version 2, you must specify 'v2' in the first line of the
    1.11 +receipt:
    1.12 +
    1.13 +    # SliTaz package receipt v2.
    1.14 +
    1.15 +You can write the single receipt v2 to compile, for example `attr` sources and
    1.16 +then make two packages: `attr` and `attr-dev` using compiled files. Next we will
    1.17 +call `attr` the *main package*, while `attr-dev` -- the *split package*.
    1.18 +
    1.19 +You must specify all the names of *split packages* that must be created after
    1.20 +the compilation in the SPLIT variable. Example for our `attr` receipt:
    1.21 +
    1.22 +    SPLIT="attr-dev"
    1.23 +
    1.24 +You must specify rules to generate each package inside the genpkg_rules().
    1.25 +Example for package `attr`:
    1.26 +
    1.27 +    genpkg_rules()
    1.28 +    {
    1.29 +        case $PACKAGE in
    1.30 +            attr) copy @std ;;
    1.31 +            attr-dev) copy @dev ;;
    1.32 +        esac
    1.33 +    }
    1.34 +
    1.35 +Here, in every rule you can:
    1.36 +
    1.37 +  * use the `copy()` function or other methods to copy specified files from
    1.38 +    $install to $fs.
    1.39 +  * define the DEPENDS variable for specified package; you may omit this
    1.40 +    definition, then it will mean the following:
    1.41 +    * for the *main package*: it don't depends on any package;
    1.42 +    * for the *split packages*: it depends exclusively on *main package*.
    1.43 +    Note, receipt is the shell script with all its restrictions: there's no
    1.44 +    difference if you define empty DEPENDS variable or not define it at all.
    1.45 +    Here's the small trick: if you really want to define empty dependency,
    1.46 +    put single space between the quotes: `DEPENDS=" "`.
    1.47 +  * define the two-in-one CAT variable for *split packages*. Variable format:
    1.48 +
    1.49 +    ```
    1.50 +    CAT="category|addition"
    1.51 +    ```
    1.52 +
    1.53 +    Where `category` is just the choosed category for the specified *split
    1.54 +    package*. And `addition` you will find in the brackets at the end of
    1.55 +    short description of the specified *split package*. You may omit this
    1.56 +    definition for the "dev" packages. In this case it will be implicitly
    1.57 +    defined as:
    1.58 +
    1.59 +    ```
    1.60 +    CAT="development|development files"
    1.61 +    ```
    1.62 +  * define some other variables, like COOKOPTS.
    1.63 +
    1.64 +
    1.65 +Long descriptions
    1.66 +-----------------
    1.67 +
    1.68 +You may provide `description.txt` for the *main package* and/or
    1.69 +`description.package-name.txt` for any of the *split package*.
    1.70 +
    1.71 +
    1.72 +`post_install()` and friends
    1.73 +----------------------------
    1.74 +
    1.75 +You may define one of the following functions:
    1.76 +
    1.77 +  * `pre_install()`;
    1.78 +  * `post_install()`;
    1.79 +  * `pre_remove()`;
    1.80 +  * `post_remove()`.
    1.81 +
    1.82 +These functions may be defined for every of *main* or *split package*, so
    1.83 +you need to extend function name with underscore (`_`) and the package name.
    1.84 +Like this for `cookutils` package:
    1.85 +
    1.86 +    post_install_cookutils()
    1.87 +
    1.88 +Attention! You should know that some characters that are valid in package names
    1.89 +are not allowed in function names. Please, substitute each symbol that not
    1.90 +belongs to the intervals `A-Z, a-z, 0-9` by yet another underscore (`_`).
    1.91 +Example for `coreutils-disk`:
    1.92 +
    1.93 +    post_install_coreutils_disk()
    1.94 +