Message ID | 1288654261-8269-1-git-send-email-asbjorn@asbjorn.biz (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 49b74e1..e5b7b9b 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -25,8 +25,20 @@ create_package() { chown -R root:root "$pdir" chmod -R go-w "$pdir" + # Check for cross compilation + local forcearch="" + env | grep -q CROSS_COMPILE + if [ $? -eq 0 ] ; then + local debarch="" + case "$ARCH" in + x86_64) debarch="amd64" ;; + *) debarch="$ARCH" ;; + esac + 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" .. }