Statistics
| Revision:

root / tmp / org.txm.setups / BuildMacOSXIntel.sh @ 1120

History | View | Annotate | Download (3.8 kB)

1
version=`cat VERSION`
2
STEP=$1
3

    
4
rm -f "TXM_${version}_MacOSX.tar.gz"
5
rm -rf "TXM_${version}_MacOSX"
6
mkdir "TXM_${version}_MacOSX"
7

    
8
# ensure INSTALL CLEAN file rights
9
chmod 775 shared/mac/INSTALL shared/mac/CLEAN
10
if [ $? != 0 ]; then
11
	echo "** $APP: failed to set rights of INSTALL CLEAN files "
12
	exit 1;
13
fi
14

    
15
echo " copy mac shared files: R"
16
rsync -r  --exclude '.svn' shared/mac/* "TXM_${version}_MacOSX"
17
if [ $? != 0 ]; then
18
	echo "** MacOSXIntel.sh : failed to copy Mac shared files"
19
	exit 1;
20
fi
21

    
22
echo " copy shared files: css, xsl, scripts, samples..."
23
rsync -r  --exclude '.svn' shared/all/* "TXM_${version}_MacOSX/Applications/TXM"
24
if [ $? != 0 ]; then
25
	echo "** MacOSXIntel.sh : failed to copy shared files"
26
	exit 1;
27
fi
28

    
29
echo "convert licence files encoding to MacRoman"
30
iconv -f utf8 -t MAC shared/all/license_agreement_fr.txt > "TXM_${version}_MacOSX/Applications/TXM/license_agreement_fr.txt"
31
iconv -f utf8 -t MAC shared/all/license_agreement.txt > "TXM_${version}_MacOSX/Applications/TXM/license_agreement.txt"
32
iconv -f utf8 -t MAC shared/all/LICENSE_FR.TXT > "TXM_${version}_MacOSX/Applications/TXM/LICENSE_FR.TXT"
33
iconv -f utf8 -t MAC shared/all/LICENSE.TXT > "TXM_${version}_MacOSX/Applications/TXM/LICENSE.TXT"
34

    
35
echo "remove parasite settings"
36
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
37
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
38
if [ $? != 0 ]; then
39
	echo "** $APP: failed to remove p2 preferences"
40
	exit 1;
41
fi
42

    
43
echo "copy eclipse build files"
44
rsync -r  --exclude '.svn' "../../CQP.macosx/res/macosx"/* "TXM_${version}_MacOSX/Applications/TXM/cwb/bin" &&
45
chmod -R +x "TXM_${version}_MacOSX/Applications/TXM/cwb/bin"
46
if [ $? != 0 ]; then
47
	echo "** MacOSXIntel.sh : failed to copy CQP.macosx plugin files"
48
	exit 1;
49
fi
50

    
51
echo " copy eclipse arch dependent build"
52
rsync -r  --exclude '.svn' "exportRCP/macosx.cocoa.x86_64/TXM" "TXM_${version}_MacOSX/Applications/TXM"
53
if [ $? != 0 ]; then
54
	echo "** MacOSXIntel.sh : failed to binaries files"
55
	exit 1;
56
fi
57

    
58
chmod +x "TXM_${version}_MacOSX/INSTALL" &&
59
chmod +x "TXM_${version}_MacOSX/CLEAN"
60
if [ $? != 0 ]; then
61
	echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files"
62
	exit 1;
63
fi
64

    
65
mv "TXM_${version}_MacOSX/Applications/TXM/TXM.app" "TXM_${version}_MacOSX/Applications/TXM/.main.app"
66
if [ $? != 0 ]; then
67
	echo "** MacOSXIntel.sh : failed to hide TXM.app"
68
	exit 1;
69
fi
70

    
71
#echo "set LSUIElement to 1"
72
#find ./TXM_${version}_MacOSX/Applications/TXM/.main.app/Contents/Info.plist -type f -exec sed -i 's/<dict>/<dict><key>LSUIElement<\/key><string>1<\/string>/g' {} \;
73
#if [ $? != 0 ]; then
74
#	echo "** MacOSXIntel.sh : failed to fix Info.plist"
75
#	exit 1;
76
#fi
77

    
78
echo " clean"
79
bash directoryCleaner.sh "TXM_${version}_MacOSX"
80
if [ $? != 0 ]; then
81
	echo "** $APP: failed to clean mac setup TXM_${version}_MacOSX"
82
	exit 1;
83
fi
84

    
85
echo "Tar gz TXM_${version}_MacOSX"
86
tar -zcf "TXM_${version}_MacOSX.tar.gz" TXM_${version}_MacOSX
87
if [ $? != 0 ]; then
88
	echo "** MacOSXIntel.sh : failed to tar gz TXM_${version}_MacOSX"
89
	exit 1;
90
fi
91

    
92
if [ "$STEP" = "" ] ; then
93
	echo "Local test: The archive is not sent to shared files."
94
else
95
	echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp"
96
	smbclient -A auth.txt "//ensldfs.ens-lyon.fr/services" -c "cd \"/Laboratoires/labo_ana_corpus/Projets/Textométrie/Logiciel/TXM/$STEP\" ; put TXM_${version}_MacOSX.zip ; exit"
97
	if [ $? != 0 ]; then
98
		echo "** MacOSXIntel.sh : failed to send TXM_${version}_MacOSX to labo_ana_corpus"
99
		exit 1;
100
	fi
101
fi
102

    
103
#cp "TXM_${version}_MacOSX.tar.gz" /run/user/1001/gvfs/smb-share\:server\=ensldfs.ens-lyon.fr\,share\=services\,user\=$USER/Laboratoires/labo_ana_corpus/PartageTemp
104
#if [ $? != 0 ]; then
105
#	echo "** $APP: TXM_${version}_MacOSX.tar.gz not copied PartageTemp"
106
#	exit 1;
107
#fi