forked from FreeFem/FreeFem-sources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install-MacOS.command.in
50 lines (45 loc) · 1.54 KB
/
Install-MacOS.command.in
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
43
44
45
46
47
48
49
50
#!/bin/sh
appl=/Applications
cd `dirname $0`
echo "Installtion of Freefem++ "
if [ -f OtherMacOsLib.tgz ]; then
for i in `tar ztf OtherMacOsLib.tgz`; do
if [ ! -f "/$i" ]; then
echo " the Libary '/$i' don't exist => install (need of admin password)"
sudo tar zxvf OtherMacOsLib.tgz -C / $i
else
echo " the Libary '/$i' exist "
fi
done
# verif ....
for i in `tar ztf OtherMacOsLib.tgz`; do
if [ ! -f "/$i" ]; then
echo " the Libary '/$i' don't exist FreeFEM cannot run (call you adminisator sorry)"
echo "Sorry"
exit 1;
fi
done
fi
echo " copy FreeFem++.app in "$appl" "
if [ -d FreeFem++.app ] ; then
rsync -avHE --delete FreeFem++.app/ "$appl"/FreeFem++.app
fi
lbin=`cd "$appl"/FreeFem++.app/Contents/bin/; echo *`
echo " install $lbin commands in /usr/local/bin (need of admin password)"
sudo mkdir -p /usr/local/bin
sudo mkdir -p `dirname @ff_prefix_dir@`
sudo ln -s "$appl"/FreeFem++.app/Contents/bin/* /usr/local/bin
sudo rm /usr/local/bin/ff-c++
sudo sed <"$appl"/FreeFem++.app/Contents/bin/ff-c++ >/usr/local/bin/ff-c++ \
-e 's;FFAPPLI_INC;$app/FreeFem++.app/Contents/include;'
chmod a+rx /usr/local/bin/ff-c++
if [ -d "@ff_prefix_dir@" ] ; then
echo Warning "@ff_prefix_dir@" is a dirctory keep this.
else
sudo rm -f "@ff_prefix_dir@"
sudo ln -s "$appl/FreeFem++.app/Contents" "@ff_prefix_dir@"
echo link "@ff_prefix_dir@ -> $appl/FreeFem++.app/Contents/ "
fi
echo "++ FreeFem++ is correctly install in $appl directory."
echo " install in /usr/local/bin: $lbin "
echo " Thanks for using FreeFem++ v3 "