-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpp.back.inst
155 lines (134 loc) · 4.06 KB
/
pp.back.inst
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# IRIX inst backend
#
# executables are either going to be mips3 or mips4 and N32 or elf64.
# so the package format is going to be mips3n32
# inst(1M) is the tool for installing packages
# gendist(1M) is the tool for making packages.
# It takes a tree of files, a spec file and an idb file
# The spec file is a text description like this:
# include file
# define variable value
# product xx
# attribute ...
# image yy
# attribute ...
# subsystem zzz
# attribute ...
# endsubsys
# endimage
# endproduct
#
# Attributes include
# id "<title-string>"
# version <number>
# mach "<machtag>"
#
# The idb file contains one line for each file or directory with
# optional extra attributes
# config([update|suggest|noupdate])
# symval(<symlink-target>)
# postop(cmd)
#
pp_platforms="$pp_platforms inst"
#@ pp_backend_inst_detect(uname_s): return true if matches uname on inst
pp_backend_inst_detect () {
case "$1" in
IRIX*) return 0;;
*) return 1;;
esac
}
#@ pp_backend_inst_init(): initialises platform variables for inst
pp_backend_inst_init () {
pp_readlink_fn=pp_ls_readlink
}
pp_backend_inst_create_idb()
{
typeset t m o g f p st
while read t m o g f p st; do
if test x"$o" = x"-"; then
o="root"
fi
if test x"$g" = x"-"; then
g="sys"
fi
case "$t" in
f) test x"$m" = x"-" && m=444
echo "f 0$m $o $g $p $p $name.sw.base"
;;
d) test x"$m" = x"-" && m=555
echo "d 0$m $o $g $p $p $name.sw.base"
;;
s) test x"$m" = x"-" && m=777
test x"$m" = x"777" ||
pp_warn "$p: invalid mode $m for symlink, should be 777 or -"
echo "l 0$m $o $g $p $p $name.sw.base symval($st)"
;;
esac
done
}
pp_backend_inst_create_spec()
{
echo "product $name"
echo " id \"${summary}. Version: ${version}\""
echo " image sw"
echo " id \"Software\""
echo " version $version"
echo " order 9999"
echo " subsys base"
echo " id \"Base Software\""
echo " replaces self"
echo " exp $name.sw.base"
echo " endsubsys"
echo " endimage"
echo "endproduct"
}
#@ pp_backend_inst(): processes output files to generate a package files
pp_backend_inst () {
curdir=`pwd`
cd "$pp_opt_wrkdir"
# initialize
pp_inst_tardist=tardist
pp_inst_spec=${name}.spec
pp_inst_idb=${name}.idb
rm -rf $pp_inst_tardist $pp_inst_spec $pp_inst_idb
mkdir -p $pp_inst_tardist
# Create idb file
(for _cmp in $pp_components; do
cat %files.$_cmp | sort +4u -6 | pp_backend_inst_create_idb
done) >> $pp_inst_idb
pp_backend_inst_create_spec >> $pp_inst_spec
# Generate tardist
gendist -verbose -all -root / -source $pp_opt_destdir -idb $pp_inst_idb -spec $pp_inst_spec -dist $pp_inst_tardist $name
tar -cvf `pp_backend_inst_names` $pp_inst_tardist
cd "$curdir"
}
#@ pp_backend_inst_cleanup(): removes any files created outside $pp_wrkdir
pp_backend_inst_cleanup () {
:
}
#@ pp_backend_inst_names(): prints the paths to package files
# each path should start with $name-$version
# the package must be relative to the $pp_wrkdir directory
pp_backend_inst_names () {
echo ${name}-${version}.tardist
}
#@ pp_backend_inst_install_script(component): generate helper install script
pp_backend_inst_install_script () {
:
}
#@ pp_backend_inst_function(func): output one platform-dependent function
pp_backend_inst_function () {
echo false
}
#@ pp_backend_inst_init_svc_vars(): initialise service vars
pp_backend_inst_init_svc_vars () {
:
}
#@ pp_backend_inst_probe(): output local platform's short name
pp_backend_inst_probe () {
cpu=`hinv|sed -n '/^CPU/{s/000 /k /;s/^CPU: //;s/ Process.*//;s/^MIPS //;p;q;}'|tr A-Z a-z`
echo irix`uname -r`-$cpu
}
pp_backend_inst_vas_platforms () {
echo "irix-65"
}