Commit 8203e6b4 authored by Pietro Abate's avatar Pietro Abate

- add scripts to create the macosx package

- add --libdir to configure.ml to install cduce libraries in custom locations
parent 18a7468a
......@@ -28,16 +28,15 @@ following packages:
ocaml >= 3.10
http://caml.inria.fr/ocaml/distrib.html
findlib >= 1.0.3
findlib >= 1.0.3
http://www.ocaml-programming.de/packages
ulex >= 1.0
http://www.cduce.org/download
pcre-ocaml >= 5.03
http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html
http://www.cduce.org/download.html
pcre-ocaml >= 5.13.0
http://ocaml.info/home/ocaml_sources.html#toc16
ocamlnet >= 0.98
http://www.ocaml-programming.de/packages
Additional optional packages:
-----------------------------
......
include VERSION
.PHONY: package-macosx
package-macosx:
mkdir -p package-macosx/root
sh configure --prefix=`pwd`/package-macosx/root
make install
export VERSION=$(VERSION) && tools/make-package-macosx
clean-macosx:
sudo rm -rf package-macosx
......@@ -59,7 +59,11 @@ endif
ifeq ($(INTERFACE), true)
OPT += -passopt -i
endif
OCAMLFIND = ocamlfind
ifeq ($(LIBDIR), false)
OCAMLFIND = ocamlfind
else
OCAMLFIND = ocamlfind -destdir $(LIBDIR)
endif
CAMLC = $(OCAMLFIND) $(CAMLC_P) $(OPT) -package "$(PACKAGES)"
CAMLOPT = $(OCAMLFIND) $(CAMLOPT_P) $(OPT) -package "$(PACKAGES)"
......
......@@ -37,6 +37,7 @@ OCaml/CDuce interface:
Installation directories:
--prefix=PREFIX install files in PREFIX [/usr/local]
--bindir=DIR install user executables in DIR [PREFIX/bin]
--libdir=DIR install man documentation in DIR [ocamlfind printconf destdir]
--mandir=DIR install man documentation in DIR [PREFIX/man]
--docdir=DIR install the rest of the doc in DIR [PREFIX/doc/cduce]
";
......@@ -61,6 +62,7 @@ let features =
let vars =
[ "prefix", ref "/usr/local";
"bindir", ref "";
"libdir", ref "";
"mandir", ref "";
"docdir", ref "";
......@@ -216,6 +218,7 @@ let pxp_wlex = check_feature "pxp_wlex" (check_pkg "pxp-wlex-utf8")
let prefix = dir "prefix"
let bindir = dir ~def:(prefix^"/bin") "bindir"
let mandir = dir ~def:(prefix^"/man") "mandir"
let libdir = dir ~def:("false") "libdir"
let docdir = dir ~def:(prefix^"/doc/cduce") "docdir"
let wprefix = dir "wprefix"
let cgidir = dir ~def:(wprefix^"/cgi-bin") "cgidir"
......@@ -291,6 +294,7 @@ let () =
fprintf out "CGI=%b\n" cgi;
fprintf out "PXP_WLEX=%b\n" pxp_wlex;
fprintf out "BINDIR=%s\n" bindir;
fprintf out "LIBDIR=%s\n" libdir;
fprintf out "MANDIR=%s\n" mandir;
fprintf out "DOCDIR=%s\n" docdir;
fprintf out "CGI_DIR=%s\n" cgidir;
......
#!/bin/sh
# Shell script from Pietro Abate <pietro.abate@anu.edu.au> to create
# Mac OS X packages. Call from Makefile by "make package-macosx".
#########################################################################
# #
# 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: make-package-macosx,v 1.10.2.2 2006/01/04 13:05:49 doligez Exp $
# adapted to cduce by Pietro.Abate <pietro.abate@anu.edu.au>
set -x
cd package-macosx
rm -rf cduce.pkg cduce-rw.dmg
mkdir -p resources
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>Cduce</string>
<key>IFPkgDescriptionTitle</key>
<string>Cduce</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>cduce ${VERSION}</string>
<key>CFBundleIdentifier</key>
<string>http://www.cduce.org</string>
<key>CFBundleName</key>
<string>Cduce</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>IFPkgFlagAllowBackRev</key>
<true/>
<key>IFPkgFlagAuthorizationAction</key>
<string>AdminAuthorization</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/</string>
<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
# stop here -> |
cat >resources/ReadMe.txt <<EOF
This package installs The cduce library manager ${VERSION}.
You need Mac OS X 10.4.x (Tiger).
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
EOF
chmod -R g-w root
#sudo chown -R root:admin root
/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker \
-build -p "`pwd`/cduce.pkg" -f "`pwd`/root" -i "`pwd`/Info.plist" \
-d "`pwd`/Description.plist" -r "`pwd`/resources"
size=`du -s cduce.pkg | cut -f 1`
size=`expr $size + 8192`
hdiutil create -sectors $size cduce-rw.dmg
name=`hdid -nomount cduce-rw.dmg | grep Apple_HFS | cut -d ' ' -f 1`
newfs_hfs -v 'Cduce' $name
hdiutil detach $name
name=`hdid cduce-rw.dmg | grep Apple_HFS | cut -d ' ' -f 1`
if test -d '/Volumes/Cduce'; then
ditto -rsrcFork cduce.pkg "/Volumes/Cduce/cduce.pkg"
cp resources/ReadMe.txt "/Volumes/Cduce/"
else
echo 'Unable to mount the disk image as "/Volumes/Cduce"' >&2
exit 3
fi
open "/Volumes/Cduce"
hdiutil detach $name
rm -rf "cduce-${VERSION}.dmg"
hdiutil convert cduce-rw.dmg -format UDZO -o "cduce-${VERSION}.dmg"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment