Bug#250225: grub patch

Andreas Jochens Andreas Jochens <aj@andaco.de>, 250225@bugs.debian.org
Wed, 6 Oct 2004 23:44:24 +0200


Hi Frederik,

thanks for bringing the grub patch back to my attention.
I finally tried to modify the patch according to Robert's wishes.

The amended patch seems to work for the amd64/gcc-3.4 archive.

Could you please test the attached patch with the pure64 archive
and give your OK or tell me if you have problems?

Regards
Andreas Jochens

diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/control.in ./debian/control.in
--- ../tmp-orig/grub-0.95+cvs20040624/debian/control.in	2004-10-06 23:33:46.857081128 +0200
+++ ./debian/control.in	2004-10-06 23:29:21.081485160 +0200
@@ -3,12 +3,12 @@
 Priority: optional
 Maintainer: Grub Maintainers <pkg-grub-devel@lists.alioth.debian.org>
 Uploaders: Jason Thomas <jason@debian.org>, Robert Millan <rmh@debian.org>
-Build-Depends: debhelper (>= 4.0.0), automake1.8, autoconf, texinfo, libncurses5-dev | libncurses-dev, type-handling (>= 0.2.0)
+Build-Depends: debhelper (>= 4.0.0), automake1.8, autoconf, texinfo, libncurses5-dev | libncurses-dev, type-handling (>= 0.2.0), ia32-libs-dev [@amd64@], gcc-3.4[@amd64@]
 Build-Depends-Indep: texi2html, e2tools, e2fsprogs, mkisofs
 Standards-Version: 3.6.1.0
 
 Package: grub
-Architecture: @i386@
+Architecture: @arches@
 Depends: ${shlibs:Depends}
 Suggests: grub-doc, grubconf
 Description: GRand Unified Bootloader
diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/grub-floppy ./debian/grub-floppy
--- ../tmp-orig/grub-0.95+cvs20040624/debian/grub-floppy	2004-10-06 23:33:46.854081584 +0200
+++ ./debian/grub-floppy	2004-10-06 23:24:59.102312048 +0200
@@ -19,7 +19,7 @@
 
 # Initialize some variables.
 dd=`which dd`
-pkglibdir=/lib/grub/i386-pc
+pkglibdir=/lib/grub/*-*
 stage1=$pkglibdir/stage1
 stage2=$pkglibdir/stage2
 
diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/rules ./debian/rules
--- ../tmp-orig/grub-0.95+cvs20040624/debian/rules	2004-10-06 23:33:46.726101040 +0200
+++ ./debian/rules	2004-10-06 23:30:26.501539800 +0200
@@ -48,6 +48,13 @@
 filesystems=e2fs ffs ufs2
 endif
 
+ifeq ($(DEB_BUILD_GNU_CPU),x86_64)
+  LDFLAGS=-static
+  CC=gcc-3.4
+else
+  CC=gcc
+endif
+
 patch: patch-stamp
 patch-stamp:
 	dh_testdir
@@ -81,7 +88,7 @@
 
 	# Add here commands to configure the package.
 	aclocal-1.8 && automake-1.8 && autoconf
-	./configure \
+	CC=$(CC) LDFLAGS=$(LDFLAGS) ./configure \
 		--host=$(DEB_HOST_GNU_TYPE) \
 		--build=$(DEB_BUILD_GNU_TYPE) \
 		--prefix=/ \
@@ -161,6 +168,8 @@
 
 	cat debian/control.in \
 	| sed "s/@i386@/`type-handling i386 any`/g" \
+	| sed "s/@amd64@/`type-handling x86_64 any`/g" \
+	| sed "s/@arches@/`type-handling x86_64,i386 any`/g" \
 	> debian/control
 
 	dh_clean
@@ -178,7 +187,7 @@
 
 	# grub-disk
 	mkdir -p $(CURDIR)/debian/tmp/root/boot/grub
-	cp $(CURDIR)/debian/grub/lib/grub/i386-*/{stage1,e2fs_stage1_5,stage2} \
+	cp $(CURDIR)/debian/grub/lib/grub/*-*/{stage1,e2fs_stage1_5,stage2} \
 		$(CURDIR)/docs/menu.lst \
 		$(CURDIR)/debian/tmp/root/boot/grub
 	tar -C $(CURDIR)/debian/tmp/root \
@@ -189,9 +198,8 @@
 		-f $(CURDIR)/debian/tmp/grub.tar.gz
 
 	rm -f $(CURDIR)/debian/tmp/root/boot/grub/*stage*
-	cp $(CURDIR)/debian/grub/lib/grub/i386-*/stage2_eltorito \
+	cp $(CURDIR)/debian/grub/lib/grub/*-*/stage2_eltorito \
 		$(CURDIR)/debian/tmp/root/boot/grub
-
 	mkisofs \
 		-b boot/grub/stage2_eltorito \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
@@ -222,11 +230,11 @@
 	# Cleanup filesystems not used natively in Debian.
 	# (non-native filesystems are supported via stage2)
 	mkdir debian/grub/lib/grub/tmp/
-	mv debian/grub/lib/grub/i386-*/*_stage1_5 \
+	mv debian/grub/lib/grub/*-*/*_stage1_5 \
 		debian/grub/lib/grub/tmp/
 	for i in $(filesystems) ; do \
 		mv debian/grub/lib/grub/tmp/$${i}_stage1_5 \
-		debian/grub/lib/grub/i386-*/ ; \
+		debian/grub/lib/grub/*-*/ ; \
 	done
 	rm -rf debian/grub/lib/grub/tmp/