Statistics
| Revision:

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

History | View | Annotate | Download (5.4 kB)

1
version=`cat VERSION`
2
subversion=`cat SUBVERSION`
3
fullversion="${version}${subversion}"
4
STEP=$1
5

    
6
rm -f "TXM_${fullversion}_MacOSX.tar.gz"
7
rm -rf "TXM_${fullversion}_MacOSX"
8
mkdir "TXM_${fullversion}_MacOSX"
9

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

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

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

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

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

    
45
echo " rename TXM eclipse launcher"
46
if [ ! -f  "exportRCP/macosx.cocoa.x86_64/MacOS/launcher" ]; then
47

    
48
	mv "exportRCP/macosx.cocoa.x86_64/MacOS/TXM" "exportRCP/macosx.cocoa.x86_64/MacOS/launcher"
49
	if [ $? != 0 ]; then
50
		echo "** MacOSXIntel.sh : failed to binaries files"
51
		exit 1;
52
	fi
53
fi
54

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

    
62
chmod +x "TXM_${fullversion}_MacOSX/INSTALL" &&
63
chmod +x "TXM_${fullversion}_MacOSX/CLEAN"
64
if [ $? != 0 ]; then
65
	echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files"
66
	exit 1;
67
fi
68

    
69
#echo "set LSUIElement to 1"
70
#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
#if [ $? != 0 ]; then
72
#	echo "** MacOSXIntel.sh : failed to fix Info.plist"
73
#	exit 1;
74
#fi
75

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

    
83
echo " search&replace in files TXMVERSION"
84
find "TXM_${fullversion}_MacOSX/CLEAN" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
85
find "TXM_${fullversion}_MacOSX/finish_en.txt" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
86
find "TXM_${fullversion}_MacOSX/INSTALL" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
87
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/01applications.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
88
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/02opt-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
89
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/02rlibs-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
90
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/02rlibs.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
91
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/03opt-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
92
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/03rlibs-contents.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
93
find "TXM_${fullversion}_MacOSX/BUILDPKG.pmdoc/index.xml" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
94
find "TXM_${fullversion}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
95
find "TXM_${fullversion}_MacOSX/Applications/TXM.app" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \;
96

    
97
echo " rename files to add version=$version"
98
mv "TXM_${fullversion}_MacOSX/Applications/TXM.app" "TXM_${fullversion}_MacOSX/Applications/TXM-${fullversion}.app"
99

    
100
echo "Tar gz TXM_${fullversion}_MacOSX"
101
tar -zcf "TXM_${fullversion}_MacOSX.tar.gz" "TXM_${fullversion}_MacOSX"
102
if [ $? != 0 ]; then
103
	echo "** MacOSXIntel.sh : failed to tar gz TXM_${fullversion}_MacOSX"
104
	exit 1;
105
fi
106

    
107
if [ "$STEP" = "" ] ; then
108
	echo "Local test: The archive is not sent to shared files."
109
else
110
	echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp"
111
	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
	if [ $? != 0 ]; then
113
		echo "** MacOSXIntel.sh : failed to send TXM_${fullversion}_MacOSX to labo_ana_corpus"
114
		exit 1;
115
	fi
116
fi
117

    
118
#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
#if [ $? != 0 ]; then
120
#	echo "** $APP: TXM_${fullversion}_MacOSX.tar.gz not copied PartageTemp"
121
#	exit 1;
122
#fi