2003-02-24 09:15:12 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
# #
|
|
|
|
# Objective Caml #
|
|
|
|
# #
|
|
|
|
# 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
|
|
|
|
|
|
|
|
VERSION=`sed -n -e '/ocaml_version/s/.*"\([^"]*\)".*/\1/p' ../stdlib/sys.ml`
|
|
|
|
VERSION_MAJOR=`sed -n -e '/ocaml_version/s/.*"\([0-9]*\)\..*/\1/p' \
|
|
|
|
../stdlib/sys.ml`
|
|
|
|
VERSION_MINOR=`sed -n -e '/ocaml_version/s/.*"[0-9]*\.\([0-9]*\)[.+].*/\1/p' \
|
|
|
|
../stdlib/sys.ml`
|
2003-02-24 09:15:12 -08:00
|
|
|
|
2004-04-19 09:47:13 -07:00
|
|
|
# Worked in 10.2:
|
2004-04-21 16:21:02 -07:00
|
|
|
|
|
|
|
# cat >ocaml.info <<EOF
|
|
|
|
# Title Objective Caml
|
2004-04-22 08:48:36 -07:00
|
|
|
# Version ${VERSION}
|
|
|
|
# Description This package installs Objective Caml version ${VERSION}
|
2004-04-21 16:21:02 -07:00
|
|
|
# DefaultLocation /
|
|
|
|
# Relocatable no
|
|
|
|
# NeedsAuthorization yes
|
|
|
|
# Application no
|
|
|
|
# InstallOnly no
|
|
|
|
# DisableStop no
|
|
|
|
# EOF
|
2004-04-19 09:47:13 -07:00
|
|
|
#package root ocaml.info
|
|
|
|
|
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>
|
|
|
|
<string>The Objective Caml compiler and tools</string>
|
|
|
|
<key>IFPkgDescriptionTitle</key>
|
|
|
|
<string>Objective Caml</string>
|
|
|
|
<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>
|
|
|
|
<string>Objective Caml ${VERSION}</string>
|
|
|
|
<key>CFBundleIdentifier</key>
|
|
|
|
<string>fr.inria.ocaml</string>
|
|
|
|
<key>CFBundleName</key>
|
|
|
|
<string>Objective Caml</string>
|
|
|
|
<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
|
|
|
|
This package installs Objective Caml version ${VERSION}.
|
2006-01-04 08:55:50 -08:00
|
|
|
You need Mac OS X 10.4.x (Tiger), with X11 and the
|
|
|
|
XCode tools (v2.2) installed.
|
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
|
2004-04-22 08:48:36 -07:00
|
|
|
EOF
|
|
|
|
|
2005-03-24 09:20:54 -08:00
|
|
|
chmod -R g-w root
|
|
|
|
sudo chown -R root:admin root
|
|
|
|
|
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`
|
2003-02-24 09:15:12 -08:00
|
|
|
newfs_hfs -v 'Objective Caml' $name
|
|
|
|
hdiutil detach $name
|
|
|
|
|
2003-02-24 10:36:16 -08:00
|
|
|
name=`hdid ocaml-rw.dmg | grep Apple_HFS | cut -d ' ' -f 1`
|
|
|
|
if test -d '/Volumes/Objective Caml'; then
|
|
|
|
ditto -rsrcFork ocaml.pkg "/Volumes/Objective Caml/ocaml.pkg"
|
2004-04-22 08:48:36 -07:00
|
|
|
cp resources/ReadMe.txt "/Volumes/Objective Caml/"
|
2003-02-24 10:36:16 -08:00
|
|
|
else
|
|
|
|
echo 'Unable to mount the disk image as "/Volumes/Objective Caml"' >&2
|
|
|
|
exit 3
|
|
|
|
fi
|
2003-03-12 08:35:22 -08:00
|
|
|
open "/Volumes/Objective Caml"
|
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"
|