summaryrefslogtreecommitdiff
path: root/contrib/scripts/nm-copr-build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scripts/nm-copr-build.sh')
-rwxr-xr-xcontrib/scripts/nm-copr-build.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/scripts/nm-copr-build.sh b/contrib/scripts/nm-copr-build.sh
index 89269fae83..28ce4fced5 100755
--- a/contrib/scripts/nm-copr-build.sh
+++ b/contrib/scripts/nm-copr-build.sh
@@ -2,7 +2,10 @@
# environment variables:
# - GIT_REF: the ref that should be build. Can be "main" or a git sha.
-# - DEBUG: set to 1 to build "--with debug".
+# - DEBUG: set to 1 to build "--with debug". Otherwise the default is a release
+# build.
+# - LTO: set to 1/0 to build "--with/--without lto", otherwise the default depends
+# on the distribution.
# - NM_GIT_BUNDLE: set to a HTTP url where to fetch the nm-git-bundle-*.noarch.rpm
# from. Set to empty to skip it. By default, it fetches the bundle from copr.
@@ -14,6 +17,14 @@ else
DEBUG="--without debug"
fi
+if [ "$LTO" = 0 ]; then
+ LTO='--without lto'
+elif [ "$LTO" = 1 ]; then
+ LTO='--with lto'
+else
+ LTO=
+fi
+
if [[ -z "$GIT_REF" ]]; then
echo "\$GIT_REF is not set!"
exit 1
@@ -55,11 +66,12 @@ git remote remove nm-git-bundle || true
GIT_SHA="$(git show-ref --verify --hash "$GIT_REF" 2>/dev/null ||
git show-ref --verify --hash "refs/remotes/origin/$GIT_REF" 2>/dev/null ||
+ git rev-parse --verify "refs/remotes/origin/$GIT_REF" 2>/dev/null ||
git rev-parse --verify "$GIT_REF^{commit}" 2>/dev/null)"
git checkout -b tmp "$GIT_SHA"
-./contrib/fedora/rpm/build_clean.sh -g -S -w test $DEBUG -s copr
+./contrib/fedora/rpm/build_clean.sh -g -S -w test $DEBUG $LTO -s copr
popd
mv ./NetworkManager/contrib/fedora/rpm/latest/{SOURCES,SPECS}/* .