Source: rhash
Version: 1.3.4-2
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

rhash fails to cross build from source for a number of reasons:
 * It uses the build architecture compilers (as a Makefile default).
   Wrapping the build in dh_auto_build fixes that, because debhelper
   knows how to pass cross compilers.
 * It runs the tests despite DEB_BUILD_OPTIONS=nocheck.
 * It strips at install time with the build architecture strip (install
   default). Skipping the stripping at install time lets dh_strip
   generate a debug package and still honours the nostrip option.

After fixing all of the above, rhash cross builds successfully. Please
apply the attached patch.

Helmut
diff --minimal -Nru rhash-1.3.4/debian/changelog rhash-1.3.4/debian/changelog
--- rhash-1.3.4/debian/changelog        2017-07-10 15:54:30.000000000 +0200
+++ rhash-1.3.4/debian/changelog        2017-08-02 16:37:09.000000000 +0200
@@ -1,3 +1,13 @@
+rhash (1.3.4-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross compilers to $(MAKE).
+    + Honour DEB_BUILD_OPTIONS=nocheck.
+    + Let dh_strip strip.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Wed, 02 Aug 2017 16:37:09 +0200
+
 rhash (1.3.4-2) unstable; urgency=medium
 
   * Team upload (collab-maint).
diff --minimal -Nru rhash-1.3.4/debian/rules rhash-1.3.4/debian/rules
--- rhash-1.3.4/debian/rules    2017-07-10 15:54:20.000000000 +0200
+++ rhash-1.3.4/debian/rules    2017-08-02 16:37:07.000000000 +0200
@@ -15,9 +15,6 @@
 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -g
 endif
-ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-       INSTALL_PROGRAM += -s
-endif
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
        NUMJOBS = $(patsubst parallel=%,%,$(filter 
parallel=%,$(DEB_BUILD_OPTIONS)))
        MAKEFLAGS += -j$(NUMJOBS)
@@ -38,18 +35,19 @@
 %:
        dh $@
 
-build:
+override_dh_auto_build:
        # Compile static/shared libraries and the program.
-       $(MAKE) lib-static lib-shared build-shared CFLAGS="$(CFLAGS)" 
LDFLAGS="$(LDFLAGS)" \
+       dh_auto_build -- lib-static lib-shared build-shared CFLAGS="$(CFLAGS)" 
LDFLAGS="$(LDFLAGS)" \
                LIBCFLAGS="$(LIBCFLAGS)" LIBLDFLAGS="$(LIBLDFLAGS)"
 
-override_dh_auto_build:
+ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
 override_dh_auto_test:
        # note: static and shared libraries will be built if not exist yet
        $(MAKE) test-static-lib CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
                LIBCFLAGS="$(LIBCFLAGS)" LIBLDFLAGS="$(LIBLDFLAGS)"
        $(MAKE) test-shared CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
                LIBCFLAGS="$(LIBCFLAGS)" LIBLDFLAGS="$(LIBLDFLAGS)" 
LD_LIBRARY_PATH="$(LD_LIB)"
+endif
 
 override_dh_auto_install:
        # v1.3.2: quick fix for fail on parallel build

Reply via email to