git.iko.soy/typeable/pandoc
on master help sign in
OSX installer improvements.
2b6e8f4John MacFarlane
make_osx_package.sh+14−34
@@ -11,21 +11,17 @@ OSX=osx
11SCRIPTS=$OSX/osx-resources
11SCRIPTS=$OSX/osx-resources
12BASE=pandoc-$VERSION
12BASE=pandoc-$VERSION
13ME=$(whoami)
13ME=$(whoami)
14−CODESIGNID="3rd Party Mac Developer Application: John Macfarlane"
15PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
14PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
16EXES="pandoc pandoc-citeproc"
15EXES="pandoc pandoc-citeproc"
17CPPHS=$SANDBOX/bin/cpphs
16CPPHS=$SANDBOX/bin/cpphs
18
17
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...
23rm -rf $DIST
19rm -rf $DIST
24mkdir -p $RESOURCES
20mkdir -p $RESOURCES
25
21
26cabal sandbox init
22cabal sandbox init
27−# echo Updating database
23+echo Updating database
28−# cabal update
24+cabal update
29
25
30echo Building pandoc...
26echo Building pandoc...
31cabal clean
27cabal clean
@@ -35,6 +31,9 @@ cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags
35cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags="embed_data_files" pandoc-citeproc --ghc-options "-pgmP$CPPHS -optP--cpp"
31cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags="embed_data_files" pandoc-citeproc --ghc-options "-pgmP$CPPHS -optP--cpp"
36
32
37make man
33make 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/
38
37
39mkdir -p $DEST/bin
38mkdir -p $DEST/bin
40mkdir -p $DEST/share/man/man1
39mkdir -p $DEST/share/man/man1
@@ -48,42 +47,23 @@ cp $MANDIR/man5/pandoc_markdown.5 $DEST/share/man/man5/
48chown -R $ME:staff $DIST
47chown -R $ME:staff $DIST
49
48
50echo Copying license...
49echo 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
52
51
53echo Signing pandoc executable...
52echo Signing pandoc executable...
54
53
55−codesign --force --sign "$CODESIGNID" $DEST/bin/pandoc
54+codesign --force --sign "Developer ID Application: John Macfarlane" $DEST/bin/pandoc
56# make sure it's valid... returns nonzero exit code if it isn't:
55# make sure it's valid... returns nonzero exit code if it isn't:
57spctl --assess --type execute $DEST/bin/pandoc
56spctl --assess --type execute $DEST/bin/pandoc
58
57
59echo Creating OSX package...
58echo Creating OSX package...
60# remove old package first
59# remove old package first
61−echo $PASSWORD | sudo -S rm -rf $BASE.pkg $BASE.dmg
60+rm -rf $BASE.pkg
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
72
61
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
74
64
75−sudo codesign --force --sign "$CODESIGNID" $BASE.pkg
65+# verify signature
76−# make sure it's valid...
77spctl --assess --type install $BASE.pkg
66spctl --assess --type install $BASE.pkg
78
67
79−echo Creating zip...
68+# cleanup
80−zip -9 -r $BASE-osx.zip $BASE.pkg
69+rm -r $DIST
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−
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−