Skip to content

Commit 3d97332

Browse files
authored
Add configure options when building rpm (netblue30#3422)
1 parent 7612739 commit 3d97332

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

platform/rpm/firejail.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using Linux namespaces. It includes a sandbox profile for Mozilla Firefox.
1919
%setup -q
2020

2121
%build
22-
%configure --disable-userns --disable-contrib-install
22+
%configure __CONFIG_OPT__
2323
make %{?_smp_mflags}
2424

2525
%install

platform/rpm/mkrpm.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
# Copyright (C) 2014-2020 Firejail Authors
44
# License GPL v2
55
#
6-
# Usage: ./platform/rpm/mkrpm.sh firejail <version>
6+
# Usage: ./platform/rpm/mkrpm.sh firejail <version> "<config options>"
77
#
88
# Builds rpms in a temporary directory then places the result in the
99
# current working directory.
1010

1111
name=$1
1212
# Strip any trailing prefix from the version like -rc1 etc
1313
version=$(echo "$2" | sed 's/\-.*//g')
14+
config_opt=$3
1415

1516
if [[ ! -f platform/rpm/${name}.spec ]]; then
1617
echo error: spec file not found for name \"${name}\"
@@ -22,6 +23,10 @@ if [[ -z "${version}" ]]; then
2223
exit 1
2324
fi
2425

26+
if [[ -z "${config_opt}" ]]; then
27+
config_opt="--disable-userns --disable-contrib-install"
28+
fi
29+
2530
# Make a temporary directory and arrange to clean up on exit
2631
tmpdir=$(mktemp -d)
2732
mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
@@ -32,7 +37,10 @@ trap cleanup EXIT
3237

3338
# Create the spec file
3439
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}
3644
# FIXME: We could parse RELNOTES and create a %changelog section here
3745

3846
# Copy the source to build into a tarball

0 commit comments

Comments
 (0)