Source: mac-fdisk
Version: 0.1-18
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

mac-fdisk fails to cross build from source. It does not pass any cross
tools to make. Then debian/rules confuses build architecture and host
architecture. The attached patch uses dh_auto_build and fixes that
confusion. It makes mac-fdisk cross buildable. Please consider applying
it.

Helmut
diff -u mac-fdisk-0.1/debian/changelog mac-fdisk-0.1/debian/changelog
--- mac-fdisk-0.1/debian/changelog
+++ mac-fdisk-0.1/debian/changelog
@@ -1,3 +1,10 @@
+mac-fdisk (0.1-18.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + Fix build/host confusion in debian/rules.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 16 Jun 2018 13:29:09 +0200
+
 mac-fdisk (0.1-18) unstable; urgency=medium
 
   * New maintainer:
diff -u mac-fdisk-0.1/debian/control mac-fdisk-0.1/debian/control
--- mac-fdisk-0.1/debian/control
+++ mac-fdisk-0.1/debian/control
@@ -1,7 +1,7 @@
 Source: mac-fdisk
 Section: base
 Priority: optional
-Build-Depends: debhelper
+Build-Depends: debhelper (>= 9)
 Maintainer: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de>
 Standards-Version: 3.5.8.0
 Vcs-Git: git://github.com/glaubitz/mac-fdisk-debian.git
diff -u mac-fdisk-0.1/debian/rules mac-fdisk-0.1/debian/rules
--- mac-fdisk-0.1/debian/rules
+++ mac-fdisk-0.1/debian/rules
@@ -4,9 +4,8 @@
 
 export DH_VERBOSE=1
 
-#BUILDARCH = $(shell dpkg --print-gnu-build-architecture)
-BUILDARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
-POWERPC = $(findstring $(BUILDARCH),powerpc ppc64)
+-include /usr/share/dpkg/architecture.mk
+POWERPC = $(filter $(DEB_HOST_ARCH),powerpc ppc64)
 
 packmn  = mac-fdisk
 packmc  = mac-fdisk-cross
@@ -21,7 +20,7 @@
 docpmn  = $(tmppmn)/usr/share/doc/$(packpmn)
 docpmc  = $(tmppmc)/usr/share/doc/$(packpmc)
 
-ifeq "$(BUILDARCH)" "powerpc"
+ifeq "$(DEB_HOST_ARCH)" "powerpc"
 mac_subarches=powermac_oldworld powermac_newworld
 pmac_subarches=chrp chrp_pegasos prep iseries
 else
@@ -30,7 +29,7 @@
 
 build:
        $(checkdir)
-       make CFLAGS="-O2 -g -Wall"
+       dh_auto_build -- CFLAGS="-O2 -g -Wall"
        touch build
 
 clean:
@@ -53,7 +52,7 @@
        #dh_installdirs
        # we don't want to package the pdisk man page
        mv pdisk.8 pdisk.8.in
-       set -e; if [ "$(BUILDARCH)" = "m68k" ] || [ -n "$(POWERPC)" ]; then \
+       set -e; if [ "$(DEB_HOST_ARCH)" = "m68k" ] || [ -n "$(POWERPC)" ]; then 
\
                install -d $(tmpmn)/sbin; \
                install -m 755 pdisk $(tmpmn)/sbin/mac-fdisk; \
                install -d $(tmpmn)/usr/share/man/man8; \
@@ -88,14 +87,14 @@
                dh_installchangelogs HISTORY -p$(packpmc); \
        fi
        # install README.Debian also in cross package (not done by 
dh_installdocs)
-       set -e; if [ "$(BUILDARCH)" != "m68k" ] && ! [ -n "$(POWERPC)" ]; then \
+       set -e; if [ "$(DEB_HOST_ARCH)" != "m68k" ] && ! [ -n "$(POWERPC)" ]; 
then \
                install -m 644 debian/README.debian $(docmc)/README.Debian; \
        fi
        # and move the pdisk man page back again ...
        mv pdisk.8.in pdisk.8
 
        # build native pdisk only for m68k, cross package only for others
-       set -e; if [ "$(BUILDARCH)" = "m68k" ] || [ -n "$(POWERPC)" ]; then \
+       set -e; if [ "$(DEB_HOST_ARCH)" = "m68k" ] || [ -n "$(POWERPC)" ]; then 
\
                dh_strip -p$(packmn) -P$(tmpmn); \
                dh_compress -p$(packmn) -P$(tmpmn); \
                dh_fixperms -p$(packmn) -P$(tmpmn); \
@@ -130,7 +129,7 @@
                dh_gencontrol -p$(packpmc); \
                dh_md5sums -p$(packpmc); \
        fi
-       set -e; if [ "$(BUILDARCH)" = "m68k" ] || [ -n "$(POWERPC)" ]; then \
+       set -e; if [ "$(DEB_HOST_ARCH)" = "m68k" ] || [ -n "$(POWERPC)" ]; then 
\
                dh_builddeb -p$(packmn) -P$(tmpmn); \
        else \
                dh_builddeb -p$(packmc); \

Reply via email to