-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpp.back
59 lines (58 loc) · 2.59 KB
/
pp.back
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
#
# Backend API
#
# Each backend for a platform <P> should provide these functions
#
# pp_backend_P_init - Initialises variables that the %set may replace
# pp_backend_P - Reads the output files from the frontend and generate
# the single output package file in $pp_wrkdir
# pp_backend_P_names - Prints the output package names, without the
# $pp_wrkdir prefix. The names should start with
# "$name-$version"
# pp_backend_P_probe - Prints the short platform identifier
# pp_backend_P_cleanup - Removes leftover temporary files, and may be
# called without pp_backend_P_init/pp_backend_P
# being invoked.
# pp_backend_P_detect - Returns true if running on the given platform.
# First argument is output of 'uname -s'
# pp_backend_P_init_svc_vars - Initialise per-service variables
# pp_backend_P_install_script - Generates a script file that installs/
# upgrades the recently package built
# pp_backend_P_function - Generates shell code for platform functions
#
# A backend should also add itself to the $pp_platforms variable
#
# Variable assumptions the platform functions may make are
#
# $name
# $version
# $summary
# $description
# $copyright
# $vendor
#
# Backends for platform P can use private variables of the form $pp_P_*
# and document user-provided variables of the form $P_* where P is the
# platform name (eg aix or linux)
#
# Helper functions are:
#
# pp_mkgroup group -- no effect if group exists
# pp_mkuser [-d home] [-g group] user -- no effect if user exists
# pp_havelib name [major[.minor] [directory...]]
#
#@ pp_backend_init(): call the current platform backend's initialiser
#@ pp_backend(): call the current platform backend's processor
#@ pp_backend_names(): print the current platform backend's package names
#@ pp_backend_cleanup(): call the current platform backend's cleanup
#@ pp_backend_init_svc_vars(): call the current platform backend's svc var init
#@ pp_backend_install_script(): call the current backend's install script gen
#@ pp_backend_function(): emit a helper function
#@ pp_backend_probe(): print the current platform's short identifier
#@ pp_backend_vas_platforms(): print the current VAS platform's identifier(s)
#-- these functions are so similar, we generate them
for _sufx in _init '' _names _cleanup _install_script \
_init_svc_vars _function _probe _vas_platforms
do
eval "pp_backend$_sufx () { pp_debug pp_backend$_sufx; pp_backend_\${pp_platform}$_sufx \"\$@\"; }"
done