aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-15 00:46:01 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-15 00:46:01 -0700
commit2b6e8f4c83e12d5534d7c21a0882a9f4c1e3cb1d (patch)
treeca661022fe804cbc7e73053d6e28efe2aeca311c
parenta44650bf97dc4fc7f198abd6bc3028102570d834 (diff)
downloadpandoc-2b6e8f4c83e12d5534d7c21a0882a9f4c1e3cb1d.tar.gz
OSX installer improvements.
* Use new pkgbuild, productbuild instead of deprecated PackageMaker. * Removed scripts, which are no longer needed. * Added distribution.xml.
-rwxr-xr-xmake_osx_package.sh48
-rw-r--r--osx/distribution.xml30
-rwxr-xr-xosx/osx-resources/InstallationCheck14
-rw-r--r--osx/osx-resources/InstallationCheck.strings3
4 files changed, 44 insertions, 51 deletions
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 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<installer-gui-script minSpecVersion="1">
+ <title>pandoc</title>
+ <organization>net.johnmacfarlane.pandoc</organization>
+ <domains enable_localSystem="true"/>
+ <options customize="never" require-scripts="true" rootVolumeOnly="true" />
+ <!-- Define documents displayed at various steps -->
+ <!-- <welcome file="welcome.html" mime-type="text/html" /> -->
+ <license file="license.html" mime-type="text/html" />
+ <!-- <conclusion file="conclusion.html" mime-type="text/html" /> -->
+ <options hostArchitectures="x86_64" />
+ <!-- List all component packages -->
+ <pkg-ref id="net.johnmacfarlane.pandoc"
+ version="1.13"
+ auth="root">pandoc.pkg</pkg-ref>
+ <!-- List them again here. They can now be organized
+ as a hierarchy if you want. -->
+ <choices-outline>
+ <line choice="net.johnmacfarlane.pandoc"/>
+ </choices-outline>
+ <!-- Define each choice above -->
+ <choice
+ id="net.johnmacfarlane.pandoc"
+ visible="false"
+ title="pandoc"
+ description="pandoc - universal text converter"
+ start_selected="true">
+ <pkg-ref id="net.johnmacfarlane.pandoc"/>
+ </choice>
+</installer-gui-script>
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.";
-