When I first built ghc-7.10.1-5 it created this script in debian/tmp/usr/bin/haddock-ghc-7.10.1:
#!/bin/bash
exedir="/usr/lib/ghc/bin"
exeprog="haddock"
executablename="$exedir/$exeprog"
datadir="/usr/share"
bindir="/usr/bin"
topdir="/usr/lib/ghc"
#!/bin/sh
exec "$executablename" -B"$topdir" -l"$topdir" ${1+"$@"}
Unfortunately, executablename=/usr/lib/ghc/bin/haddock still contained the old haddock executable from ghc-7.8 which printed 25, so the value ghc ended up providing was haddock-interface-25.
However, I was able to get the correct value by applying this patch:
--- old/debian/rules 2015-05-13 02:17:55.000000000 -0700
+++ new/debian/rules 2015-06-06 15:54:17.416008283 -0700
@@ -166,8 +166,8 @@
echo 'ghci=ghc-ghci' >> debian/ghc.substvars ; fi
# Add haddock substvars
- echo "haddock:Depends=haddock-interface-$$(debian/tmp/usr/bin/haddock --interface-version)" >> debian/ghc-doc.substvars
- echo "haddock:Provides=haddock-interface-$$(debian/tmp/usr/bin/haddock --interface-version)" >> debian/ghc.substvars
+ echo "haddock:Depends=haddock-interface-$$(debian/tmp/usr/lib/ghc/bin/haddock --interface-version)" >> debian/ghc-doc.substvars
+ echo "haddock:Provides=haddock-interface-$$(debian/tmp/usr/lib/ghc/bin/haddock --interface-version)" >> debian/ghc.substvars
ifeq (YES,$(BUILD_HADDOCK_DOCS))
mkdir -p debian/tmp/usr/lib/ghc-doc