Statistiques
| Révision :

root / TXM / trunk / org.txm.setups / BuildMacOSXIntel.sh @ 3497

Historique | Voir | Annoter | Télécharger (5,37 ko)

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