patch packpack to support custom environment vars

This commit is contained in:
Andrew Bauer 2018-02-21 12:15:10 -06:00
parent 4832de9217
commit b6ad2b6ad7
3 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,3 @@
DEB_BUILD_OPTIONS="parallel=4"
DEBUILD_LINTIAN="no"

View File

@ -0,0 +1,25 @@
From 871835ecc4ee380fe42d1ef2a58dca9dc4e9af5f Mon Sep 17 00:00:00 2001
From: Andrew Bauer <zonexpertconsulting@outlook.com>
Date: Wed, 21 Feb 2018 12:07:12 -0600
Subject: [PATCH] allow one to load custom environment variables
---
packpack | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/packpack b/packpack
index 6f4c80f..abab604 100755
--- a/packpack
+++ b/packpack
@@ -128,6 +128,11 @@ chmod a+x ${BUILDDIR}/userwrapper.sh
env | grep -E "^PRODUCT=|^VERSION=|^RELEASE=|^ABBREV=|^TARBALL_|^CHANGELOG_|^CCACHE_|^PACKAGECLOUD_|^SMPFLAGS=|^OS=|^DIST=" \
> ${BUILDDIR}/env
+# Load user environment variables
+if [ -f "${USER_ENV_FILE}" ]; then
+ cat ${USER_ENV_FILE} >> ${BUILDDIR}/env
+fi
+
#
# Setup cache directory
#

View File

@ -108,6 +108,12 @@ commonprep () {
patch -p1 < utils/packpack/packpack-rpm.patch
fi
# Patch packpack
patch --dry-run --silent -f -p1 < utils/packpack/envvars.patch
if [ $? -eq 0 ]; then
patch -p1 < utils/packpack/envvars.patch
fi
# The rpm specfile requires we download the tarball and manually move it into place
# Might as well do this for Debian as well, rather than git submodule init
CRUDVER="3.0.10"
@ -231,7 +237,8 @@ execpackpack () {
parms="-f utils/packpack/redhat_package.mk redhat_package"
else
parms=""
export SMPFLAGS="-j4 --lintian-opts --no-lintian"
export SMPFLAGS="-j4"
export USER_ENV_FILE="utils/packpack/environment"
fi
if [ "${TRAVIS}" == "true" ]; then