aboutsummaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorLibravatar Haowei Yu <haowei.yu@snowflake.com>2020-05-19 10:04:09 -0700
committerLibravatar GitHub <noreply@github.com>2020-05-19 17:04:09 +0000
commit3d97332fd2a0f37519ef52753a33aa0b20dab9e3 (patch)
treed4f6db963ee44e283ab719f40f13a7cf81d216ac /platform
parentfix seccomp in wire-desktop.profile (diff)
downloadfirejail-3d97332fd2a0f37519ef52753a33aa0b20dab9e3.tar.gz
firejail-3d97332fd2a0f37519ef52753a33aa0b20dab9e3.tar.zst
firejail-3d97332fd2a0f37519ef52753a33aa0b20dab9e3.zip
Add configure options when building rpm (#3422)
Diffstat (limited to 'platform')
-rw-r--r--platform/rpm/firejail.spec2
-rwxr-xr-xplatform/rpm/mkrpm.sh12
2 files changed, 11 insertions, 3 deletions
diff --git a/platform/rpm/firejail.spec b/platform/rpm/firejail.spec
index b32407c7d..bce160f04 100644
--- a/platform/rpm/firejail.spec
+++ b/platform/rpm/firejail.spec
@@ -19,7 +19,7 @@ using Linux namespaces. It includes a sandbox profile for Mozilla Firefox.
19%setup -q 19%setup -q
20 20
21%build 21%build
22%configure --disable-userns --disable-contrib-install 22%configure __CONFIG_OPT__
23make %{?_smp_mflags} 23make %{?_smp_mflags}
24 24
25%install 25%install
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 @@
11name=$1 11name=$1
12# Strip any trailing prefix from the version like -rc1 etc 12# Strip any trailing prefix from the version like -rc1 etc
13version=$(echo "$2" | sed 's/\-.*//g') 13version=$(echo "$2" | sed 's/\-.*//g')
14config_opt=$3
14 15
15if [[ ! -f platform/rpm/${name}.spec ]]; then 16if [[ ! -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
23fi 24fi
24 25
26if [[ -z "${config_opt}" ]]; then
27 config_opt="--disable-userns --disable-contrib-install"
28fi
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
26tmpdir=$(mktemp -d) 31tmpdir=$(mktemp -d)
27mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} 32mkdir -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
34tmp_spec_file=${tmpdir}/SPECS/${name}.spec 39tmp_spec_file=${tmpdir}/SPECS/${name}.spec
35sed -e "s/__NAME__/${name}/g" -e "s/__VERSION__/${version}/g" platform/rpm/${name}.spec >${tmp_spec_file} 40sed -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