Source: netcat-openbsd
Version: 1.105-7
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

netcat-openbsd fails to cross build from source, because it uses build
architecture tools. For the compiler, this can be fixed by using
dh_auto_build, which passes cross compilers since debhelper 10.2.1. For
pkg-config a small patch is necessary to substitute a triplet-prefixed
tool. Please consider applying the attached patch which makes cross
building work.

Helmut
diff --minimal -Nru netcat-openbsd-1.105/debian/changelog 
netcat-openbsd-1.105/debian/changelog
--- netcat-openbsd-1.105/debian/changelog       2012-06-13 03:07:25.000000000 
+0200
+++ netcat-openbsd-1.105/debian/changelog       2016-10-07 20:35:13.000000000 
+0200
@@ -1,3 +1,12 @@
+netcat-openbsd (1.105-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1).
+    + Let dh_auto_build pass cross compilers
+    + Use triplet-prefixed pkg-config
+
+ -- Helmut Grohne <hel...@subdivi.de>  Fri, 07 Oct 2016 20:32:47 +0200
+
 netcat-openbsd (1.105-7) unstable; urgency=low
 
   * Make UNIX dgram sockets work (Closes: #676997).
diff --minimal -Nru netcat-openbsd-1.105/debian/patches/0012-cross.patch 
netcat-openbsd-1.105/debian/patches/0012-cross.patch
--- netcat-openbsd-1.105/debian/patches/0012-cross.patch        1970-01-01 
01:00:00.000000000 +0100
+++ netcat-openbsd-1.105/debian/patches/0012-cross.patch        2016-10-07 
20:35:35.000000000 +0200
@@ -0,0 +1,17 @@
+From: Helmut Grohne <hel...@subdivi.de>
+Subject: allow overriding pkg-config
+
+Index: netcat-openbsd-1.105/Makefile
+===================================================================
+--- netcat-openbsd-1.105.orig/Makefile
++++ netcat-openbsd-1.105/Makefile
+@@ -3,7 +3,8 @@
+ PROG= nc
+ SRCS= netcat.c atomicio.c socks.c
+ 
+-LIBS=  `pkg-config --libs libbsd` -lresolv
++PKG_CONFIG?=pkg-config
++LIBS=  `$(PKG_CONFIG) --libs libbsd` -lresolv
+ OBJS=  $(SRCS:.c=.o)
+ CFLAGS=  -g -O2
+ LDFLAGS=  -Wl,--no-add-needed
diff --minimal -Nru netcat-openbsd-1.105/debian/patches/series 
netcat-openbsd-1.105/debian/patches/series
--- netcat-openbsd-1.105/debian/patches/series  2012-06-13 03:09:49.000000000 
+0200
+++ netcat-openbsd-1.105/debian/patches/series  2016-10-07 20:34:20.000000000 
+0200
@@ -9,3 +9,4 @@
 0009-dccp-support.patch
 0010-serialized-handling-multiple-clients.patch
 0011-misc-failures-and-features.patch
+0012-cross.patch
diff --minimal -Nru netcat-openbsd-1.105/debian/rules 
netcat-openbsd-1.105/debian/rules
--- netcat-openbsd-1.105/debian/rules   2012-06-13 03:07:25.000000000 +0200
+++ netcat-openbsd-1.105/debian/rules   2016-10-07 20:36:02.000000000 +0200
@@ -1,6 +1,8 @@
 #!/usr/bin/make -f
 DPKG_EXPORT_BUILDFLAGS = 1
 -include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/architecture.mk
+export PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config
 
 DEB_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 DEB_LDFLAGS = $(LDFLAGS) -Wl,--no-add-needed,--as-needed
@@ -9,7 +11,7 @@
 %:
        dh $@
 override_dh_auto_build:
-       $(MAKE) CFLAGS='$(DEB_CFLAGS) -DDEBIAN_VERSION=\"$(DEB_VER)\"' 
LDFLAGS="$(DEB_LDFLAGS)"
+       dh_auto_build -- CFLAGS='$(DEB_CFLAGS) -DDEBIAN_VERSION=\"$(DEB_VER)\"' 
LDFLAGS="$(DEB_LDFLAGS)"
 override_dh_auto_install:
        mv nc nc.openbsd
        mv nc.1 nc_openbsd.1

Reply via email to