buildsystem - fix 32bit rpm builds

This commit is contained in:
Andrew Bauer 2018-02-26 10:41:29 -06:00
parent ab11e9ec38
commit 79037f56c1
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,57 @@
From 62a98b36fd62d328956503bc9427ae128bb811af Mon Sep 17 00:00:00 2001
From: Andrew Bauer <zonexpertconsulting@outlook.com>
Date: Mon, 26 Feb 2018 10:05:02 -0600
Subject: [PATCH] fix 32bit rpm builds
---
pack/rpm.mk | 2 +-
packpack | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packpack/pack/rpm.mk b/packpack/pack/rpm.mk
index c74e942..9a6b016 100644
--- a/packpack/pack/rpm.mk
+++ b/packpack/pack/rpm.mk
@@ -124,7 +124,7 @@ package: $(BUILDDIR)/$(RPMSRC)
@echo "-------------------------------------------------------------------"
@echo "Building RPM packages"
@echo "-------------------------------------------------------------------"
- rpmbuild \
+ setarch $(ARCH) rpmbuild \
--define '_topdir $(BUILDDIR)' \
--define '_sourcedir $(BUILDDIR)' \
--define '_specdir $(BUILDDIR)' \
diff --git a/packpack/packpack b/packpack/packpack
index 6f4c80f..c329399 100755
--- a/packpack/packpack
+++ b/packpack/packpack
@@ -125,7 +125,7 @@ chmod a+x ${BUILDDIR}/userwrapper.sh
#
# Save defined configuration variables to ./env file
#
-env | grep -E "^PRODUCT=|^VERSION=|^RELEASE=|^ABBREV=|^TARBALL_|^CHANGELOG_|^CCACHE_|^PACKAGECLOUD_|^SMPFLAGS=|^OS=|^DIST=" \
+env | grep -E "^PRODUCT=|^VERSION=|^RELEASE=|^ABBREV=|^TARBALL_|^CHANGELOG_|^CCACHE_|^PACKAGECLOUD_|^SMPFLAGS=|^OS=|^DIST=|^ARCH=" \
> ${BUILDDIR}/env
#
diff --git a/packpack/packpack b/packpack/packpack
index c329399..6ffaa9c 100755
--- a/packpack/packpack
+++ b/packpack/packpack
@@ -19,11 +19,11 @@ DOCKER_REPO=${DOCKER_REPO:-packpack/packpack}
if [ -z "${ARCH}" ]; then
# Use uname -m instead of HOSTTYPE
case "$(uname -m)" in
- i*86) ARCH="i386" ;;
- arm*) ARCH="armhf" ;;
- x86_64) ARCH="x86_64"; ;;
- aarch64) ARCH="aarch64" ;;
- *) ARCH="${HOSTTYPE}" ;;
+ i*86) export ARCH="i386" ;;
+ arm*) export ARCH="armhf" ;;
+ x86_64) export ARCH="x86_64"; ;;
+ aarch64) export ARCH="aarch64" ;;
+ *) export ARCH="${HOSTTYPE}" ;;
esac
fi

View File

@ -114,6 +114,12 @@ commonprep () {
patch -p1 < utils/packpack/nolintian.patch patch -p1 < utils/packpack/nolintian.patch
fi fi
# fix 32bit rpm builds
patch --dry-run --silent -f -p1 < utils/packpack/setarch.patch
if [ $? -eq 0 ]; then
patch -p1 < utils/packpack/setarch.patch
fi
# The rpm specfile requires we download the tarball and manually move it into place # 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 # Might as well do this for Debian as well, rather than git submodule init
CRUDVER="3.0.10" CRUDVER="3.0.10"