@@ -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 --enable-executable-static --ghc-options '-optc-Os -optl=-pthread -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
@@ -17,8 +31,6 @@ DIST=`pwd`/$BASE
1731DEST=$DIST/usr
1832COPYRIGHT=$DEST/share/doc/pandoc/copyright
1933
20−PANDOC_CITEPROC_VERSION=`$ARTIFACTS/pandoc-citeproc --version | awk '{print $2;}'`
21−
2234mkdir -p $DEST/bin
2335mkdir -p $DEST/share/man/man1
2436mkdir -p $DEST/share/doc/pandoc
@@ -29,12 +41,12 @@ cp $ARTIFACTS/pandoc $DEST/bin/
2941cp $ARTIFACTS/pandoc-citeproc $DEST/bin/
3042strip $DEST/bin/pandoc
3143strip $DEST/bin/pandoc-citeproc
32−cp man/pandoc.1 $DEST/share/man/man1/pandoc.1
44+cp /mnt/man/pandoc.1 $DEST/share/man/man1/pandoc.1
3345$ARTIFACTS/pandoc-citeproc --man > $DEST/share/man/man1/pandoc-citeproc.1
3446gzip -9 $DEST/share/man/man1/pandoc.1
3547gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
3648
37−cp COPYRIGHT $COPYRIGHT
49+cp /mnt/COPYRIGHT $COPYRIGHT
3850echo "" >> $COPYRIGHT
3951echo "pandoc-citeproc" >> $COPYRIGHT
4052$ARTIFACTS/pandoc-citeproc --license >> $COPYRIGHT
@@ -46,6 +58,25 @@ perl -pe "s/VERSION/$DEBVER/" linux/control.in | \
4658 perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
4759 > $DIST/DEBIAN/control
4860
49−fakeroot dpkg-deb --build $DIST
61+# we limit compression to avoid OOM error
62+fakeroot dpkg-deb -Zgzip -z9 --build $DIST
5063rm -rf $DIST
5164cp $BASE.deb $ARTIFACTS/
65+
66+# Make tarball
67+
68+TARGET=pandoc-$VERSION
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+
81+tar cvzf $TARGET-linux-amd64.tar.gz $TARGET
82+rm -r $TARGET