3
3
# Copyright (C) 2014-2020 Firejail Authors
4
4
# License GPL v2
5
5
#
6
- # Usage: ./platform/rpm/mkrpm.sh firejail <version>
6
+ # Usage: ./platform/rpm/mkrpm.sh firejail <version> "<config options>"
7
7
#
8
8
# Builds rpms in a temporary directory then places the result in the
9
9
# current working directory.
10
10
11
11
name=$1
12
12
# Strip any trailing prefix from the version like -rc1 etc
13
13
version=$( echo " $2 " | sed ' s/\-.*//g' )
14
+ config_opt=$3
14
15
15
16
if [[ ! -f platform/rpm/${name} .spec ]]; then
16
17
echo error: spec file not found for name \" ${name} \"
@@ -22,6 +23,10 @@ if [[ -z "${version}" ]]; then
22
23
exit 1
23
24
fi
24
25
26
+ if [[ -z " ${config_opt} " ]]; then
27
+ config_opt=" --disable-userns --disable-contrib-install"
28
+ fi
29
+
25
30
# Make a temporary directory and arrange to clean up on exit
26
31
tmpdir=$( mktemp -d)
27
32
mkdir -p ${tmpdir} /{BUILD,RPMS,SOURCES,SPECS,SRPMS}
@@ -32,7 +37,10 @@ trap cleanup EXIT
32
37
33
38
# Create the spec file
34
39
tmp_spec_file=${tmpdir} /SPECS/${name} .spec
35
- sed -e " s/__NAME__/${name} /g" -e " s/__VERSION__/${version} /g" platform/rpm/${name} .spec > ${tmp_spec_file}
40
+ sed -e " s/__NAME__/${name} /g" \
41
+ -e " s/__VERSION__/${version} /g" \
42
+ -e " s/__CONFIG_OPT__/${config_opt} /g" \
43
+ platform/rpm/${name} .spec > ${tmp_spec_file}
36
44
# FIXME: We could parse RELNOTES and create a %changelog section here
37
45
38
46
# Copy the source to build into a tarball
0 commit comments