path: root/
diff options
authorJohn MacFarlane <>2014-08-15 00:46:01 -0700
committerJohn MacFarlane <>2014-08-15 00:46:01 -0700
commit2b6e8f4c83e12d5534d7c21a0882a9f4c1e3cb1d (patch)
treeca661022fe804cbc7e73053d6e28efe2aeca311c /
parenta44650bf97dc4fc7f198abd6bc3028102570d834 (diff)
OSX installer improvements.
* Use new pkgbuild, productbuild instead of deprecated PackageMaker. * Removed scripts, which are no longer needed. * Added distribution.xml.
Diffstat (limited to '')
1 files changed, 14 insertions, 34 deletions
diff --git a/ b/
index 1b977a6e4..c1e1f4ac1 100755
--- a/
+++ b/
@@ -11,21 +11,17 @@ OSX=osx
-CODESIGNID="3rd Party Mac Developer Application: John Macfarlane"
EXES="pandoc pandoc-citeproc"
-read -s -p "sudo password: " PASSWORD
-echo $PASSWORD | sudo -S echo "Password valid, continuing."
-echo Removing old files...
+# echo Removing old files...
rm -rf $DIST
mkdir -p $RESOURCES
cabal sandbox init
-# echo Updating database
-# cabal update
+echo Updating database
+cabal update
echo Building pandoc...
cabal clean
@@ -35,6 +31,9 @@ cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags
cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags="embed_data_files" pandoc-citeproc --ghc-options "-pgmP$CPPHS -optP--cpp"
make man
+# get pandoc-citeproc man page:
+PANDOC_CITEPROC_PATH=`cabal unpack -d $DIST pandoc-citeproc | awk '{print $3;}'`
+cp $PANDOC_CITEPROC_PATH/man/man1/pandoc-citeproc.1 $MANDIR/man1/
mkdir -p $DEST/bin
mkdir -p $DEST/share/man/man1
@@ -48,42 +47,23 @@ cp $MANDIR/man5/pandoc_markdown.5 $DEST/share/man/man5/
chown -R $ME:staff $DIST
echo Copying license...
-$SANDBOX/bin/pandoc --data data -t rtf -s COPYING -o $RESOURCES/License.rtf
+$SANDBOX/bin/pandoc --data data -t html5 -s COPYING -o $RESOURCES/license.html
echo Signing pandoc executable...
-codesign --force --sign "$CODESIGNID" $DEST/bin/pandoc
+codesign --force --sign "Developer ID Application: John Macfarlane" $DEST/bin/pandoc
# make sure it's valid... returns nonzero exit code if it isn't:
spctl --assess --type execute $DEST/bin/pandoc
echo Creating OSX package...
# remove old package first
-echo $PASSWORD | sudo -S rm -rf $BASE.pkg $BASE.dmg
- --root $ROOT \
- --id net.johnmacfarlane.pandoc \
- --resources $RESOURCES \
- --version $VERSION \
- --scripts $SCRIPTS \
- --out $BASE.pkg
- # --no-relocate
+rm -rf $BASE.pkg
-echo Signing package...
+pkgbuild --root $DIST/pandoc --identifier net.johnmacfarlane.pandoc --version 1.13 --ownership recommended $DIST/pandoc.pkg
+productbuild --distribution osx/distribution.xml --resources $DIST/Resources --package-path $DIST --version 1.13 --sign "Developer ID Installer: John Macfarlane" $BASE.pkg
-sudo codesign --force --sign "$CODESIGNID" $BASE.pkg
-# make sure it's valid...
+# verify signature
spctl --assess --type install $BASE.pkg
-echo Creating zip...
-zip -9 -r $ $BASE.pkg
-zip -9 -j -r $ $OSX/
-# echo Creating disk image...
-# sudo hdiutil create "$BASE.dmg" \
-# -format UDZO -ov \
-# -volname "pandoc $VERSION" \
-# -srcfolder $BASE.pkg
-# sudo hdiutil internet-enable "$BASE.dmg"
+# cleanup
+rm -r $DIST