-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfigure
executable file
·221 lines (184 loc) · 4.35 KB
/
configure
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#!/bin/sh
prefix='/usr/local'
bindir='$(prefix)/bin'
confdir='$(prefix)/etc'
datadir='$(prefix)/share'
libdir='$(prefix)/lib'
statedir='/var/spool/cron'
mandir='$(datadir)/man'
docdir='$(datadir)/doc/$(package)'
unitdir='$(libdir)/systemd/system'
runparts='/usr/bin/run-parts'
enable_strip=yes
# systemd ≥ 197
enable_boot=yes
enable_hourly=yes
enable_daily=yes
enable_weekly=yes
enable_monthly=yes
# systemd ≥ 209
enable_yearly=no
# systemd ≥ 212
enable_persistent=no
# systemd ≥ 217
enable_minutely=no
enable_quarterly=no
enable_semi_annually=no
# systemd ≥ 229
enable_randomized_delay=yes
ARGS=$(getopt -n "$(basename "${0}")" -o '' -l '
prefix:,
bindir:,
confdir:,
datadir:,
libdir:,
statedir:,
mandir:,
docdir:,
unitdir:,
runparts:,
enable-boot::,
enable-minutely::,
enable-hourly::,
enable-daily::,
enable-weekly::,
enable-monthly::,
enable-quarterly::,
enable-semi_annually::,
enable-yearly::,
enable-persistent::,
enable-randomized-delay::,
enable-strip::,
' -- "${@}")
if [ $? -ne 0 ]; then
exit 1
fi
set_enable_flag()
{
if [ -z ${2} ]; then
eval "enable_${1}=yes"
elif [ ${2} = 'yes' ] || [ ${2} = 'no' ]; then
eval "enable_${1}=${2}"
else
echo "ERROR: Unknown value for enable-${1}: '${2}'. Expected 'yes' or 'no'."
fi
}
eval set -- "${ARGS}"
while true;
do
case "${1}" in
'--prefix')
prefix="${2}"
shift 2;;
'--bindir')
bindir="${2}"
shift 2;;
'--confdir')
confdir="${2}"
shift 2;;
'--datadir')
datadir="${2}"
shift 2;;
'--libdir')
libdir="${2}"
shift 2;;
'--statedir')
statedir="${2}"
shift 2;;
'--mandir')
mandir="${2}"
shift 2;;
'--docdir')
docdir="${2}"
shift 2;;
'--unitdir')
unitdir="${2}"
shift 2;;
'--runparts')
runparts="${2}"
shift 2;;
'--enable-boot')
set_enable_flag boot ${2}
shift 2;;
'--enable-minutely')
set_enable_flag minutely ${2}
shift 2;;
'--enable-hourly')
set_enable_flag hourly ${2}
shift 2;;
'--enable-daily')
set_enable_flag daily ${2}
shift 2;;
'--enable-weekly')
set_enable_flag weekly ${2}
shift 2;;
'--enable-monthly')
set_enable_flag monthly ${2}
shift 2;;
'--enable-quarterly')
set_enable_flag quarterly ${2}
shift 2;;
'--enable-semi_annually')
set_enable_flag semi_annually ${2}
shift 2;;
'--enable-yearly')
set_enable_flag yearly ${2}
shift 2;;
'--enable-persistent')
set_enable_flag persistent ${2}
shift 2;;
'--enable-randomized-delay')
set_enable_flag randomized_delay ${2}
shift 2;;
'--enable-strip')
set_enable_flag strip ${2}
shift 2;;
'--')
shift
break;;
esac
done
if [ ${enable_boot} = 'yes' ]; then
schedules="${schedules} boot"
fi
if [ ${enable_minutely} = 'yes' ]; then
schedules="${schedules} minutely"
fi
if [ ${enable_hourly} = 'yes' ]; then
schedules="${schedules} hourly"
fi
if [ ${enable_daily} = 'yes' ]; then
schedules="${schedules} daily"
fi
if [ ${enable_weekly} = 'yes' ]; then
schedules="${schedules} weekly"
fi
if [ ${enable_monthly} = 'yes' ]; then
schedules="${schedules} monthly"
fi
if [ ${enable_quarterly} = 'yes' ]; then
schedules="${schedules} quarterly"
fi
if [ ${enable_semi_annually} = 'yes' ]; then
schedules="${schedules} semi-annually"
fi
if [ ${enable_yearly} = 'yes' ]; then
schedules="${schedules} yearly"
fi
echo '# Generated by ./configure' > Makefile
sed "
s|@schedules@|${schedules}|g
s|@enable_persistent@|${enable_persistent}|g
s|@enable_randomized_delay@|${enable_randomized_delay}|g
s|@enable_strip@|${enable_strip}|g
s|@prefix@|${prefix}|g
s|@bindir@|${bindir}|g
s|@confdir@|${confdir}|g
s|@datadir@|${datadir}|g
s|@libdir@|${libdir}|g
s|@statedir@|${statedir}|g
s|@mandir@|${mandir}|g
s|@docdir@|${docdir}|g
s|@unitdir@|${unitdir}|g
s|@runparts@|${runparts}|g
" Makefile.in >> Makefile