pandoc/make_osx_package.sh

51 lines
1.3 KiB
Bash
Raw Normal View History

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
ROOT=$DIST/pandoc
SCRIPTS=osx-resources
2011-07-28 20:41:00 +02:00
BASE=pandoc-$VERSION
ME=jgm
2011-07-28 20:41:00 +02:00
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
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"
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
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 \
--root $ROOT \
--id net.johnmacfarlane.pandoc \
--resources $RESOURCES \
--version $VERSION \
2011-07-28 20:41:00 +02:00
--no-relocate \
--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
hdiutil internet-enable "$BASE.dmg"
2011-07-28 20:41:00 +02:00