forked from FreeFem/FreeFem-sources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install-MacOS.command
executable file
·48 lines (43 loc) · 1.45 KB
/
Install-MacOS.command
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
#!/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 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 "/Users/hecht/ff++-3.0-2" ] ;then
echo Warning "/Users/hecht/ff++-3.0-2" is a dirctory keep this.
else
rm -f "/Users/hecht/ff++-3.0-2"
ln -s /FreeFem++.app/Contents/ '/Users/hecht/ff++-3.0-2"
fi
echo "++ FreeFem++ is correctly install in $appl directory."
echo " install in /usr/local/bin: $lbin "
echo " Thanks for using FreeFem++ v3 "