Source: zoo
Version: 2.10-28
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

zoo fails to cross build from source, because it uses the build
architecture compiler. debian/rules fails to pass cross compilers to
make and the linux and linux64 targets fail to forward cross compilers.
debian/rules also fails to select the correct target. After fixing all
of the above, zoo cross builds successfully. Please consider applying
the attached patch.

Helmut
diff --minimal -Nru zoo-2.10/debian/changelog zoo-2.10/debian/changelog
--- zoo-2.10/debian/changelog   2015-12-16 16:31:10.000000000 +0100
+++ zoo-2.10/debian/changelog   2017-09-13 21:28:51.000000000 +0200
@@ -1,3 +1,13 @@
+zoo (2.10-28.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross compilers to make.
+    + Fix build/host confusion.
+    + Fix forwarding of CC.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Wed, 13 Sep 2017 21:28:51 +0200
+
 zoo (2.10-28) unstable; urgency=low
 
   * QA upload.
diff --minimal -Nru zoo-2.10/debian/patches/20-makefile.patch 
zoo-2.10/debian/patches/20-makefile.patch
--- zoo-2.10/debian/patches/20-makefile.patch   2012-06-13 09:16:15.000000000 
+0200
+++ zoo-2.10/debian/patches/20-makefile.patch   2017-09-13 21:28:51.000000000 
+0200
@@ -1,6 +1,8 @@
 From: Jari Aalto <jari.aa...@cante.net>
 Subject: Enabled hardened build flags through dpkg-buildflags
 
+Also enable forwarding CC for cross compilation.
+
 --- a/makefile
 +++ b/makefile
 @@ -23,7 +23,11 @@
@@ -21,12 +23,12 @@
  # Linux
  linux:
 -      $(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DANSI_HDRS" 
$(TARGETS)
-+      $(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DANSI_HDRS" 
LDFLAGS="$(LDFLAGS)" $(TARGETS)
++      $(MAKE) CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DANSI_HDRS" 
LDFLAGS="$(LDFLAGS)" $(TARGETS)
  
  # Linux64
  linux64:
 -      $(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DLONG64 
-DANSI_HDRS" $(TARGETS)
-+      $(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DLONG64 
-DANSI_HDRS" LDFLAGS="$(LDFLAGS)" $(TARGETS)
++      $(MAKE) CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DLONG64 -DANSI_HDRS" 
LDFLAGS="$(LDFLAGS)" $(TARGETS)
  
  # ULTRIX 4.1
  ultrix:
diff --minimal -Nru zoo-2.10/debian/rules zoo-2.10/debian/rules
--- zoo-2.10/debian/rules       2012-06-12 08:57:21.000000000 +0200
+++ zoo-2.10/debian/rules       2017-09-13 21:28:48.000000000 +0200
@@ -1,20 +1,21 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
+
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
 TARGET = linux
-BITS   = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
 
-ifeq ($(BITS),64)
+ifeq ($(DEB_HOST_ARCH_BITS),64)
     TARGET = linux64
 endif
 
 override_dh_auto_build:
        cp --archive makefile makefile.orig
        makedepend
-       $(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(TARGET)
+       dh_auto_build -- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" 
$(TARGET)
        # Restore original; changed by makedepend
        mv makefile.orig makefile
 

Reply via email to