forked from MLstate/opalang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postflight
42 lines (28 loc) · 1.3 KB
/
postflight
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh -e
#
# MacOS X version
#
MLSTATELIBS=/opt/mlstate
PREFIX=/usr/local
sudo mkdir -p $PREFIX/bin
sudo mkdir -p $PREFIX/share/man/man1
DEST_EMACS=/Library/Application\ Support/Emacs/site-lisp/opa-mode
logger -t "OPA" "Postflight starting"
#logger -t "OPA" "Creating shortcut"
logger -t "OPA" "Installing opa shortcuts and manpages"
$MLSTATELIBS/share/opa/install.sh --dir $MLSTATELIBS --ocaml-prefix $MLSTATELIBS --link $PREFIX/bin
logger -t "OPA" "Add symbolic links from '$PREFIX/bin' to '$MLSTATELIBS/bin'"
ls $MLSTATELIBS/bin | while read x; do
sudo ln -s $MLSTATELIBS/bin/$x $PREFIX/bin/$x || logger -t "OPA" " -- link $PREFIX/bin/$x could not be created."
done
logger -t "OPA" "Add symbolic links from '$PREFIX/share/man/man1' to '$MLSTATELIBS/share/man/man1'"
ls $MLSTATELIBS/share/man/man1 | while read x; do
sudo ln -s $MLSTATELIBS/share/man/man1/$x $PREFIX/share/man/man1/$x || logger -t "OPA" " -- link $PREFIX/share/man/man1/$x could not be created."
done
logger -t "OPA" "Installing Emacs plug-in"
sudo mkdir -p "$DEST_EMACS"
sudo install $MLSTATELIBS/share/opa/emacs/opa-mode.el "$DEST_EMACS/"
sudo install $MLSTATELIBS/share/opa/emacs/site-start.el "$DEST_EMACS/"
logger -t "OPA" "Set ownership to 'root'"
sudo chown -f -R root:wheel $MLSTATELIBS
logger -t "OPA" "Postflight complete"