diff options
-rwxr-xr-x | platform/rpm/mkrpm.sh | 29 | ||||
-rwxr-xr-x | test/compile/compile.sh | 38 |
2 files changed, 34 insertions, 33 deletions
diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh index d32ccd360..de26ca8d1 100755 --- a/platform/rpm/mkrpm.sh +++ b/platform/rpm/mkrpm.sh | |||
@@ -8,18 +8,18 @@ | |||
8 | # Builds rpms in a temporary directory then places the result in the | 8 | # Builds rpms in a temporary directory then places the result in the |
9 | # current working directory. | 9 | # current working directory. |
10 | 10 | ||
11 | name=$1 | 11 | name="$1" |
12 | # Strip any trailing prefix from the version like -rc1 etc | 12 | # Strip any trailing prefix from the version like -rc1 etc |
13 | version=$(echo "$2" | sed 's/\-.*//g') | 13 | version="$(printf '%s\n' "$2" | sed 's/\-.*//g')" |
14 | config_opt=$3 | 14 | config_opt="$3" |
15 | 15 | ||
16 | if [[ ! -f platform/rpm/${name}.spec ]]; then | 16 | if [[ ! -f "platform/rpm/${name}.spec" ]]; then |
17 | echo error: spec file not found for name \"${name}\" | 17 | printf 'error: spec file not found for name %s\n' "${name}" >&2 |
18 | exit 1 | 18 | exit 1 |
19 | fi | 19 | fi |
20 | 20 | ||
21 | if [[ -z "${version}" ]]; then | 21 | if [[ -z "${version}" ]]; then |
22 | echo error: version must be given | 22 | printf 'error: version must be given\n' >&2 |
23 | exit 1 | 23 | exit 1 |
24 | fi | 24 | fi |
25 | 25 | ||
@@ -28,26 +28,27 @@ if [[ -z "${config_opt}" ]]; then | |||
28 | fi | 28 | fi |
29 | 29 | ||
30 | # Make a temporary directory and arrange to clean up on exit | 30 | # Make a temporary directory and arrange to clean up on exit |
31 | tmpdir=$(mktemp -d) | 31 | tmpdir="$(mktemp -d)" |
32 | mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} | 32 | mkdir -p "${tmpdir}"/{BUILD,RPMS,SOURCES,SPECS,SRPMS} |
33 | function cleanup { | 33 | function cleanup { |
34 | rm -rf ${tmpdir} | 34 | rm -rf "${tmpdir}" |
35 | } | 35 | } |
36 | trap cleanup EXIT | 36 | trap cleanup EXIT |
37 | 37 | ||
38 | # Create the spec file | 38 | # Create the spec file |
39 | tmp_spec_file=${tmpdir}/SPECS/${name}.spec | 39 | tmp_spec_file="${tmpdir}/SPECS/${name}.spec" |
40 | sed -e "s/__NAME__/${name}/g" \ | 40 | sed -e "s/__NAME__/${name}/g" \ |
41 | -e "s/__VERSION__/${version}/g" \ | 41 | -e "s/__VERSION__/${version}/g" \ |
42 | -e "s/__CONFIG_OPT__/${config_opt}/g" \ | 42 | -e "s/__CONFIG_OPT__/${config_opt}/g" \ |
43 | platform/rpm/${name}.spec >${tmp_spec_file} | 43 | "platform/rpm/${name}.spec" >"${tmp_spec_file}" |
44 | # FIXME: We could parse RELNOTES and create a %changelog section here | 44 | # FIXME: We could parse RELNOTES and create a %changelog section here |
45 | 45 | ||
46 | # Copy the source to build into a tarball | 46 | # Copy the source to build into a tarball |
47 | tar --exclude='./.git*' --transform "s/^./${name}-${version}/" -czf ${tmpdir}/SOURCES/${name}-${version}.tar.gz . | 47 | tar --exclude='./.git*' --transform "s/^./${name}-${version}/" \ |
48 | -czf "${tmpdir}/SOURCES/${name}-${version}.tar.gz" . | ||
48 | 49 | ||
49 | # Build the files (rpm, debug rpm and source rpm) | 50 | # Build the files (rpm, debug rpm and source rpm) |
50 | rpmbuild --quiet --define "_topdir ${tmpdir}" -ba ${tmp_spec_file} | 51 | rpmbuild --quiet --define "_topdir ${tmpdir}" -ba "${tmp_spec_file}" |
51 | 52 | ||
52 | # Copy the results to cwd | 53 | # Copy the results to cwd |
53 | mv ${tmpdir}/SRPMS/*.rpm ${tmpdir}/RPMS/*/*rpm . | 54 | mv "${tmpdir}/SRPMS"/*.rpm "${tmpdir}/RPMS"/*/*rpm . |
diff --git a/test/compile/compile.sh b/test/compile/compile.sh index da6e43a5a..06b4646a8 100755 --- a/test/compile/compile.sh +++ b/test/compile/compile.sh | |||
@@ -79,7 +79,7 @@ echo "$DIST" | |||
79 | tar -xJvf ../../"$DIST.tar.xz" | 79 | tar -xJvf ../../"$DIST.tar.xz" |
80 | mv "$DIST" firejail | 80 | mv "$DIST" firejail |
81 | 81 | ||
82 | cd firejail | 82 | cd firejail || exit 1 |
83 | ./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure | 83 | ./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure |
84 | make -j4 2>&1 | tee ../output-make | 84 | make -j4 2>&1 | tee ../output-make |
85 | cd .. | 85 | cd .. |
@@ -95,7 +95,7 @@ rm output-configure output-make | |||
95 | # - disable dbus proxy configuration | 95 | # - disable dbus proxy configuration |
96 | #***************************************************************** | 96 | #***************************************************************** |
97 | print_title "${arr[2]}" | 97 | print_title "${arr[2]}" |
98 | cd firejail | 98 | cd firejail || exit 1 |
99 | make distclean | 99 | make distclean |
100 | ./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure | 100 | ./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure |
101 | make -j4 2>&1 | tee ../output-make | 101 | make -j4 2>&1 | tee ../output-make |
@@ -112,7 +112,7 @@ rm output-configure output-make | |||
112 | # - disable chroot configuration | 112 | # - disable chroot configuration |
113 | #***************************************************************** | 113 | #***************************************************************** |
114 | print_title "${arr[3]}" | 114 | print_title "${arr[3]}" |
115 | cd firejail | 115 | cd firejail || exit 1 |
116 | make distclean | 116 | make distclean |
117 | ./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure | 117 | ./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure |
118 | make -j4 2>&1 | tee ../output-make | 118 | make -j4 2>&1 | tee ../output-make |
@@ -129,7 +129,7 @@ rm output-configure output-make | |||
129 | # - disable firetunnel configuration | 129 | # - disable firetunnel configuration |
130 | #***************************************************************** | 130 | #***************************************************************** |
131 | print_title "${arr[4]}" | 131 | print_title "${arr[4]}" |
132 | cd firejail | 132 | cd firejail || exit 1 |
133 | make distclean | 133 | make distclean |
134 | ./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure | 134 | ./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure |
135 | make -j4 2>&1 | tee ../output-make | 135 | make -j4 2>&1 | tee ../output-make |
@@ -146,7 +146,7 @@ rm output-configure output-make | |||
146 | # - disable user namespace configuration | 146 | # - disable user namespace configuration |
147 | #***************************************************************** | 147 | #***************************************************************** |
148 | print_title "${arr[5]}" | 148 | print_title "${arr[5]}" |
149 | cd firejail | 149 | cd firejail || exit 1 |
150 | make distclean | 150 | make distclean |
151 | ./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure | 151 | ./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure |
152 | make -j4 2>&1 | tee ../output-make | 152 | make -j4 2>&1 | tee ../output-make |
@@ -164,7 +164,7 @@ rm output-configure output-make | |||
164 | # - check compilation | 164 | # - check compilation |
165 | #***************************************************************** | 165 | #***************************************************************** |
166 | print_title "${arr[6]}" | 166 | print_title "${arr[6]}" |
167 | cd firejail | 167 | cd firejail || exit 1 |
168 | make distclean | 168 | make distclean |
169 | ./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure | 169 | ./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure |
170 | make -j4 2>&1 | tee ../output-make | 170 | make -j4 2>&1 | tee ../output-make |
@@ -181,7 +181,7 @@ rm output-configure output-make | |||
181 | # - disable X11 support | 181 | # - disable X11 support |
182 | #***************************************************************** | 182 | #***************************************************************** |
183 | print_title "${arr[7]}" | 183 | print_title "${arr[7]}" |
184 | cd firejail | 184 | cd firejail || exit 1 |
185 | make distclean | 185 | make distclean |
186 | ./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure | 186 | ./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure |
187 | make -j4 2>&1 | tee ../output-make | 187 | make -j4 2>&1 | tee ../output-make |
@@ -198,7 +198,7 @@ rm output-configure output-make | |||
198 | # - enable selinux | 198 | # - enable selinux |
199 | #***************************************************************** | 199 | #***************************************************************** |
200 | print_title "${arr[8]}" | 200 | print_title "${arr[8]}" |
201 | cd firejail | 201 | cd firejail || exit 1 |
202 | make distclean | 202 | make distclean |
203 | ./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure | 203 | ./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure |
204 | make -j4 2>&1 | tee ../output-make | 204 | make -j4 2>&1 | tee ../output-make |
@@ -215,7 +215,7 @@ rm output-configure output-make | |||
215 | # - disable file transfer | 215 | # - disable file transfer |
216 | #***************************************************************** | 216 | #***************************************************************** |
217 | print_title "${arr[9]}" | 217 | print_title "${arr[9]}" |
218 | cd firejail | 218 | cd firejail || exit 1 |
219 | make distclean | 219 | make distclean |
220 | ./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure | 220 | ./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure |
221 | make -j4 2>&1 | tee ../output-make | 221 | make -j4 2>&1 | tee ../output-make |
@@ -232,7 +232,7 @@ rm output-configure output-make | |||
232 | # - disable whitelist | 232 | # - disable whitelist |
233 | #***************************************************************** | 233 | #***************************************************************** |
234 | print_title "${arr[10]}" | 234 | print_title "${arr[10]}" |
235 | cd firejail | 235 | cd firejail || exit 1 |
236 | make distclean | 236 | make distclean |
237 | ./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure | 237 | ./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure |
238 | make -j4 2>&1 | tee ../output-make | 238 | make -j4 2>&1 | tee ../output-make |
@@ -249,7 +249,7 @@ rm output-configure output-make | |||
249 | # - disable global config | 249 | # - disable global config |
250 | #***************************************************************** | 250 | #***************************************************************** |
251 | print_title "${arr[11]}" | 251 | print_title "${arr[11]}" |
252 | cd firejail | 252 | cd firejail || exit 1 |
253 | make distclean | 253 | make distclean |
254 | ./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure | 254 | ./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure |
255 | make -j4 2>&1 | tee ../output-make | 255 | make -j4 2>&1 | tee ../output-make |
@@ -266,7 +266,7 @@ rm output-configure output-make | |||
266 | # - enable apparmor | 266 | # - enable apparmor |
267 | #***************************************************************** | 267 | #***************************************************************** |
268 | print_title "${arr[12]}" | 268 | print_title "${arr[12]}" |
269 | cd firejail | 269 | cd firejail || exit 1 |
270 | make distclean | 270 | make distclean |
271 | ./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure | 271 | ./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure |
272 | make -j4 2>&1 | tee ../output-make | 272 | make -j4 2>&1 | tee ../output-make |
@@ -283,7 +283,7 @@ rm output-configure output-make | |||
283 | # - enable busybox workaround | 283 | # - enable busybox workaround |
284 | #***************************************************************** | 284 | #***************************************************************** |
285 | print_title "${arr[13]}" | 285 | print_title "${arr[13]}" |
286 | cd firejail | 286 | cd firejail || exit 1 |
287 | make distclean | 287 | make distclean |
288 | ./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure | 288 | ./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure |
289 | make -j4 2>&1 | tee ../output-make | 289 | make -j4 2>&1 | tee ../output-make |
@@ -300,7 +300,7 @@ rm output-configure output-make | |||
300 | # - disable overlayfs | 300 | # - disable overlayfs |
301 | #***************************************************************** | 301 | #***************************************************************** |
302 | print_title "${arr[14]}" | 302 | print_title "${arr[14]}" |
303 | cd firejail | 303 | cd firejail || exit 1 |
304 | make distclean | 304 | make distclean |
305 | ./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure | 305 | ./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure |
306 | make -j4 2>&1 | tee ../output-make | 306 | make -j4 2>&1 | tee ../output-make |
@@ -317,7 +317,7 @@ rm output-configure output-make | |||
317 | # - disable private home | 317 | # - disable private home |
318 | #***************************************************************** | 318 | #***************************************************************** |
319 | print_title "${arr[15]}" | 319 | print_title "${arr[15]}" |
320 | cd firejail | 320 | cd firejail || exit 1 |
321 | make distclean | 321 | make distclean |
322 | ./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure | 322 | ./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure |
323 | make -j4 2>&1 | tee ../output-make | 323 | make -j4 2>&1 | tee ../output-make |
@@ -334,7 +334,7 @@ rm output-configure output-make | |||
334 | # - disable manpages | 334 | # - disable manpages |
335 | #***************************************************************** | 335 | #***************************************************************** |
336 | print_title "${arr[16]}" | 336 | print_title "${arr[16]}" |
337 | cd firejail | 337 | cd firejail || exit 1 |
338 | make distclean | 338 | make distclean |
339 | ./configure --prefix=/usr --disable-man --enable-fatal-warnings 2>&1 | tee ../output-configure | 339 | ./configure --prefix=/usr --disable-man --enable-fatal-warnings 2>&1 | tee ../output-configure |
340 | make -j4 2>&1 | tee ../output-make | 340 | make -j4 2>&1 | tee ../output-make |
@@ -351,7 +351,7 @@ rm output-configure output-make | |||
351 | # - disable tmpfs as regular user" | 351 | # - disable tmpfs as regular user" |
352 | #***************************************************************** | 352 | #***************************************************************** |
353 | print_title "${arr[17]}" | 353 | print_title "${arr[17]}" |
354 | cd firejail | 354 | cd firejail || exit 1 |
355 | make distclean | 355 | make distclean |
356 | ./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure | 356 | ./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure |
357 | make -j4 2>&1 | tee ../output-make | 357 | make -j4 2>&1 | tee ../output-make |
@@ -368,7 +368,7 @@ rm output-configure output-make | |||
368 | # - disable private home feature | 368 | # - disable private home feature |
369 | #***************************************************************** | 369 | #***************************************************************** |
370 | print_title "${arr[18]}" | 370 | print_title "${arr[18]}" |
371 | cd firejail | 371 | cd firejail || exit 1 |
372 | make distclean | 372 | make distclean |
373 | ./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure | 373 | ./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure |
374 | make -j4 2>&1 | tee ../output-make | 374 | make -j4 2>&1 | tee ../output-make |
@@ -385,7 +385,7 @@ rm output-configure output-make | |||
385 | # - enable ids | 385 | # - enable ids |
386 | #***************************************************************** | 386 | #***************************************************************** |
387 | print_title "${arr[19]}" | 387 | print_title "${arr[19]}" |
388 | cd firejail | 388 | cd firejail || exit 1 |
389 | make distclean | 389 | make distclean |
390 | ./configure --prefix=/usr --enable-ids --enable-fatal-warnings 2>&1 | tee ../output-configure | 390 | ./configure --prefix=/usr --enable-ids --enable-fatal-warnings 2>&1 | tee ../output-configure |
391 | make -j4 2>&1 | tee ../output-make | 391 | make -j4 2>&1 | tee ../output-make |