From 2b6e8f4c83e12d5534d7c21a0882a9f4c1e3cb1d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 15 Aug 2014 00:46:01 -0700 Subject: OSX installer improvements. * Use new pkgbuild, productbuild instead of deprecated PackageMaker. * Removed scripts, which are no longer needed. * Added distribution.xml. --- make_osx_package.sh | 48 +++++++++-------------------- osx/distribution.xml | 30 ++++++++++++++++++ osx/osx-resources/InstallationCheck | 14 --------- osx/osx-resources/InstallationCheck.strings | 3 -- 4 files changed, 44 insertions(+), 51 deletions(-) create mode 100644 osx/distribution.xml delete mode 100755 osx/osx-resources/InstallationCheck delete mode 100644 osx/osx-resources/InstallationCheck.strings diff --git a/make_osx_package.sh b/make_osx_package.sh index 1b977a6e4..c1e1f4ac1 100755 --- a/make_osx_package.sh +++ b/make_osx_package.sh @@ -11,21 +11,17 @@ OSX=osx SCRIPTS=$OSX/osx-resources BASE=pandoc-$VERSION ME=$(whoami) -CODESIGNID="3rd Party Mac Developer Application: John Macfarlane" PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker EXES="pandoc pandoc-citeproc" CPPHS=$SANDBOX/bin/cpphs -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 - -sudo $PACKAGEMAKER \ - --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-osx.zip $BASE.pkg -zip -9 -j -r $BASE-osx.zip $OSX/uninstall-pandoc.pl - -# 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 diff --git a/osx/distribution.xml b/osx/distribution.xml new file mode 100644 index 000000000..024a25bd1 --- /dev/null +++ b/osx/distribution.xml @@ -0,0 +1,30 @@ + + + pandoc + net.johnmacfarlane.pandoc + + + + + + + + + pandoc.pkg + + + + + + + + + diff --git a/osx/osx-resources/InstallationCheck b/osx/osx-resources/InstallationCheck deleted file mode 100755 index 2bd691f5c..000000000 --- a/osx/osx-resources/InstallationCheck +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -cputype=`/usr/sbin/sysctl -n hw.cputype` -sixtyfourbit=`/usr/sbin/sysctl -n hw.cpu64bit_capable` - -if [ "x$cputype" != "x7" ] # x86 -then - exit 112 -fi - -if [ "x$sixtyfourbit" != "x1" ] # 64 bit -then - exit 113 -fi - diff --git a/osx/osx-resources/InstallationCheck.strings b/osx/osx-resources/InstallationCheck.strings deleted file mode 100644 index 6c8efe0d4..000000000 --- a/osx/osx-resources/InstallationCheck.strings +++ /dev/null @@ -1,3 +0,0 @@ -"16" = "This installer works only on Intel Macs."; -"17" = "This installer requires a 64-bit processor."; - -- cgit v1.2.3