Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configure options when building rpm #3422

Merged
merged 1 commit into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/rpm/firejail.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions platform/rpm/mkrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# Copyright (C) 2014-2020 Firejail Authors
# License GPL v2
#
# Usage: ./platform/rpm/mkrpm.sh firejail <version>
# Usage: ./platform/rpm/mkrpm.sh firejail <version> "<config options>"
#
# Builds rpms in a temporary directory then places the result in the
# current working directory.

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}\"
Expand All @@ -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}
Expand All @@ -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
Expand Down