2014-12-18 01:38:11 +01:00
|
|
|
MACHINE=$(uname -m)
|
2014-12-20 05:49:02 +01:00
|
|
|
case "$MACHINE" in
|
|
|
|
x86_64) ARCHITECTURE=amd64;;
|
|
|
|
i686) ARCHITECTURE=i386;;
|
|
|
|
i386) ARCHITECTURE=i386;;
|
|
|
|
esac
|
2014-12-18 01:38:11 +01:00
|
|
|
|
2015-10-25 05:12:43 +01:00
|
|
|
LOCAL=$HOME/.local
|
2014-12-17 02:58:31 +01:00
|
|
|
VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
|
2016-01-07 20:24:51 +01:00
|
|
|
DEBPKGVER=${DEBPKGVER:-1}
|
2014-12-17 22:53:38 +01:00
|
|
|
DEBVER=$VERSION-$DEBPKGVER
|
2014-12-18 01:38:11 +01:00
|
|
|
BASE=pandoc-$DEBVER-$ARCHITECTURE
|
2014-12-17 02:58:31 +01:00
|
|
|
DIST=`pwd`/$BASE
|
2014-12-20 00:17:11 +01:00
|
|
|
DEST=$DIST/usr
|
2014-12-17 02:58:31 +01:00
|
|
|
ME=$(whoami)
|
2014-12-20 02:34:46 +01:00
|
|
|
COPYRIGHT=$DEST/share/doc/pandoc/copyright
|
2014-12-17 02:58:31 +01:00
|
|
|
|
2015-10-25 05:23:40 +01:00
|
|
|
# We need this for hsb2hs:
|
|
|
|
PATH=$LOCAL/bin:$PATH
|
|
|
|
|
2016-07-21 19:14:47 +02:00
|
|
|
mkdir -p $DEST/bin
|
|
|
|
mkdir -p $DEST/share/man/man1
|
|
|
|
mkdir -p $DEST/share/doc/pandoc
|
|
|
|
|
2016-07-20 22:48:20 +02:00
|
|
|
stack install --install-ghc --stack-yaml deb/stack.yaml --local-bin-path . hsb2hs
|
2016-06-04 17:11:07 +02:00
|
|
|
stack install --install-ghc --stack-yaml deb/stack.yaml --local-bin-path . pandoc pandoc-citeproc
|
2014-12-17 02:58:31 +01:00
|
|
|
|
2015-10-25 06:06:53 +01:00
|
|
|
make man/pandoc.1
|
2014-12-17 02:58:31 +01:00
|
|
|
# get pandoc-citeproc man page:
|
2015-10-25 06:00:44 +01:00
|
|
|
PANDOC_CITEPROC_VERSION=`pandoc-citeproc --version | awk '{print $2;}'`
|
2016-07-21 19:14:47 +02:00
|
|
|
curl https://raw.githubusercontent.com/jgm/pandoc-citeproc/${PANDOC_CITEPROC_VERSION}/man/man1/pandoc-citeproc.1 > $DEST/share/man/man1/pandoc-citeproc.1
|
2015-10-25 06:00:44 +01:00
|
|
|
|
2016-06-04 17:02:03 +02:00
|
|
|
strip deb/pandoc
|
|
|
|
strip deb/pandoc-citeproc
|
2015-07-01 21:21:22 +02:00
|
|
|
|
2014-12-20 00:17:11 +01:00
|
|
|
mkdir -p $DEST/share/doc/pandoc-citeproc
|
|
|
|
find $DIST -type d | xargs chmod 755
|
2016-06-04 17:02:03 +02:00
|
|
|
cp deb/pandoc $DEST/bin/
|
|
|
|
cp deb/pandoc-citeproc $DEST/bin/
|
2015-10-25 06:06:53 +01:00
|
|
|
cp man/pandoc.1 $DEST/share/man/man1/pandoc.1
|
2014-12-20 02:14:27 +01:00
|
|
|
gzip -9 $DEST/share/man/man1/pandoc.1
|
|
|
|
gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
|
2014-12-20 02:34:46 +01:00
|
|
|
cp COPYRIGHT $COPYRIGHT
|
|
|
|
echo "" >> $COPYRIGHT
|
|
|
|
echo "pandoc-citeproc" >> $COPYRIGHT
|
2016-07-21 19:29:09 +02:00
|
|
|
curl https://raw.githubusercontent.com/jgm/pandoc-citeproc/${PANDOC_CITEPROC_VERSION}/LICENSE >> $COPYRIGHT
|
2014-12-17 02:58:31 +01:00
|
|
|
|
2015-01-26 23:30:27 +01:00
|
|
|
INSTALLED_SIZE=$(du -B 1024 -s $DEST | awk '{print $1}')
|
2014-12-17 09:16:59 +01:00
|
|
|
mkdir $DIST/DEBIAN
|
2014-12-18 01:38:11 +01:00
|
|
|
perl -pe "s/VERSION/$DEBVER/" deb/control.in | \
|
2015-01-26 23:30:27 +01:00
|
|
|
perl -pe "s/ARCHITECTURE/$ARCHITECTURE/" | \
|
|
|
|
perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
|
|
|
|
> $DIST/DEBIAN/control
|
2014-12-17 02:58:31 +01:00
|
|
|
|
2014-12-20 00:17:11 +01:00
|
|
|
fakeroot dpkg-deb --build $DIST
|
2014-12-17 22:53:38 +01:00
|
|
|
rm -rf $DIST
|