From 50d511ba6246c46654857b8ef64aefe76a87e455 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 26 Jul 2018 11:21:09 +0100
Subject: [PATCH] builddeb: Add automatic support for ppc64 and powerpcspe
 architectures

We currently label 64-bit big-endian kernel packages as
powerpc (32-bit), mostly because it was officially supported while
ppc64 (64-bit big-endian) was not.  Now neither is officially
supported, so label these packages as ppc64.

Debian also has a powerpcspe (32-bit with SPE) architecture.
Label packages with a suitable configuration as powerpcspe.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 scripts/package/mkdebian | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index ada3c73d1493..0891974f499b 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -35,7 +35,12 @@ set_debarch() {
 	s390*)
 		debarch=s390x ;;
 	ppc*)
-		debarch=$(if_enabled_echo CPU_LITTLE_ENDIAN ppc64el powerpc) ;;
+		if is_enabled 64BIT; then
+			debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el)
+		else
+			debarch=powerpc$(if_enabled_echo SPE spe)
+		fi
+		;;
 	parisc*)
 		debarch=hppa ;;
 	mips*)
-- 
2.30.2