From ddf1e900640f18eb11b71e6db7b8b0d34a923f04 Mon Sep 17 00:00:00 2001 From: Asbjoern Sloth Toennesen Date: Fri, 5 Nov 2010 13:30:08 +0000 Subject: [PATCH] --- yaml --- r: 227671 b: refs/heads/master c: 10f26fa64200095af0e5d80a980e47877865e4b7 h: refs/heads/master i: 227669: a84853f895a939970ac6131997363ccab50002dc 227667: c8e220930f334ceeace23b3d9d474fdf492fb856 227663: 9d8d8bdda5ed3d0892ac5c463949108ae85af7a1 v: v3 --- [refs] | 2 +- trunk/scripts/package/builddeb | 35 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index c6b0dc9e067b..91bc240b57fe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e86c2412c88fbe4676920c40348d3c547c9edb0d +refs/heads/master: 10f26fa64200095af0e5d80a980e47877865e4b7 diff --git a/trunk/scripts/package/builddeb b/trunk/scripts/package/builddeb index 4dfec9aaaace..5d6be3f5e7f7 100644 --- a/trunk/scripts/package/builddeb +++ b/trunk/scripts/package/builddeb @@ -25,8 +25,41 @@ create_package() { chown -R root:root "$pdir" chmod -R go-w "$pdir" + # Attempt to find the correct Debian architecture + local forcearch="" debarch="" + case "$UTS_MACHINE" in + i386|ia64|alpha) + debarch="$UTS_MACHINE" ;; + x86_64) + debarch=amd64 ;; + sparc*) + debarch=sparc ;; + s390*) + debarch=s390 ;; + ppc*) + debarch=powerpc ;; + parisc*) + debarch=hppa ;; + mips*) + debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;; + arm*) + debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;; + *) + echo "" >&2 + echo "** ** ** WARNING ** ** **" >&2 + echo "" >&2 + echo "Your architecture doesn't have it's equivalent" >&2 + echo "Debian userspace architecture defined!" >&2 + echo "Falling back to using your current userspace instead!" >&2 + echo "Please add support for $UTS_MACHINE to ${0} ..." >&2 + echo "" >&2 + esac + if [ -n "$debarch" ] ; then + forcearch="-DArchitecture=$debarch" + fi + # Create the package - dpkg-gencontrol -isp -p$pname -P"$pdir" + dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" dpkg --build "$pdir" .. }