Subject: Bug#3545: Problems encountered while compiling "pgp" on m68k arch

From: llucius <[email-masked]>
Date: Sat, 6 Jul 1996 20:14:24 -0500 (CDT)

Package: pgp
Version: 2.6.2i-5

The following problems were encountered while building on m68k arch:

1)  "debian.rules" did not support different architectures.
2)  "debian.rules" created improperly named .deb binaries (new standard).

(This one was a little more involved and I'm not certain if you'll like 
the changes.)

The following patches correct these problems:

--- orig/pgp-2.6.2i/debian.rules	Thu Feb 22 18:43:00 1996
+++ pgp-2.6.2i/debian.rules	Sat Jul  6 17:09:56 1996
@@ -3,6 +3,7 @@
 package=pgp
 version=2.6.2i
 debian=5
+arch=$(shell dpkg --print-architecture)
 
 # various path manglement
 ETCDIR = debian-tmp/etc
@@ -12,9 +13,19 @@
 COPYDIR = debian-tmp/usr/doc/copyright
 DOCDIR = debian-tmp/usr/doc/pgp-i
 
-GLOBALCFLAGS=	-O6 -g3 -DUNIX -DIDEA32 -DASM -DDEBIAN -DPORTABLE -DSYSV
+GLOBALCFLAGS      = -O6 -g3 -DUNIX -DIDEA32 -DDEBIAN -DPORTABLE -DSYSV
+GLOBALMAKEFLAGS   = -C src all CC=gcc LD=gcc
+
+ifeq ($(arch),i386)
+  GLOBALCFLAGS    += -DASM
+  GLOBALMAKEFLAGS += OBJS_EXT="_80386.o _zmatch.o" 
+endif
+
+ifeq ($(arch),m68k)
+  GLOBALCFLAGS    += -DHIGHFIRST
+  GLOBALMAKEFLAGS +=
+endif
 
-GLOBALMAKEFLAGS= -C src all CC=gcc LD=gcc OBJS_EXT="_80386.o _zmatch.o"
 
 build:
 	@echo 'The "build" target is not supported for this package.' >&2
@@ -62,7 +73,7 @@
 	install -m 644 readme.1st debian-tmp/usr/doc/pgp-$(UIS)/readme.1st.intl
 	install -m 644 readme.doc debian-tmp/usr/doc/pgp-$(UIS)/readme.doc.us
 	ln -s ../copyright/pgp-$(UIS) debian-tmp/usr/doc/pgp-$(UIS)/README.1st.Debian
-	sed -e '2s/=/$(version)/; 3s/=/$(debian)/' \
+	sed -e '2s/=/$(version)-$(debian)/; 3s/=/$(arch)/' \
 		debian.control-$(UIS) > debian-tmp/DEBIAN/control
 	for x in postinst prerm conffiles; do \
 		sed -e 's/@@@UIS@@@/$(UIS)/g; s/@@@PRI@@@/$(PRI)/' \
@@ -83,8 +94,7 @@
 		-print0 | xargs -0 gzip -9v
 	chmod -R go-w,u+w,a+r debian-tmp
 	chown -R root.root debian-tmp
-	dpkg --build debian-tmp
-	mv debian-tmp.deb ../$(package)-$(UIS)-$(version)-$(debian).deb
+	dpkg --build debian-tmp && dpkg-name -o -s .. debian-tmp.deb
 
 # Below here is fairly generic really