Statistics
| Revision:

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

History | View | Annotate | Download (3.8 kB)

1 728 mdecorde
version=`cat VERSION`
2 728 mdecorde
STEP=$1
3 728 mdecorde
4 728 mdecorde
rm -f "TXM_${version}_MacOSX.tar.gz"
5 728 mdecorde
rm -rf "TXM_${version}_MacOSX"
6 728 mdecorde
mkdir "TXM_${version}_MacOSX"
7 728 mdecorde
8 728 mdecorde
# ensure INSTALL CLEAN file rights
9 728 mdecorde
chmod 775 shared/mac/INSTALL shared/mac/CLEAN
10 728 mdecorde
if [ $? != 0 ]; then
11 728 mdecorde
	echo "** $APP: failed to set rights of INSTALL CLEAN files "
12 728 mdecorde
	exit 1;
13 728 mdecorde
fi
14 728 mdecorde
15 728 mdecorde
echo " copy mac shared files: R"
16 728 mdecorde
rsync -r  --exclude '.svn' shared/mac/* "TXM_${version}_MacOSX"
17 728 mdecorde
if [ $? != 0 ]; then
18 728 mdecorde
	echo "** MacOSXIntel.sh : failed to copy Mac shared files"
19 728 mdecorde
	exit 1;
20 728 mdecorde
fi
21 728 mdecorde
22 728 mdecorde
echo " copy shared files: css, xsl, scripts, samples..."
23 728 mdecorde
rsync -r  --exclude '.svn' shared/all/* "TXM_${version}_MacOSX/Applications/TXM"
24 728 mdecorde
if [ $? != 0 ]; then
25 728 mdecorde
	echo "** MacOSXIntel.sh : failed to copy shared files"
26 728 mdecorde
	exit 1;
27 728 mdecorde
fi
28 728 mdecorde
29 728 mdecorde
echo "convert licence files encoding to MacRoman"
30 728 mdecorde
iconv -f utf8 -t MAC shared/all/license_agreement_fr.txt > "TXM_${version}_MacOSX/Applications/TXM/license_agreement_fr.txt"
31 728 mdecorde
iconv -f utf8 -t MAC shared/all/license_agreement.txt > "TXM_${version}_MacOSX/Applications/TXM/license_agreement.txt"
32 728 mdecorde
iconv -f utf8 -t MAC shared/all/LICENSE_FR.TXT > "TXM_${version}_MacOSX/Applications/TXM/LICENSE_FR.TXT"
33 728 mdecorde
iconv -f utf8 -t MAC shared/all/LICENSE.TXT > "TXM_${version}_MacOSX/Applications/TXM/LICENSE.TXT"
34 728 mdecorde
35 728 mdecorde
echo "remove parasite settings"
36 728 mdecorde
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
37 728 mdecorde
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
38 728 mdecorde
if [ $? != 0 ]; then
39 728 mdecorde
	echo "** $APP: failed to remove p2 preferences"
40 728 mdecorde
	exit 1;
41 728 mdecorde
fi
42 728 mdecorde
43 728 mdecorde
echo "copy eclipse build files"
44 728 mdecorde
rsync -r  --exclude '.svn' "../../CQP.macosx/res/macosx"/* "TXM_${version}_MacOSX/Applications/TXM/cwb/bin" &&
45 728 mdecorde
chmod -R +x "TXM_${version}_MacOSX/Applications/TXM/cwb/bin"
46 728 mdecorde
if [ $? != 0 ]; then
47 728 mdecorde
	echo "** MacOSXIntel.sh : failed to copy CQP.macosx plugin files"
48 728 mdecorde
	exit 1;
49 728 mdecorde
fi
50 728 mdecorde
51 728 mdecorde
echo " copy eclipse arch dependent build"
52 728 mdecorde
rsync -r  --exclude '.svn' "exportRCP/macosx.cocoa.x86_64/TXM" "TXM_${version}_MacOSX/Applications/TXM"
53 728 mdecorde
if [ $? != 0 ]; then
54 728 mdecorde
	echo "** MacOSXIntel.sh : failed to binaries files"
55 728 mdecorde
	exit 1;
56 728 mdecorde
fi
57 728 mdecorde
58 728 mdecorde
chmod +x "TXM_${version}_MacOSX/INSTALL" &&
59 728 mdecorde
chmod +x "TXM_${version}_MacOSX/CLEAN"
60 728 mdecorde
if [ $? != 0 ]; then
61 728 mdecorde
	echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files"
62 728 mdecorde
	exit 1;
63 728 mdecorde
fi
64 728 mdecorde
65 728 mdecorde
mv "TXM_${version}_MacOSX/Applications/TXM/TXM.app" "TXM_${version}_MacOSX/Applications/TXM/.main.app"
66 728 mdecorde
if [ $? != 0 ]; then
67 728 mdecorde
	echo "** MacOSXIntel.sh : failed to hide TXM.app"
68 728 mdecorde
	exit 1;
69 728 mdecorde
fi
70 728 mdecorde
71 728 mdecorde
#echo "set LSUIElement to 1"
72 728 mdecorde
#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 728 mdecorde
#if [ $? != 0 ]; then
74 728 mdecorde
#	echo "** MacOSXIntel.sh : failed to fix Info.plist"
75 728 mdecorde
#	exit 1;
76 728 mdecorde
#fi
77 728 mdecorde
78 728 mdecorde
echo " clean"
79 728 mdecorde
bash directoryCleaner.sh "TXM_${version}_MacOSX"
80 728 mdecorde
if [ $? != 0 ]; then
81 728 mdecorde
	echo "** $APP: failed to clean mac setup TXM_${version}_MacOSX"
82 728 mdecorde
	exit 1;
83 728 mdecorde
fi
84 728 mdecorde
85 728 mdecorde
echo "Tar gz TXM_${version}_MacOSX"
86 728 mdecorde
tar -zcf "TXM_${version}_MacOSX.tar.gz" TXM_${version}_MacOSX
87 728 mdecorde
if [ $? != 0 ]; then
88 728 mdecorde
	echo "** MacOSXIntel.sh : failed to tar gz TXM_${version}_MacOSX"
89 728 mdecorde
	exit 1;
90 728 mdecorde
fi
91 728 mdecorde
92 728 mdecorde
if [ "$STEP" = "" ] ; then
93 728 mdecorde
	echo "Local test: The archive is not sent to shared files."
94 728 mdecorde
else
95 728 mdecorde
	echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp"
96 728 mdecorde
	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 728 mdecorde
	if [ $? != 0 ]; then
98 728 mdecorde
		echo "** MacOSXIntel.sh : failed to send TXM_${version}_MacOSX to labo_ana_corpus"
99 728 mdecorde
		exit 1;
100 728 mdecorde
	fi
101 728 mdecorde
fi
102 728 mdecorde
103 728 mdecorde
#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 728 mdecorde
#if [ $? != 0 ]; then
105 728 mdecorde
#	echo "** $APP: TXM_${version}_MacOSX.tar.gz not copied PartageTemp"
106 728 mdecorde
#	exit 1;
107 728 mdecorde
#fi