-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_expand.sh.in
72 lines (60 loc) · 1.64 KB
/
build_expand.sh.in
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
#! /bin/bash
#
# Expand configure variables in given files
#
# Files to proceed ---------------------------------------------------------------------
if [ $# -gt 0 ] ; then
files="$@"
else
files=""
fi
# Package identification ---------------------------------------------------------------
SECTION="@SECTION@"
PACKAGE_NAME="@PACKAGE_NAME@"
PACKAGE_TARNAME="@PACKAGE_TARNAME@"
PACKAGE_VERSION="@PACKAGE_VERSION@"
PACKAGE_STRING="@PACKAGE_STRING@"
# Base directories ---------------------------------------------------------------------
prefix="@prefix@"
exec_prefix="@exec_prefix@"
sbindir="@sbindir@"
bindir="@bindir@"
liblsb="@liblsb@"
libdir="@libdir@"
libexecdir="@libexecdir@"
sysconfdir="@sysconfdir@"
confdir="@confdir@"
localstatedir="@localstatedir@"
datarootdir="@datarootdir@"
datadir="@datadir@"
logdir="@logdir@"
docdir="@docdir@"
spooldir="@spooldir@"
sedf=configure_expand.sed.$$
cat << __EOFF__ | tr -d '!' > $sedf
s#\${!SECTION!}#$SECTION#g
s#\${!PACKAGE_NAME!}#$PACKAGE_NAME#g
s#\${!PACKAGE_TARNAME!}#$PACKAGE_TARNAME#g
s#\${!PACKAGE_VERSION!}#$PACKAGE_VERSION#g
s#\${!PACKAGE_STRING!}#$PACKAGE_STRING#g
s#\${!prefix!}#$prefix#g
s#\${!exec_prefix!}#$exec_prefix#g
s#\${!sbindir!}#$sbindir#g
s#\${!bindir!}#$bindir#g
s#\${!liblsb!}#$liblsb#g
s#\${!libdir!}#$libdir#g
s#\${!libexecdir!}#$libexecdir#g
s#\${!sysconfdir!}#$sysconfdir#g
s#\${!confdir!}#$confdir#g
s#\${!localstatedir!}#$localstatedir#g
s#\${!datarootdir!}#$datarootdir#g
s#\${!datadir!}#$datadir#g
s#\${!logdir!}#$logdir#g
s#\${!docdir!}#$docdir#g
s#\${!spooldir!}#$spooldir#g
__EOFF__
for f in $files; do
echo "Process file $f"
sed --in-place --file $sedf $f
done
rm -f $sedf