[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#939777: z8530-utils2 FTCBFS: does not use cross tools



Source: z8530-utils2
Version: 3.0-1-9
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs

z8530-utils2 fails to cross build from source, because it uses the build
architecture compiler. The easiest way of passing cross tools to make is
using dh_auto_build. Unfortunately, the upstream Makefile does not
recognize standard substitutions such as CC and needs to be patched.
Similarly, it insists on stripping at installation time, which also
breaks DEB_BUILD_OPTIONS=nostrip as well as generation of -dbgsym
packages. It is best to defer all stripping to dh_strip. This can be
achieved by replacing install with a non-stripping install. Please
consider applying the attached patch.

Helmut
diff -u z8530-utils2-3.0-1/Makefile z8530-utils2-3.0-1/Makefile
--- z8530-utils2-3.0-1/Makefile
+++ z8530-utils2-3.0-1/Makefile
@@ -9,27 +9,27 @@
 utils: sccparam sccstat sccinit gencfg kissbridge
 
 sccparam: sccparam.c
-	gcc ${CCOPT} sccparam.c -o $@
+	$(CC) ${CCOPT} sccparam.c -o $@
 
 sccstat: sccstat.c
-	gcc ${CCOPT} sccstat.c -o $@
+	$(CC) ${CCOPT} sccstat.c -o $@
 
 sccinit: sccinit.c
-	gcc ${CCOPT} sccinit.c -o $@
+	$(CC) ${CCOPT} sccinit.c -o $@
 
 gencfg: gencfg.c
-	gcc ${CCOPT} gencfg.c -o $@
+	$(CC) ${CCOPT} gencfg.c -o $@
 
 kissbridge: kissbridge.c
-	gcc ${CCOPT} kissbridge.c -o $@
+	$(CC) ${CCOPT} kissbridge.c -o $@
 
 install:
-	install -s -g root -o root -m 0755 -s gencfg $(DESTDIR)/usr/bin/gencfg
-	install -s -g root -o root -m 0755 -s sccstat $(DESTDIR)/usr/bin/sccstat
-	install -s -g root -o root -m 0700 -s sccinit $(DESTDIR)/usr/sbin/sccinit
-	install -s -g root -o root -m 0700 -s sccparam $(DESTDIR)/usr/sbin/sccparam
-	install -s -g root -o root -m 0700 -s kissbridge $(DESTDIR)/usr/sbin/kissbridge
-	install -g root -o root -m 0644 z8530drv.conf $(DESTDIR)/etc/z8530drv.conf
+	$(INSTALL) -s -g root -o root -m 0755 -s gencfg $(DESTDIR)/usr/bin/gencfg
+	$(INSTALL) -s -g root -o root -m 0755 -s sccstat $(DESTDIR)/usr/bin/sccstat
+	$(INSTALL) -s -g root -o root -m 0700 -s sccinit $(DESTDIR)/usr/sbin/sccinit
+	$(INSTALL) -s -g root -o root -m 0700 -s sccparam $(DESTDIR)/usr/sbin/sccparam
+	$(INSTALL) -s -g root -o root -m 0700 -s kissbridge $(DESTDIR)/usr/sbin/kissbridge
+	$(INSTALL) -g root -o root -m 0644 z8530drv.conf $(DESTDIR)/etc/z8530drv.conf
 
 clean:
 	rm -f *.o *~ doc/*~ sccstat sccinit sccparam gencfg kissbridge
@@ -51,7 +51,7 @@
 	z8530drv-utils/z8530drv.conf z8530drv-utils/*.lsm)
 
 dep:
-	gcc ${CCOPT} -M sccstat.c sccinit.c sccparam.c kissbridge.c gencfg.c >.depend
+	$(CC) ${CCOPT} -M sccstat.c sccinit.c sccparam.c kissbridge.c gencfg.c >.depend
 
 ifeq (.depend,$(wildcard .depend))
 include .depend
diff -u z8530-utils2-3.0-1/debian/changelog z8530-utils2-3.0-1/debian/changelog
--- z8530-utils2-3.0-1/debian/changelog
+++ z8530-utils2-3.0-1/debian/changelog
@@ -1,3 +1,14 @@
+z8530-utils2 (3.0-1-9.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + Makefile: don't hard code gcc
+    + Pass a non-stripping install to make install.
+    + Makefile: don't hard code install
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sun, 08 Sep 2019 19:54:14 +0200
+
 z8530-utils2 (3.0-1-9) unstable; urgency=medium
 
   * Remove hamish from Uploaders as he has retired from Debian Closes: 831488
diff -u z8530-utils2-3.0-1/debian/rules z8530-utils2-3.0-1/debian/rules
--- z8530-utils2-3.0-1/debian/rules
+++ z8530-utils2-3.0-1/debian/rules
@@ -36,9 +36,7 @@
 
 build-stamp: configure-stamp 
 	dh_testdir
-
-	# Add here commands to compile the package.
-	$(MAKE)
+	dh_auto_build
 	#docbook-to-man debian/z8530-utils2-3.0.sgml > z8530-utils2-3.0.1
 
 	touch build-stamp
@@ -60,7 +58,7 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/z8530-utils2.
-	$(MAKE) install DESTDIR=$(CURDIR)/debian/z8530-utils2
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/z8530-utils2 INSTALL='install --strip-program=true'
 
 
 # Build architecture-independent files here.

Reply to: