diff options
Diffstat (limited to 'make_deb.sh')
-rwxr-xr-x | make_deb.sh | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/make_deb.sh b/make_deb.sh index a5aaf1549..9b7960805 100755 --- a/make_deb.sh +++ b/make_deb.sh @@ -7,7 +7,7 @@ case "$MACHINE" in i386) ARCHITECTURE=i386;; esac -SANDBOX=`pwd`/.cabal-sandbox +LOCAL=$HOME/.local VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}') DEBPKGVER=1 DEBVER=$VERSION-$DEBPKGVER @@ -16,41 +16,44 @@ DIST=`pwd`/$BASE DEST=$DIST/usr ME=$(whoami) COPYRIGHT=$DEST/share/doc/pandoc/copyright +TEMPDIR=make_binary_package.tmp.$$ -# echo Removing old files... -rm -rf $DIST +# We need this for hsb2hs: +PATH=$LOCAL/bin:$PATH -cabal sandbox init -echo Updating database -cabal update +stack setup +stack clean +which hsb2hs || stack install --stack-yaml stack.hsb2hs.yaml -export PATH=`pwd`/.cabal-sandbox/bin:$PATH -which hsb2hs || cabal install hsb2hs -echo Building pandoc... -cabal clean -cabal install --force --reinstall --flags="embed_data_files make-pandoc-man-pages" . pandoc-citeproc +stack install --stack-yaml deb/stack.yaml +make man/pandoc.1 # get pandoc-citeproc man page: -PANDOC_CITEPROC_PATH=`cabal unpack -d make_binary_package.tmp.$$ pandoc-citeproc | awk '{print $3;}'` -strip $SANDBOX/bin/pandoc -strip $SANDBOX/bin/pandoc-citeproc +PANDOC_CITEPROC_VERSION=`pandoc-citeproc --version | awk '{print $2;}'` +PANDOC_CITEPROC_TARBALL=https://hackage.haskell.org/package/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}.tar.gz +mkdir $TEMPDIR +curl ${PANDOC_CITEPROC_TARBALL} | tar xzC $TEMPDIR +PANDOC_CITEPROC_PATH=$TEMPDIR/pandoc-citeproc-${PANDOC_CITEPROC_VERSION} + +strip $LOCAL/bin/pandoc +strip $LOCAL/bin/pandoc-citeproc mkdir -p $DEST/bin mkdir -p $DEST/share/man/man1 mkdir -p $DEST/share/doc/pandoc mkdir -p $DEST/share/doc/pandoc-citeproc find $DIST -type d | xargs chmod 755 -cp $SANDBOX/bin/pandoc $DEST/bin/ -cp $SANDBOX/bin/pandoc-citeproc $DEST/bin/ -cp $SANDBOX/share/man/man1/pandoc.1 $DEST/share/man/man1/pandoc.1 +cp $LOCAL/bin/pandoc $DEST/bin/ +cp $LOCAL/bin/pandoc-citeproc $DEST/bin/ +cp man/pandoc.1 $DEST/share/man/man1/pandoc.1 gzip -9 $DEST/share/man/man1/pandoc.1 -cp $PANDOC_CITEPROC_PATH/man/man1/pandoc-citeproc.1 $DEST/share/man/man1/ +cp ${PANDOC_CITEPROC_PATH}/man/man1/pandoc-citeproc.1 $DEST/share/man/man1/ gzip -9 $DEST/share/man/man1/pandoc-citeproc.1 cp COPYRIGHT $COPYRIGHT echo "" >> $COPYRIGHT echo "pandoc-citeproc" >> $COPYRIGHT cat $PANDOC_CITEPROC_PATH/LICENSE >> $COPYRIGHT -rm -rf make_binary_package.tmp.$$ +rm -rf $TEMPDIR INSTALLED_SIZE=$(du -B 1024 -s $DEST | awk '{print $1}') mkdir $DIST/DEBIAN |