@@ -9,6 +9,20 @@ esac
99
1010ARTIFACTS="${ARTIFACTS:-/artifacts}"
1111
12+# build binaries
13+
14+cabal --version
15+ghc --version
16+
17+cabal v2-update
18+cabal v2-clean
19+cabal v2-configure --enable-tests -f-export-dynamic -fstatic -fembed_data_files -fbibutils --ghc-options '-optc-Os -optl=-pthread -optl=-static -fPIC -split-sections' . pandoc-citeproc
20+cabal v2-build . pandoc-citeproc
21+cabal v2-test -j1 . pandoc-citeproc
22+for f in $(find dist-newstyle -name 'pandoc*' -type f -perm +400); do cp $f /artifacts/; done
23+
24+# make deb
25+
1226VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
1327REVISION=${REVISION:-1}
1428DEBVER=$VERSION-$REVISION
@@ -49,3 +63,20 @@ perl -pe "s/VERSION/$DEBVER/" linux/control.in | \
4963fakeroot dpkg-deb --build $DIST
5064rm -rf $DIST
5165cp $BASE.deb $ARTIFACTS/
66+
67+# Make tarball
68+
69+cd $ARTIFACTS
70+rm -rf $TARGET
71+mkdir $TARGET
72+mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1
73+./pandoc-citeproc --man > $TARGET/share/man/man1/pandoc-citeproc.1
74+cp /mnt/man/pandoc.1 $TARGET/share/man/man1
75+mv pandoc pandoc-citeproc $TARGET/bin
76+strip $TARGET/bin/pandoc
77+strip $TARGET/bin/pandoc-citeproc
78+gzip -9 $TARGET/share/man/man1/pandoc.1
79+gzip -9 $TARGET/share/man/man1/pandoc-citeproc.1
80+tar cvzf $TARGET-linux-amd64.tar.gz $TARGET
81+rm -r $TARGET
82+