From 3d97332fd2a0f37519ef52753a33aa0b20dab9e3 Mon Sep 17 00:00:00 2001 From: Haowei Yu Date: Tue, 19 May 2020 10:04:09 -0700 Subject: Add configure options when building rpm (#3422) --- platform/rpm/firejail.spec | 2 +- platform/rpm/mkrpm.sh | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'platform') 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. %setup -q %build -%configure --disable-userns --disable-contrib-install +%configure __CONFIG_OPT__ make %{?_smp_mflags} %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 @@ # Copyright (C) 2014-2020 Firejail Authors # License GPL v2 # -# Usage: ./platform/rpm/mkrpm.sh firejail +# Usage: ./platform/rpm/mkrpm.sh firejail "" # # Builds rpms in a temporary directory then places the result in the # current working directory. @@ -11,6 +11,7 @@ name=$1 # Strip any trailing prefix from the version like -rc1 etc version=$(echo "$2" | sed 's/\-.*//g') +config_opt=$3 if [[ ! -f platform/rpm/${name}.spec ]]; then echo error: spec file not found for name \"${name}\" @@ -22,6 +23,10 @@ if [[ -z "${version}" ]]; then exit 1 fi +if [[ -z "${config_opt}" ]]; then + config_opt="--disable-userns --disable-contrib-install" +fi + # Make a temporary directory and arrange to clean up on exit tmpdir=$(mktemp -d) mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} @@ -32,7 +37,10 @@ trap cleanup EXIT # Create the spec file tmp_spec_file=${tmpdir}/SPECS/${name}.spec -sed -e "s/__NAME__/${name}/g" -e "s/__VERSION__/${version}/g" platform/rpm/${name}.spec >${tmp_spec_file} +sed -e "s/__NAME__/${name}/g" \ + -e "s/__VERSION__/${version}/g" \ + -e "s/__CONFIG_OPT__/${config_opt}/g" \ + platform/rpm/${name}.spec >${tmp_spec_file} # FIXME: We could parse RELNOTES and create a %changelog section here # Copy the source to build into a tarball -- cgit v1.2.3-54-g00ecf