2003-02-24 09:15:12 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
2003-02-24 09:15:12 -08:00
|
|
|
# #
|
|
|
|
# Damien Doligez, projet Moscova, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 2003 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
|
|
|
# under the terms of the Q Public License version 1.0. #
|
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
cd package-macosx
|
2004-04-22 08:48:36 -07:00
|
|
|
rm -rf ocaml.pkg ocaml-rw.dmg
|
|
|
|
|
2010-05-21 04:28:21 -07:00
|
|
|
VERSION=`sed -e 1q ../VERSION`
|
2008-01-11 08:13:18 -08:00
|
|
|
VERSION_MAJOR=`sed -n -e '1s/^\([0-9]*\)\..*/\1/p' ../VERSION`
|
|
|
|
VERSION_MINOR=`sed -n -e '1s/^[0-9]*\.\([0-9]*\)[.+].*/\1/p' ../VERSION`
|
2003-02-24 09:15:12 -08:00
|
|
|
|
2004-04-21 16:21:02 -07:00
|
|
|
cat >Description.plist <<EOF
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
|
|
|
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>IFPkgDescriptionDeleteWarning</key>
|
|
|
|
<string></string>
|
|
|
|
<key>IFPkgDescriptionDescription</key>
|
2011-07-27 07:17:02 -07:00
|
|
|
<string>The OCaml compiler and tools</string>
|
2004-04-21 16:21:02 -07:00
|
|
|
<key>IFPkgDescriptionTitle</key>
|
2011-07-27 07:17:02 -07:00
|
|
|
<string>OCaml</string>
|
2004-04-21 16:21:02 -07:00
|
|
|
<key>IFPkgDescriptionVersion</key>
|
|
|
|
<string>${VERSION}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >Info.plist <<EOF
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
|
|
|
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>CFBundleGetInfoString</key>
|
2011-07-27 07:17:02 -07:00
|
|
|
<string>OCaml ${VERSION}</string>
|
2004-04-21 16:21:02 -07:00
|
|
|
<key>CFBundleIdentifier</key>
|
|
|
|
<string>fr.inria.ocaml</string>
|
|
|
|
<key>CFBundleName</key>
|
2011-07-27 07:17:02 -07:00
|
|
|
<string>OCaml</string>
|
2004-04-21 16:21:02 -07:00
|
|
|
<key>CFBundleShortVersionString</key>
|
|
|
|
<string>${VERSION}</string>
|
|
|
|
<key>IFMajorVersion</key>
|
|
|
|
<integer>${VERSION_MAJOR}</integer>
|
|
|
|
<key>IFMinorVersion</key>
|
|
|
|
<integer>${VERSION_MINOR}</integer>
|
|
|
|
<key>IFPkgFlagAllowBackRev</key>
|
|
|
|
<true/>
|
|
|
|
<key>IFPkgFlagAuthorizationAction</key>
|
|
|
|
<string>AdminAuthorization</string>
|
|
|
|
<key>IFPkgFlagDefaultLocation</key>
|
2005-03-24 09:20:54 -08:00
|
|
|
<string>/usr/local</string>
|
2004-04-21 16:21:02 -07:00
|
|
|
<key>IFPkgFlagInstallFat</key>
|
|
|
|
<false/>
|
|
|
|
<key>IFPkgFlagIsRequired</key>
|
|
|
|
<false/>
|
|
|
|
<key>IFPkgFlagRelocatable</key>
|
|
|
|
<false/>
|
|
|
|
<key>IFPkgFlagRestartAction</key>
|
|
|
|
<string>NoRestart</string>
|
|
|
|
<key>IFPkgFlagRootVolumeOnly</key>
|
|
|
|
<true/>
|
|
|
|
<key>IFPkgFlagUpdateInstalledLanguages</key>
|
|
|
|
<false/>
|
|
|
|
<key>IFPkgFormatVersion</key>
|
|
|
|
<real>0.10000000149011612</real>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOF
|
|
|
|
|
|
|
|
mkdir -p resources
|
|
|
|
|
2004-04-22 08:48:36 -07:00
|
|
|
# stop here -> |
|
|
|
|
cat >resources/ReadMe.txt <<EOF
|
2011-07-27 07:17:02 -07:00
|
|
|
This package installs OCaml version ${VERSION}.
|
2012-07-26 12:21:54 -07:00
|
|
|
You need Mac OS X 10.7.x (Lion), with the
|
|
|
|
XCode tools installed (v3.2.6 or later).
|
2005-08-13 13:59:37 -07:00
|
|
|
|
|
|
|
Files will be installed in the following directories:
|
|
|
|
|
|
|
|
/usr/local/bin - command-line executables
|
|
|
|
/usr/local/lib/ocaml - library and support files
|
|
|
|
/usr/local/man - manual pages
|
2012-07-26 12:21:54 -07:00
|
|
|
|
|
|
|
Note that this package installs only command-line
|
|
|
|
tools and does not include any GUI application.
|
2004-04-22 08:48:36 -07:00
|
|
|
EOF
|
|
|
|
|
2005-03-24 09:20:54 -08:00
|
|
|
chmod -R g-w root
|
2008-02-29 06:21:22 -08:00
|
|
|
sudo chown -R root:wheel root
|
2005-03-24 09:20:54 -08:00
|
|
|
|
2004-04-19 09:47:13 -07:00
|
|
|
/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker \
|
2004-04-21 16:21:02 -07:00
|
|
|
-build -p "`pwd`/ocaml.pkg" -f "`pwd`/root" -i "`pwd`/Info.plist" \
|
|
|
|
-d "`pwd`/Description.plist" -r "`pwd`/resources"
|
2003-02-24 09:15:12 -08:00
|
|
|
|
|
|
|
size=`du -s ocaml.pkg | cut -f 1`
|
2003-02-24 10:36:16 -08:00
|
|
|
size=`expr $size + 8192`
|
2003-02-24 09:15:12 -08:00
|
|
|
|
2003-02-24 10:36:16 -08:00
|
|
|
hdiutil create -sectors $size ocaml-rw.dmg
|
|
|
|
name=`hdid -nomount ocaml-rw.dmg | grep Apple_HFS | cut -d ' ' -f 1`
|
2011-07-27 07:17:02 -07:00
|
|
|
volname="OCaml ${VERSION}"
|
2008-02-29 06:21:22 -08:00
|
|
|
newfs_hfs -v "$volname" $name
|
2003-02-24 09:15:12 -08:00
|
|
|
hdiutil detach $name
|
|
|
|
|
2003-02-24 10:36:16 -08:00
|
|
|
name=`hdid ocaml-rw.dmg | grep Apple_HFS | cut -d ' ' -f 1`
|
2008-02-29 06:21:22 -08:00
|
|
|
if test -d "/Volumes/$volname"; then
|
|
|
|
ditto -rsrcFork ocaml.pkg "/Volumes/$volname/ocaml.pkg"
|
|
|
|
cp resources/ReadMe.txt "/Volumes/$volname/"
|
2003-02-24 10:36:16 -08:00
|
|
|
else
|
2008-02-29 06:21:22 -08:00
|
|
|
echo "Unable to mount the disk image as \"/Volumes/$volname\"" >&2
|
2003-02-24 10:36:16 -08:00
|
|
|
exit 3
|
|
|
|
fi
|
2008-02-29 06:21:22 -08:00
|
|
|
open "/Volumes/$volname"
|
|
|
|
sleep 2
|
2003-02-24 09:15:12 -08:00
|
|
|
hdiutil detach $name
|
2003-02-24 10:36:16 -08:00
|
|
|
|
2004-04-29 05:16:58 -07:00
|
|
|
rm -rf "ocaml-${VERSION}.dmg"
|
2005-03-24 09:20:54 -08:00
|
|
|
hdiutil convert ocaml-rw.dmg -format UDZO -o "ocaml-${VERSION}.dmg"
|