This is a small fix for handling a number of FTBFS problems in scsilib.
The patch is against cdrdao 1:1.1.9-3.  It should take care of:

        249634  i386 using amd64 kernel
        250031  s390 using s390x kernel
        304194  build on ppc64
        249642  build on amd64
        326472  ditto

as well as yet to be posted FTBFS on armeb, and possible future problems
regarding kernels reporting unexpected cpu types from 'uname -m'.  (I
suspect arm on armv5 is a likely troublemaker, possibly also mips running
mips64 and powerpc running power3, power4 and ppc64.)

diff -Naur cdrdao-1.1.9/debian/rules cdrdao-1.1.9.fixed/debian/rules
--- cdrdao-1.1.9/debian/rules   2005-10-27 14:35:23.758324442 +0200
+++ cdrdao-1.1.9.fixed/debian/rules     2005-10-27 14:33:53.895349201 +0200
@@ -12,6 +12,9 @@
 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
+export DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
+export DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
+
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
   confflags += --build $(DEB_HOST_GNU_TYPE)
 else
@@ -28,6 +31,15 @@
        ln -sf /usr/share/misc/config.{sub,guess} .
        ln -sf /usr/share/misc/config.{sub,guess} paranoia/
        ln -sf /usr/share/misc/config.{sub,guess} scsilib/conf/
+       # This should handle most Debian linux-gnu archs
+       if [ "$(DEB_HOST_GNU_SYSTEM)" = "linux-gnu" ] || [ 
"$(DEB_HOST_GNU_SYSTEM)" = "linux" ]; then \
+           if [ ! -r scsilib/RULES/$(DEB_HOST_GNU_CPU)-linux-gcc.rul ]; then \
+               cp scsilib/RULES/i586-linux-gcc.rul 
scsilib/RULES/$(DEB_HOST_GNU_CPU)-linux-gcc.rul; \
+           fi; \
+           if [ ! -r scsilib/RULES/$(DEB_HOST_GNU_CPU)-linux-cc.rul ]; then \
+               cp scsilib/RULES/i586-linux-cc.rul 
scsilib/RULES/$(DEB_HOST_GNU_CPU)-linux-cc.rul; \
+           fi; \
+       fi
        CC=gcc ./configure --prefix=/usr $(confflags) \
                --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 
\
                --with-pcctsbin=/usr/bin --with-pcctsinc=/usr/include/pccts \
diff -Naur cdrdao-1.1.9/scsilib/RULES/mk-gmake.id 
cdrdao-1.1.9.fixed/scsilib/RULES/mk-gmake.id
--- cdrdao-1.1.9/scsilib/RULES/mk-gmake.id      2004-06-04 04:17:08.000000000 
+0200
+++ cdrdao-1.1.9.fixed/scsilib/RULES/mk-gmake.id        2005-10-27 
14:30:29.454805779 +0200
@@ -37,11 +37,20 @@
 
 ifndef         ARCH_DONE
 
+# On Debian systems, we have better ways to determine the correct CPU type
+# at build time
+ifndef                 DEB_HOST_GNU_CPU
 _MACHCMD=      (mach || uname -p || true)      2> /dev/null
+_KERNCMD=      (uname -m || true)              2> /dev/null
 _ARCHCMD=      (arch || /usr/ucb/arch || true) 2> /dev/null
+else
+_MACHCMD=      (echo $(DEB_HOST_GNU_CPU))
+_KERNCMD=      (echo $(DEB_HOST_GNU_CPU))
+_ARCHCMD=      (echo $(DEB_HOST_GNU_CPU))
+endif
 
 XP_ARCH:=      $(shell $(_MACHCMD) | tr '[A-Z]' '[a-z]' | tr ', /\\()"' 
',//////' | tr ',/' ',-')
-XK_ARCH:=      $(shell uname -m    | tr '[A-Z]' '[a-z]' | tr ', /\\()"' 
',//////' | tr ',/' ',-')
+XK_ARCH:=      $(shell $(_KERNCMD) | tr '[A-Z]' '[a-z]' | tr ', /\\()"' 
',//////' | tr ',/' ',-')
 XM_ARCH:=      $(shell $(_ARCHCMD) | tr '[A-Z]' '[a-z]' | tr ', /\\()"' 
',//////' | tr ',/' ',-')
 
 P_ARCH=                $(XP_ARCH)

Attachment: signature.asc
Description: Digital signature

Reply via email to