Statistics
| Revision:

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

History | View | Annotate | Download (5.4 kB)

1 728 mdecorde
version=`cat VERSION`
2 1220 mdecorde
subversion=`cat SUBVERSION`
3 1220 mdecorde
fullversion="${version}${subversion}"
4 728 mdecorde
STEP=$1
5 728 mdecorde
6 1220 mdecorde
rm -f "TXM_${fullversion}_MacOSX.tar.gz"
7 1220 mdecorde
rm -rf "TXM_${fullversion}_MacOSX"
8 1220 mdecorde
mkdir "TXM_${fullversion}_MacOSX"
9 728 mdecorde
10 728 mdecorde
# ensure INSTALL CLEAN file rights
11 728 mdecorde
chmod 775 shared/mac/INSTALL shared/mac/CLEAN
12 728 mdecorde
if [ $? != 0 ]; then
13 728 mdecorde
	echo "** $APP: failed to set rights of INSTALL CLEAN files "
14 728 mdecorde
	exit 1;
15 728 mdecorde
fi
16 728 mdecorde
17 728 mdecorde
echo " copy mac shared files: R"
18 1220 mdecorde
rsync -r  --exclude '.svn' shared/mac/* "TXM_${fullversion}_MacOSX"
19 728 mdecorde
if [ $? != 0 ]; then
20 728 mdecorde
	echo "** MacOSXIntel.sh : failed to copy Mac shared files"
21 728 mdecorde
	exit 1;
22 728 mdecorde
fi
23 728 mdecorde
24 728 mdecorde
echo " copy shared files: css, xsl, scripts, samples..."
25 1220 mdecorde
rsync -r  --exclude '.svn' shared/all/* "TXM_${fullversion}_MacOSX/Applications/TXM.app/Contents/TXM"
26 728 mdecorde
if [ $? != 0 ]; then
27 728 mdecorde
	echo "** MacOSXIntel.sh : failed to copy shared files"
28 728 mdecorde
	exit 1;
29 728 mdecorde
fi
30 728 mdecorde
31 1220 mdecorde
echo " convert licence files encoding to MacRoman"
32 1220 mdecorde
iconv -f utf8 -t MAC shared/all/license_agreement_fr.txt > "TXM_${fullversion}_MacOSX/Applications/TXM.app/Contents/TXM/license_agreement_fr.txt"
33 1220 mdecorde
iconv -f utf8 -t MAC shared/all/license_agreement.txt > "TXM_${fullversion}_MacOSX/Applications/TXM.app/Contents/TXM/license_agreement.txt"
34 1220 mdecorde
iconv -f utf8 -t MAC shared/all/LICENSE_FR.TXT > "TXM_${fullversion}_MacOSX/Applications/TXM.app/Contents/TXM/LICENSE_FR.TXT"
35 1220 mdecorde
iconv -f utf8 -t MAC shared/all/LICENSE.TXT > "TXM_${fullversion}_MacOSX/Applications/TXM.app/Contents/TXM/LICENSE.TXT"
36 728 mdecorde
37 1220 mdecorde
echo " remove parasite settings"
38 728 mdecorde
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
39 728 mdecorde
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
40 728 mdecorde
if [ $? != 0 ]; then
41 728 mdecorde
	echo "** $APP: failed to remove p2 preferences"
42 728 mdecorde
	exit 1;
43 728 mdecorde
fi
44 728 mdecorde
45 1220 mdecorde
echo " rename TXM eclipse launcher"
46 1220 mdecorde
if [ ! -f  "exportRCP/macosx.cocoa.x86_64/MacOS/launcher" ]; then
47 1220 mdecorde
48 1220 mdecorde
	mv "exportRCP/macosx.cocoa.x86_64/MacOS/TXM" "exportRCP/macosx.cocoa.x86_64/MacOS/launcher"
49 1220 mdecorde
	if [ $? != 0 ]; then
50 1220 mdecorde
		echo "** MacOSXIntel.sh : failed to binaries files"
51 1220 mdecorde
		exit 1;
52 1220 mdecorde
	fi
53 728 mdecorde
fi
54 728 mdecorde
55 728 mdecorde
echo " copy eclipse arch dependent build"
56 1220 mdecorde
rsync -r  --exclude '.svn' "exportRCP/macosx.cocoa.x86_64/"* "TXM_${fullversion}_MacOSX/Applications/TXM.app/Contents"
57 728 mdecorde
if [ $? != 0 ]; then
58 728 mdecorde
	echo "** MacOSXIntel.sh : failed to binaries files"
59 728 mdecorde
	exit 1;
60 728 mdecorde
fi
61 728 mdecorde
62 1220 mdecorde
chmod +x "TXM_${fullversion}_MacOSX/INSTALL" &&
63 1220 mdecorde
chmod +x "TXM_${fullversion}_MacOSX/CLEAN"
64 728 mdecorde
if [ $? != 0 ]; then
65 728 mdecorde
	echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files"
66 728 mdecorde
	exit 1;
67 728 mdecorde
fi
68 728 mdecorde
69 728 mdecorde
#echo "set LSUIElement to 1"
70 1220 mdecorde
#find ./TXM_${fullversion}_MacOSX/Applications/TXM.app/.main.app/Contents/Info.plist -type f -exec sed -i 's/<dict>/<dict><key>LSUIElement<\/key><string>1<\/string>/g' {} \;
71 728 mdecorde
#if [ $? != 0 ]; then
72 728 mdecorde
#	echo "** MacOSXIntel.sh : failed to fix Info.plist"
73 728 mdecorde
#	exit 1;
74 728 mdecorde
#fi
75 728 mdecorde
76 728 mdecorde
echo " clean"
77 1220 mdecorde
bash directoryCleaner.sh "TXM_${fullversion}_MacOSX"
78 728 mdecorde
if [ $? != 0 ]; then
79 1220 mdecorde
	echo "** $APP: failed to clean mac setup TXM_${fullversion}_MacOSX"
80 728 mdecorde
	exit 1;
81 728 mdecorde
fi
82 728 mdecorde
83 1220 mdecorde
echo " search&replace in files TXMVERSION"
84 1220 mdecorde
find "TXM_${fullversion}_MacOSX/CLEAN" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
85 1220 mdecorde
find "TXM_${fullversion}_MacOSX/finish_en.txt" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
86 1220 mdecorde
find "TXM_${fullversion}_MacOSX/INSTALL" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
87 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/01applications.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
88 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/02opt-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
89 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/02rlibs-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
90 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/02rlibs.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
91 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/03opt-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
92 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/03rlibs-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
93 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/index.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
94 1220 mdecorde
find "TXM_${fullversion}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
95 1220 mdecorde
find "TXM_${fullversion}_MacOSX/Applications/TXM.app" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
96 1220 mdecorde
97 1220 mdecorde
echo " rename files to add version=$version"
98 1220 mdecorde
mv "TXM_${fullversion}_MacOSX/Applications/TXM.app" "TXM_${fullversion}_MacOSX/Applications/TXM-${fullversion}.app"
99 1220 mdecorde
100 1220 mdecorde
echo "Tar gz TXM_${fullversion}_MacOSX"
101 1220 mdecorde
tar -zcf "TXM_${fullversion}_MacOSX.tar.gz" "TXM_${fullversion}_MacOSX"
102 728 mdecorde
if [ $? != 0 ]; then
103 1220 mdecorde
	echo "** MacOSXIntel.sh : failed to tar gz TXM_${fullversion}_MacOSX"
104 728 mdecorde
	exit 1;
105 728 mdecorde
fi
106 728 mdecorde
107 728 mdecorde
if [ "$STEP" = "" ] ; then
108 728 mdecorde
	echo "Local test: The archive is not sent to shared files."
109 728 mdecorde
else
110 728 mdecorde
	echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp"
111 1220 mdecorde
	smbclient -A auth.txt "//ensldfs.ens-lyon.fr/services" -c "cd \"/Laboratoires/labo_ana_corpus/Projets/Textométrie/Logiciel/TXM/$STEP\" ; put TXM_${fullversion}_MacOSX.zip ; exit"
112 728 mdecorde
	if [ $? != 0 ]; then
113 1220 mdecorde
		echo "** MacOSXIntel.sh : failed to send TXM_${fullversion}_MacOSX to labo_ana_corpus"
114 728 mdecorde
		exit 1;
115 728 mdecorde
	fi
116 728 mdecorde
fi
117 728 mdecorde
118 1220 mdecorde
#cp "TXM_${fullversion}_MacOSX.tar.gz" /run/user/1001/gvfs/smb-share\:server\=ensldfs.ens-lyon.fr\,share\=services\,user\=$USER/Laboratoires/labo_ana_corpus/PartageTemp
119 728 mdecorde
#if [ $? != 0 ]; then
120 1220 mdecorde
#	echo "** $APP: TXM_${fullversion}_MacOSX.tar.gz not copied PartageTemp"
121 728 mdecorde
#	exit 1;
122 728 mdecorde
#fi