diff options
Diffstat (limited to 'platform/rpm/mkrpm.sh')
-rwxr-xr-x | platform/rpm/mkrpm.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh index 348bea7f2..2bdead7a8 100755 --- a/platform/rpm/mkrpm.sh +++ b/platform/rpm/mkrpm.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | # Copyright (C) 2014-2020 Firejail Authors | 3 | # Copyright (C) 2014-2020 Firejail Authors |
4 | # License GPL v2 | 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 | # 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. |
@@ -11,6 +11,7 @@ | |||
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=$(echo "$2" | sed 's/\-.*//g') |
14 | config_opt=$3 | ||
14 | 15 | ||
15 | if [[ ! -f platform/rpm/${name}.spec ]]; then | 16 | if [[ ! -f platform/rpm/${name}.spec ]]; then |
16 | echo error: spec file not found for name \"${name}\" | 17 | echo error: spec file not found for name \"${name}\" |
@@ -22,6 +23,10 @@ if [[ -z "${version}" ]]; then | |||
22 | exit 1 | 23 | exit 1 |
23 | fi | 24 | fi |
24 | 25 | ||
26 | if [[ -z "${config_opt}" ]]; then | ||
27 | config_opt="--disable-userns --disable-contrib-install" | ||
28 | fi | ||
29 | |||
25 | # Make a temporary directory and arrange to clean up on exit | 30 | # Make a temporary directory and arrange to clean up on exit |
26 | tmpdir=$(mktemp -d) | 31 | tmpdir=$(mktemp -d) |
27 | mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} | 32 | mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} |
@@ -32,7 +37,10 @@ trap cleanup EXIT | |||
32 | 37 | ||
33 | # Create the spec file | 38 | # Create the spec file |
34 | tmp_spec_file=${tmpdir}/SPECS/${name}.spec | 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 | # FIXME: We could parse RELNOTES and create a %changelog section here | 44 | # FIXME: We could parse RELNOTES and create a %changelog section here |
37 | 45 | ||
38 | # Copy the source to build into a tarball | 46 | # Copy the source to build into a tarball |