Source: glpk
Version: 4.63-1
User: helm...@debian.org
Usertags: rebootstrap

glpk fails to cross build from source:

| help2man -N -n "large-scale linear and mixed integer programming solver" -o 
debian/tmp/glpsol.1 examples/glpsol
| help2man: can't get `--help' info from examples/glpsol
| Try `--no-discard-stderr' if option outputs to stderr
| debian/rules:10: recipe for target 'override_dh_auto_install' failed
| make[1]: *** [override_dh_auto_install] Error 126
| make[1]: Leaving directory '/<<PKGBUILDDIR>>'
| debian/rules:4: recipe for target 'binary-arch' failed
| make: *** [binary-arch] Error 2
| dpkg-buildpackage: error: fakeroot debian/rules binary-arch gave error exit 
status 2

Running help2man is always a bad idea, because it breaks cross
compilation and the manual page is of dubious value. I looked at the
generated one and couldn't figure out what glpsol is supposed to do.

The attached patch adds a script that extracts the --help output from
the source to avoid running it. While that doesn't improve the quality
of the manual page, it makes glpk cross build.

Please consider applying the attached patch or replacing the manual page
with a useful one. A short discussion on #debian-devel revealed that the
preferred solution is to replace it with a version that says what glpsol
does and directs readers to further documentation (e.g. running glpsol
--help or https://en.wikibooks.org/wiki/GLPK/Using_GLPSOL) rather than
extracting it.

Helmut
diff --minimal -Nru glpk-4.63/debian/changelog glpk-4.63/debian/changelog
--- glpk-4.63/debian/changelog  2017-07-29 10:17:30.000000000 +0200
+++ glpk-4.63/debian/changelog  2017-09-14 09:29:00.000000000 +0200
@@ -1,3 +1,10 @@
+glpk (4.63-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Don't run help2man on host architecture code. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 14 Sep 2017 09:29:00 +0200
+
 glpk (4.63-1) unstable; urgency=medium
 
   * New upstream version 4.63
diff --minimal -Nru glpk-4.63/debian/help2man/glpsol 
glpk-4.63/debian/help2man/glpsol
--- glpk-4.63/debian/help2man/glpsol    1970-01-01 01:00:00.000000000 +0100
+++ glpk-4.63/debian/help2man/glpsol    2017-09-14 09:29:00.000000000 +0200
@@ -0,0 +1,12 @@
+#!/bin/sh
+case "$1" in
+       --help)
+               sed '1,/^static void 
print_help/d;/^}/,$d;:a;/xprintf[^)]*[^;]*$/{N;ba};s/\n//;s/^\s*//;/^[^x]/d;s/%s/gplsol/;s/,
 my_name//;s/xprintf("\(.*\)\\n\"\s*)\s*;/\1/;s/"\s*"//;s/\\"/"/g' 
examples/glpsol.c
+       ;;
+       --version)
+               echo "GLPSOL: GLPK LP/MIP Solver, $(dpkg-parsechangelog 
-SVersion | sed 's/-.*//')"
+       ;;
+       *)
+               exit 1
+       ;;
+esac
diff --minimal -Nru glpk-4.63/debian/rules glpk-4.63/debian/rules
--- glpk-4.63/debian/rules      2017-07-28 11:55:22.000000000 +0200
+++ glpk-4.63/debian/rules      2017-09-14 09:28:58.000000000 +0200
@@ -8,7 +8,7 @@
 
 override_dh_auto_install:
        dh_auto_install
-       help2man -N -n "large-scale linear and mixed integer programming 
solver" -o debian/tmp/glpsol.1 examples/glpsol
+       help2man -N -n "large-scale linear and mixed integer programming 
solver" -o debian/tmp/glpsol.1 debian/help2man/glpsol
 
 override_dh_makeshlibs:
        dh_makeshlibs -V

Reply via email to