Source: fatsort
Version: 1.3.365-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

fatsort fails to cross build from source, because the upstream Makefile
hard codes the environment variables set up by cdbs. dh_auto_build
instead passes them as override variables so fatsort's build system
consumes them. One also has to set LD. help2man slightly complicates the
picture making it necessary to build fatsort twice: Once for help2man
and once for real. The attached patch makes fatsort cross buildable.
Please consider applying it.

Helmut
diff --minimal -Nru fatsort-1.3.365/debian/changelog 
fatsort-1.3.365/debian/changelog
--- fatsort-1.3.365/debian/changelog    2015-09-19 13:29:40.000000000 +0200
+++ fatsort-1.3.365/debian/changelog    2019-05-05 09:37:13.000000000 +0200
@@ -1,3 +1,12 @@
+fatsort (1.3.365-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + Add a native build pass for help2man.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 05 May 2019 09:37:13 +0200
+
 fatsort (1.3.365-1) unstable; urgency=medium
 
   * New upstream release (Closes: #717397, #557142).
diff --minimal -Nru fatsort-1.3.365/debian/rules fatsort-1.3.365/debian/rules
--- fatsort-1.3.365/debian/rules        2010-03-22 14:44:52.000000000 +0100
+++ fatsort-1.3.365/debian/rules        2019-05-05 09:37:13.000000000 +0200
@@ -1,5 +1,6 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/makefile.mk
 
@@ -8,6 +9,17 @@
 
 DEB_INSTALL_MANPAGES_fatsort := man/fatsort.1
 
+$(cdbs_make_build_stamps):
+       # perform a native build for help2man
+       dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_build -- LD='$$(CC)'
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+       dh_auto_clean --sourcedirectory=src
+       dh_auto_build --sourcedirectory=src -- LD='$$(CC)'
+       # prevent regenerating manpage
+       touch -c man/fatsort.1
+endif
+       touch $@
+
 install/fatsort::
        dh_install src/fatsort /usr/bin
 

Reply via email to