blob: 27e0b958de4f664fcfdee3d2d60c5a62b53c6b1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/sh -e
VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $2;}')
ARTIFACTS=macos-release-candidate
RESOURCES=$ARTIFACTS/Resources
ROOT=$ARTIFACTS/pandoc
DEST=$ROOT/usr/local
ME=$(whoami)
CABALOPTS="-fembed_data_files -fserver -flua"
# Build the pandoc binary and put it in .
cabal update
cabal build all $CABALOPTS
BINPATH=$(cabal list-bin $CABALOPTS pandoc-cli)
echo "Built executable..."
# Create directories
echo "Creating $ARTIFACTS directory..."
mkdir -p $ARTIFACTS
mkdir -p $RESOURCES
mkdir -p $DEST/bin
mkdir -p $DEST/share/man/man1
# Copy binary and strip it
echo "Copying executable..."
cp "$BINPATH/pandoc" "$DEST/bin/"
strip "$DEST/bin/pandoc"
# Copy man pages and license
echo "Copying manuals and license..."
cp man/pandoc.1 "$DEST/share/man/man1/pandoc.1"
cp man/pandoc-server.1 "$DEST/share/man/man1/pandoc-server.1"
cp man/pandoc-lua.1 "$DEST/share/man/man1/pandoc-lua.1"
"$BINPATH/pandoc" -s COPYING.md -Vpagetitle=License -o "$RESOURCES/license.html"
# Prepare distribution directory; after downloading, run 'make' to notarize
echo "Preparing distribution directory..."
chown -R "$ME:staff" "$ROOT"
sed -e "s/PANDOCVERSION/$VERSION/" macos/distribution.xml.in > "$ARTIFACTS/distribution.xml"
cp macos/Makefile "$ARTIFACTS/"
echo "$VERSION" > "$ARTIFACTS/version.txt"
ls -R $ARTIFACTS
echo "Finished..."
|