Source: setserial
Version: 2.17-55
Tags: patch
User: [email protected]
Usertags: ftcbfs

setserial fails to cross build from source, because it does not pass
--host to configure but is being passed a cross compiler. This used to
work, because configure was so ancient but now that it is being
autoreconf'ed, it needs the --host flag. On the flip side, it no longer
needs CC exported.

I also noticed that the packaging confused build and host architecture.
While fixing that part, I noticed that it does not properly trap errors
from debian/rules, because it forgets to set -e for chained commands.
I've also fixed that by not chaining commands.

All of the aspects mentioned above are fixed in the attached patch for
your convenience.

Helmut
diff --minimal -Nru setserial-2.17/debian/changelog 
setserial-2.17/debian/changelog
--- setserial-2.17/debian/changelog     2024-07-27 09:39:00.000000000 +0200
+++ setserial-2.17/debian/changelog     2024-11-06 08:30:09.000000000 +0100
@@ -1,3 +1,13 @@
+setserial (2.17-55.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_configure pass --host to configure.
+    + Fix build vs host confusion.
+    + Fix lack of error trapping. (Policy violation)
+
+ -- Helmut Grohne <[email protected]>  Wed, 06 Nov 2024 08:30:09 +0100
+
 setserial (2.17-55) unstable; urgency=medium
 
   * debian/rules: use autoreconf (Closes: #1075505)
diff --minimal -Nru setserial-2.17/debian/rules setserial-2.17/debian/rules
--- setserial-2.17/debian/rules 2024-07-27 09:39:00.000000000 +0200
+++ setserial-2.17/debian/rules 2024-11-06 08:30:09.000000000 +0100
@@ -4,12 +4,8 @@
 
 
 include /usr/share/dpkg/architecture.mk
-ifeq ($(origin CC),default)
-export CC := $(DEB_HOST_GNU_TYPE)-gcc
-endif
 
 DESTDIR = $(CURDIR)/debian/setserial
-arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
 CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
@@ -26,7 +22,7 @@
 endif
        autoupdate
        dh_autoreconf
-       ./configure --prefix=/usr
+       dh_auto_configure
        # make both m68k 2.2 and 2.4+ kernels work effectively
        #
        rm -f gorhack.h
@@ -62,23 +58,22 @@
        install -g root -m 755 -o root setserial   $(DESTDIR)/usr/bin
        install -g root -m 644 -o root    setserial.8 \
                $(DESTDIR)/usr/share/man/man8/setserial.8
-       echo ${arch}
-       if [ "${arch}" = "m68k" ] ; then \
-         echo "Using rc.serial.m68k" ;\
-         install -g root -m 755 -o root    rc.serial.m68k \
-               $(DESTDIR)/etc/init.d/setserial ; \
-       else \
-         echo "Using rc.serial" ;\
-         install -g root -m 755 -o root  rc.serial \
-               $(DESTDIR)/etc/init.d/setserial ; \
-         install -g root -m 755 -o root  rc.etc-setserial \
-               $(DESTDIR)/etc/init.d/etc-setserial ; \
-         install -g root -m 644 -o root    serial.conf 
$(DESTDIR)/usr/share/doc/setserial/serial.conf ;\
-         # #518313, not used anymore: install -g root -m 644 -o root    
debian/setserial.modutils $(DESTDIR)/etc/modutils/setserial ;\
-       fi
-       if [ "${arch}" = "sparc" ] ; then \
-         install -g root -m 644 -o root    serial.conf.sparc 
$(DESTDIR)/usr/share/doc/setserial/serial.conf ;\
-       fi
+ifeq ($(DEB_HOST_ARCH),m68k)
+       echo "Using rc.serial.m68k"
+       install -g root -m 755 -o root    rc.serial.m68k \
+               $(DESTDIR)/etc/init.d/setserial
+else
+       echo "Using rc.serial"
+       install -g root -m 755 -o root  rc.serial \
+               $(DESTDIR)/etc/init.d/setserial
+       install -g root -m 755 -o root  rc.etc-setserial \
+               $(DESTDIR)/etc/init.d/etc-setserial
+       install -g root -m 644 -o root    serial.conf 
$(DESTDIR)/usr/share/doc/setserial/serial.conf
+         # #518313, not used anymore: install -g root -m 644 -o root    
debian/setserial.modutils $(DESTDIR)/etc/modutils/setserial
+endif
+ifeq ($(DEB_HOST_ARCH),sparc)
+       install -g root -m 644 -o root    serial.conf.sparc 
$(DESTDIR)/usr/share/doc/setserial/serial.conf
+endif
 
        # Lintian overrides
        cd debian ; \

Reply via email to