blob: 1a03d7c159fe3febc0e3117ce450d501fa9376a4 (
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
45
46
47
48
49
50
51
52
|
#!/bin/sh -e
DIST=osx_package
VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
RESOURCES=$DIST/Resources
ROOT=$DIST/pandoc
SCRIPTS=osx-resources
BASE=pandoc-$VERSION
ME=jgm
echo Removing old files...
rm -rf $DIST
mkdir -p $RESOURCES
echo Building pandoc...
sudo cabal-dev install-deps
sudo cabal-dev install --reinstall --flags="embed_data_files" citeproc-hs
sudo cabal-dev install --disable-library-for-ghci highlighting-kate
sudo cabal-dev install --prefix=/usr/local --datasubdir=$BASE --docdir=/usr/local/doc/$BASE
sudo cabal-dev copy --destdir=$ROOT
# remove library files
sudo rm -r $ROOT/lib
sudo chown -R $ME:staff $DIST
gzip $ROOT/usr/local/share/man/man?/*.*
# cabal gives man pages the wrong permissions
chmod +r $ROOT/usr/local/share/man/man?/*.*
echo Copying license...
cp COPYING $RESOURCES/License.txt
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
echo Creating OSX package...
$PACKAGEMAKER \
--root $ROOT \
--id net.johnmacfarlane.pandoc \
--resources $RESOURCES \
--version $VERSION \
--no-relocate \
--scripts $SCRIPTS \
--out $BASE.pkg
echo Creating disk image...
hdiutil create "$BASE.dmg" \
-format UDZO -ov \
-volname "pandoc $VERSION" \
-srcfolder $BASE.pkg
hdiutil internet-enable "$BASE.dmg"
|