git.iko.soy/typeable/pandoc
on master help sign in
OSX installer improvements.

* Use new pkgbuild, productbuild instead of deprecated PackageMaker. * Removed scripts, which are no longer needed. * Added distribution.xml.

commit2b6e8f4c83e12d5534d7c21a0882a9f4c1e3cb1d authorJohn MacFarlane <jgm@berkeley.edu> dateFri 15 Aug 2014, 00:46 (12 years ago) parenta44650b
4 files changed+44−51
make_osx_package.sh+14−34 osx/distribution.xml+30 osx/osx-resources/InstallationCheck−14 osx/osx-resources/InstallationCheck.strings−3
make_osx_package.sh+14−34
@@ -11,21 +11,17 @@ OSX=osx
1111SCRIPTS=$OSX/osx-resources
1212BASE=pandoc-$VERSION
1313ME=$(whoami)
14−CODESIGNID="3rd Party Mac Developer Application: John Macfarlane"
1514PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
1615EXES="pandoc pandoc-citeproc"
1716CPPHS=$SANDBOX/bin/cpphs
1817
19−read -s -p "sudo password: " PASSWORD
20−echo $PASSWORD | sudo -S echo "Password valid, continuing."
21−
22−echo Removing old files...
18+# echo Removing old files...
2319rm -rf $DIST
2420mkdir -p $RESOURCES
2521
2622cabal sandbox init
27−# echo Updating database
28−# cabal update
23+echo Updating database
24+cabal update
2925
3026echo Building pandoc...
3127cabal clean
@@ -35,6 +31,9 @@ cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags
3531cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags="embed_data_files" pandoc-citeproc --ghc-options "-pgmP$CPPHS -optP--cpp"
3632
3733make man
34+# get pandoc-citeproc man page:
35+PANDOC_CITEPROC_PATH=`cabal unpack -d $DIST pandoc-citeproc | awk '{print $3;}'`
36+cp $PANDOC_CITEPROC_PATH/man/man1/pandoc-citeproc.1 $MANDIR/man1/
3837
3938mkdir -p $DEST/bin
4039mkdir -p $DEST/share/man/man1
@@ -48,42 +47,23 @@ cp $MANDIR/man5/pandoc_markdown.5 $DEST/share/man/man5/
4847chown -R $ME:staff $DIST
4948
5049echo Copying license...
51−$SANDBOX/bin/pandoc --data data -t rtf -s COPYING -o $RESOURCES/License.rtf
50+$SANDBOX/bin/pandoc --data data -t html5 -s COPYING -o $RESOURCES/license.html
5251
5352echo Signing pandoc executable...
5453
55−codesign --force --sign "$CODESIGNID" $DEST/bin/pandoc
54+codesign --force --sign "Developer ID Application: John Macfarlane" $DEST/bin/pandoc
5655# make sure it's valid... returns nonzero exit code if it isn't:
5756spctl --assess --type execute $DEST/bin/pandoc
5857
5958echo Creating OSX package...
6059# remove old package first
61−echo $PASSWORD | sudo -S rm -rf $BASE.pkg $BASE.dmg
62−
63−sudo $PACKAGEMAKER \
64− --root $ROOT \
65− --id net.johnmacfarlane.pandoc \
66− --resources $RESOURCES \
67− --version $VERSION \
68− --scripts $SCRIPTS \
69− --out $BASE.pkg
70−
71− # --no-relocate
60+rm -rf $BASE.pkg
7261
73−echo Signing package...
62+pkgbuild --root $DIST/pandoc --identifier net.johnmacfarlane.pandoc --version 1.13 --ownership recommended $DIST/pandoc.pkg
63+productbuild --distribution osx/distribution.xml --resources $DIST/Resources --package-path $DIST --version 1.13 --sign "Developer ID Installer: John Macfarlane" $BASE.pkg
7464
75−sudo codesign --force --sign "$CODESIGNID" $BASE.pkg
76−# make sure it's valid...
65+# verify signature
7766spctl --assess --type install $BASE.pkg
7867
79−echo Creating zip...
80−zip -9 -r $BASE-osx.zip $BASE.pkg
81−zip -9 -j -r $BASE-osx.zip $OSX/uninstall-pandoc.pl
82−
83−# echo Creating disk image...
84−# sudo hdiutil create "$BASE.dmg" \
85−# -format UDZO -ov \
86−# -volname "pandoc $VERSION" \
87−# -srcfolder $BASE.pkg
88−# sudo hdiutil internet-enable "$BASE.dmg"
89−
68+# cleanup
69+rm -r $DIST
osx/distribution.xmlnew file+30
@@ -0,0 +1,30 @@
1+<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+<installer-gui-script minSpecVersion="1">
3+ <title>pandoc</title>
4+ <organization>net.johnmacfarlane.pandoc</organization>
5+ <domains enable_localSystem="true"/>
6+ <options customize="never" require-scripts="true" rootVolumeOnly="true" />
7+ <!-- Define documents displayed at various steps -->
8+ <!-- <welcome file="welcome.html" mime-type="text/html" /> -->
9+ <license file="license.html" mime-type="text/html" />
10+ <!-- <conclusion file="conclusion.html" mime-type="text/html" /> -->
11+ <options hostArchitectures="x86_64" />
12+ <!-- List all component packages -->
13+ <pkg-ref id="net.johnmacfarlane.pandoc"
14+ version="1.13"
15+ auth="root">pandoc.pkg</pkg-ref>
16+ <!-- List them again here. They can now be organized
17+ as a hierarchy if you want. -->
18+ <choices-outline>
19+ <line choice="net.johnmacfarlane.pandoc"/>
20+ </choices-outline>
21+ <!-- Define each choice above -->
22+ <choice
23+ id="net.johnmacfarlane.pandoc"
24+ visible="false"
25+ title="pandoc"
26+ description="pandoc - universal text converter"
27+ start_selected="true">
28+ <pkg-ref id="net.johnmacfarlane.pandoc"/>
29+ </choice>
30+</installer-gui-script>
osx/osx-resources/InstallationCheckdeleted−14
@@ -1,14 +0,0 @@
1−#!/bin/sh
2−cputype=`/usr/sbin/sysctl -n hw.cputype`
3−sixtyfourbit=`/usr/sbin/sysctl -n hw.cpu64bit_capable`
4−
5−if [ "x$cputype" != "x7" ] # x86
6−then
7− exit 112
8−fi
9−
10−if [ "x$sixtyfourbit" != "x1" ] # 64 bit
11−then
12− exit 113
13−fi
14−
osx/osx-resources/InstallationCheck.stringsdeleted−3
@@ -1,3 +0,0 @@
1−"16" = "This installer works only on Intel Macs.";
2−"17" = "This installer requires a 64-bit processor.";
3−