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