Statistiques
| Révision :

root / tmp / org.txm.setups / shared / mac / INSTALL @ 2072

Historique | Voir | Annoter | Télécharger (2,96 ko)

1
#!/bin/sh
2

    
3
VERSION="-TXMVERSION"
4

    
5
# messages en and fr
6
SAY_STARTINSTALL_EN="starting post installation"
7
SAY_INSTALLR_EN="installing R and R dependancies"
8
SAY_CREATESTAMP_EN="creating STAMP"
9
SAY_SETFILERIGHTS_EN="setting file rights"
10
SAY_DONE_EN="Done"
11

    
12
SAY_STARTINSTALL_FR="Début de la post-installation de TXM"
13
SAY_INSTALLR_FR="Installation de R et ses dépendances"
14
SAY_CREATESTAMP_FR="Création du fichier STAMP"
15
SAY_SETFILERIGHTS_FR="Réglage des droits de fichiers"
16
SAY_DONE_FR="Installation terminée"
17

    
18
	SAY_STARTINSTALL=$SAY_STARTINSTALL_EN
19
	SAY_INSTALLR=$SAY_INSTALLR_EN
20
	SAY_CREATESTAMP=$SAY_CREATESTAMP_EN
21
	SAY_SETFILERIGHTS=$SAY_SETFILERIGHTS_EN
22
	SAY_DONE=$SAY_DONE_EN
23

    
24

    
25
say $SAY_STARTINSTALL
26
echo "** TXM postinstall: start post installation"
27
TXMINSTALLDIR="/Applications/TXM${VERSION}.app"
28

    
29
# remove "try(library(textometrieR))" from .Rprofile if any
30
if [ -f "$HOME/.Rprofile" ]; then
31
	echo "Removing 'try(library(textometrieR))' from old .Rprofile"
32
	sed "s/try(library(textometrieR))//g" "$HOME/.Rprofile" > "$HOME/.Rprofile2" &&
33
	mv -f "$HOME/.Rprofile2" "$HOME/.Rprofile"
34
	if [ $? != 0 ];then
35
		echo "** TXM postinstall: failed to fix old '.Rprofile' file."
36
		exit 1
37
	fi
38
fi
39

    
40
say $SAY_INSTALLR
41
if [ ! -d "/usr/local/lib/tcl8" ]; then
42
	installer -pkg "$TXMINSTALLDIR/Contents/TXM/R/tcltk-8.5.5-x11.pkg" -allowUntrusted -target /
43
	if [ $? != 0 ]; then
44
		echo "** TXM install: installation of tcltk failed. Aborting."
45
		exit 1
46
	fi
47
else 
48
	echo "Skipping tcl8 installation"
49
fi
50

    
51
if [ ! -d "/usr/local/share/texinfo" ]; then
52
	installer -pkg "$TXMINSTALLDIR/Contents/TXM/R/texinfo-6.1-0.pkg" -allowUntrusted -target /
53
	if [ $? != 0 ]; then
54
		echo "** TXM install: installation of texinfo failed. Aborting."
55
		exit 1
56
	fi
57
else 
58
	echo "Skipping 'texinfo' installation"
59
fi
60

    
61
if [ ! -d "/opt/X11/bin" ]; then
62
	installer -pkg "$TXMINSTALLDIR/Contents/TXM/R/XQuartz.pkg" -allowUntrusted -target /
63
	if [ $? != 0 ]; then
64
		echo "** TXM install: installation of XQuartz failed. Aborting."
65
		exit 1
66
	fi
67
else 
68
	echo "Skipping XQuartz installation"
69
fi
70

    
71
say $SAY_CREATESTAMP
72
echo "** TXM postinstall: create STAMP file"
73
# Create STAMP
74
rm "$TXMINSTALLDIR/STAMP"
75
touch "$TXMINSTALLDIR/STAMP"
76

    
77
if [ $? != 0 ];then
78
	echo "** TXM postinstall: failed to create STAMP file."
79
	exit 1
80
fi
81

    
82
say $SAY_SETFILERIGHTS
83
echo "** TXM postinstall: set rights"
84
# Set executable files
85
chmod +x "$TXMINSTALLDIR"/Contents/TXM/plugins/org.txm.libs.cqp.macosx*/res/macosx/*
86
chmod -R +x "$TXMINSTALLDIR"/Contents/TXM/plugins/org.txm.statsengine.r.core.macosx*/res/macosx/*
87

    
88
chmod -R +r "$TXMINSTALLDIR"
89
chmod +rx "$TXMINSTALLDIR/Contents/MacOS/TXM"
90
chmod -R +rx /opt/local/lib
91

    
92
echo "sudo chown -R $USER $TXMINSTALLDIR"
93
sudo chown -R "$USER" "$TXMINSTALLDIR"
94

    
95
if [ $? != 0 ];then
96
	echo "** TXM postinstall: failed to set permissions."
97
	exit 1
98
fi
99

    
100
#check created directories
101
if [ ! -d "/opt/local/lib" ]; then
102
	echo "** TXM postinstall: failed to create /opt/local/lib directory. User has not enough rights?"
103
	exit 1
104
fi
105

    
106
say $SAY_DONE
107
echo "** TXM postinstall: Done"