| 1 |
|
| 2 |
In script sections, platform-specific shell functions can be included by
|
| 3 |
invoking:
|
| 4 |
|
| 5 |
%(pp_functions <function-name> ...)
|
| 6 |
|
| 7 |
It is safe to include a function multiple times within the one call to
|
| 8 |
pp_functions, and dependencies on other functions will be resolved.
|
| 9 |
|
| 10 |
Notes to implementors:
|
| 11 |
When implementing these functions, note that arguments are already
|
| 12 |
checked for functions defined in this file.
|
| 13 |
Also, avoid the use of typeset and any ksh-isms. Assume ancient shell.
|
| 14 |
Use variable names starting with pp_tmp_
|
| 15 |
|
| 16 |
|
| 17 |
Common functions
|
| 18 |
----------------
|
| 19 |
|
| 20 |
pp_mkgroup group
|
| 21 |
|
| 22 |
Creates a local group (usually in /etc/group) with no members,
|
| 23 |
unless it already exists.
|
| 24 |
|
| 25 |
Returns success if the group creation succeeded or previously existed.
|
| 26 |
|
| 27 |
pp_mkuser user [group [homedir [shell]]]
|
| 28 |
|
| 29 |
Creates a local user entry. If the user already exists,
|
| 30 |
no action is performed and the function returns immediately.
|
| 31 |
|
| 32 |
If the group isn't specified, or is provided as '', then
|
| 33 |
the group name defaults to the same as the username.
|
| 34 |
|
| 35 |
If the group doesn't exist, it is created.
|
| 36 |
|
| 37 |
If the homedir isn't specified (or specified as ''), then
|
| 38 |
it defaults to "/nonexistent", or the platform equivalent.
|
| 39 |
The actual home directory is not created, nor populated.
|
| 40 |
|
| 41 |
If the shell is not specified, or is specified as '', then
|
| 42 |
it defaults to the platform's standard for indicating a
|
| 43 |
disabled account (typically /bin/false).
|
| 44 |
|
| 45 |
The function returns success if the user creation succeeded, or
|
| 46 |
the user previously existed.
|
| 47 |
|
| 48 |
pp_havelib name [major[.minor]] [searchpath]
|
| 49 |
|
| 50 |
This function returns true if a program dynamically
|
| 51 |
linked with -l<name> will have a chance of finding
|
| 52 |
its dependent library (ie, on some platforms, lib<name>.so).
|
| 53 |
|
| 54 |
The shared library search can be restricted to a particular
|
| 55 |
major/minor number by specifying the major[.minor] argument.
|
| 56 |
If no restriction is required, the mahor[.minor] argument can
|
| 57 |
be omitted or specified as ''.
|
| 58 |
|
| 59 |
The platform's standard library path is searched. Extra directories
|
| 60 |
for searching be provided with a colon-separated list of directories.
|
| 61 |
|
| 62 |
Note that this function is sensitive to the package being generated;
|
| 63 |
for example, if the target package is going to be labeled x86_64 and
|
| 64 |
the platform supports both 32 and 64 bit libraries, then only the
|
| 65 |
64 bit system library paths are searched.
|
| 66 |
|
| 67 |
[ Remember to update documentation in pp.back ]
|