2011-07-28 20:41:00 +02:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2012-03-09 21:37:29 +01:00
|
|
|
DIST=osx_package
|
2011-07-28 20:41:00 +02:00
|
|
|
VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
|
|
|
|
RESOURCES=$DIST/Resources
|
2011-07-29 01:38:56 +02:00
|
|
|
ROOT=$DIST/pandoc
|
2012-03-09 22:07:26 +01:00
|
|
|
SCRIPTS=osx-resources
|
2011-07-28 20:41:00 +02:00
|
|
|
BASE=pandoc-$VERSION
|
2011-10-27 03:28:15 +02:00
|
|
|
ME=jgm
|
2011-07-28 20:41:00 +02:00
|
|
|
|
|
|
|
echo Removing old files...
|
|
|
|
rm -rf $DIST
|
|
|
|
mkdir -p $RESOURCES
|
|
|
|
|
|
|
|
echo Building pandoc...
|
2011-10-27 03:28:15 +02:00
|
|
|
sudo cabal-dev install-deps
|
2012-03-09 23:23:06 +01:00
|
|
|
sudo cabal-dev install --flags="embed_data_files" citeproc-hs
|
2011-10-27 03:28:15 +02:00
|
|
|
sudo cabal-dev install --disable-library-for-ghci highlighting-kate
|
2012-05-12 19:19:01 +02:00
|
|
|
sudo cabal-dev install --prefix=/usr/local --datasubdir=$BASE --docdir=/usr/local/doc/$BASE --flags="executable blaze_html_0_5 -library"
|
2011-10-27 03:28:15 +02:00
|
|
|
sudo cabal-dev copy --destdir=$ROOT
|
|
|
|
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?/*.*
|
2011-07-28 20:41:00 +02:00
|
|
|
|
2011-07-29 01:38:56 +02:00
|
|
|
echo Copying license...
|
2011-07-28 20:41:00 +02:00
|
|
|
cp COPYING $RESOURCES/License.txt
|
|
|
|
|
|
|
|
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
|
|
|
|
|
|
|
echo Creating OSX package...
|
|
|
|
|
|
|
|
$PACKAGEMAKER \
|
2011-07-29 01:38:56 +02:00
|
|
|
--root $ROOT \
|
|
|
|
--id net.johnmacfarlane.pandoc \
|
|
|
|
--resources $RESOURCES \
|
|
|
|
--version $VERSION \
|
2011-07-28 20:41:00 +02:00
|
|
|
--no-relocate \
|
2012-03-09 22:07:26 +01:00
|
|
|
--scripts $SCRIPTS \
|
2011-07-28 20:41:00 +02:00
|
|
|
--out $BASE.pkg
|
|
|
|
|
|
|
|
echo Creating disk image...
|
|
|
|
|
|
|
|
hdiutil create "$BASE.dmg" \
|
|
|
|
-format UDZO -ov \
|
|
|
|
-volname "pandoc $VERSION" \
|
|
|
|
-srcfolder $BASE.pkg
|
2011-07-29 01:38:56 +02:00
|
|
|
hdiutil internet-enable "$BASE.dmg"
|
2011-07-28 20:41:00 +02:00
|
|
|
|