@@ -16,6 +16,7 @@ DIST=`pwd`/$BASE
1616DEST=$DIST/usr
1717ME=$(whoami)
1818COPYRIGHT=$DEST/share/doc/pandoc/copyright
19+TEMPDIR=make_binary_package.tmp.$$
1920
2021# We need this for hsb2hs:
2122PATH=$LOCAL/bin:$PATH
@@ -27,7 +28,12 @@ which hsb2hs || stack install --stack-yaml stack.hsb2hs.yaml
2728stack install --stack-yaml deb/stack.yaml
2829
2930# get pandoc-citeproc man page:
30−PANDOC_CITEPROC_PATH=`stack unpack -d make_binary_package.tmp.$$ pandoc-citeproc | awk '{print $3;}'`
31+PANDOC_CITEPROC_VERSION=`pandoc-citeproc --version | awk '{print $2;}'`
32+PANDOC_CITEPROC_TARBALL=https://hackage.haskell.org/package/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}.tar.gz
33+mkdir $TEMPDIR
34+curl ${PANDOC_CITEPROC_TARBALL} | tar xzC $TEMPDIR
35+PANDOC_CITEPROC_PATH=$TEMPDIR/pandoc-citeproc/${PANDOC_CITEPROC_VERSION}
36+
3137strip $LOCAL/bin/pandoc
3238strip $LOCAL/bin/pandoc-citeproc
3339mkdir -p $DEST/bin
@@ -40,13 +46,13 @@ cp $LOCAL/bin/pandoc $DEST/bin/
4046cp $LOCAL/bin/pandoc-citeproc $DEST/bin/
4147cp $LOCAL/share/man/man1/pandoc.1 $DEST/share/man/man1/pandoc.1
4248gzip -9 $DEST/share/man/man1/pandoc.1
43−cp $PANDOC_CITEPROC_PATH/man/man1/pandoc-citeproc.1 $DEST/share/man/man1/
49+cp ${PANDOC_CITEPROC_pATH}/man/man1/pandoc-citeproc.1 $DEST/share/man/man1/
4450gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
4551cp COPYRIGHT $COPYRIGHT
4652echo "" >> $COPYRIGHT
4753echo "pandoc-citeproc" >> $COPYRIGHT
4854cat $PANDOC_CITEPROC_PATH/LICENSE >> $COPYRIGHT
49−rm -rf make_binary_package.tmp.$$
55+rm -rf $TEMPDIR
5056
5157INSTALLED_SIZE=$(du -B 1024 -s $DEST | awk '{print $1}')
5258mkdir $DIST/DEBIAN