Révision 3628 TXM/trunk/org.txm.setups/BuildMacOSXIntel.sh

BuildMacOSXIntel.sh (revision 3628)
1
VERSION=`cat ../org.txm.rcp/VERSION`
2
SUBVERSION=`cat ../org.txm.rcp/SUBVERSION`
1
DIRNAME=`dirname $0`
2
VERSION=`cat $DIRNAME/../bundles/org.txm.rcp/VERSION`
3
SUBVERSION=`cat $DIRNAME/../bundles/org.txm.rcp/SUBVERSION`
3 4
FULLVERSION=${VERSION}${SUBVERSION}
4 5
STEP=$1
5 6
TIMESTAMP=`date +"%Y-%m-%d"`
7
APP="$DIRNAME/TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
8
SHAREDMAC="$DIRNAME/shared/mac"
9
SHAREDALL="$DIRNAME/shared/all"
6 10

  
7
rm -f "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX.tar.gz"
8
rm -rf "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
9
mkdir "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
11
rm -f "$APP.tar.gz"
12
rm -rf "$APP"
13
mkdir "$APP"
10 14

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

  
18 22
echo " copy mac shared files: R"
19
rsync -r  --exclude '.svn' shared/mac/* "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
23
rsync -r  --exclude '.svn' $SHAREDMAC/* "$APP"
20 24
if [ $? != 0 ]; then
21 25
	echo "** MacOSXIntel.sh : failed to copy Mac shared files"
22 26
	exit 1;
23 27
fi
24 28

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

  
32 36
echo " convert licence files encoding to MacRoman"
33
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
iconv -f utf8 -t MAC shared/all/license_agreement.txt > "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/TXM/license_agreement.txt"
35
iconv -f utf8 -t MAC shared/all/LICENSE_FR.TXT > "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/TXM/LICENSE_FR.TXT"
36
iconv -f utf8 -t MAC shared/all/LICENSE.TXT > "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/TXM/LICENSE.TXT"
37
iconv -f utf8 -t MAC $SHAREDALL/license_agreement_fr.txt > "$APP/Applications/TXM.app/Contents/Eclipse/license_agreement_fr.txt"
38
iconv -f utf8 -t MAC $SHAREDALL/license_agreement.txt > "$APP/Applications/TXM.app/Contents/Eclipse/license_agreement.txt"
39
iconv -f utf8 -t MAC $SHAREDALL/LICENSE_FR.TXT > "$APP/Applications/TXM.app/Contents/Eclipse/LICENSE_FR.TXT"
40
iconv -f utf8 -t MAC $SHAREDALL/LICENSE.TXT > "$APP/Applications/TXM.app/Contents/Eclipse/LICENSE.TXT"
37 41

  
38 42
echo " remove parasite settings"
39
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
40
rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
43
rm -f "$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/macosx/cocoa/x86_64/TXM.app/Contents/Eclipse/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
44
rm -f "$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/macosx/cocoa/x86_64/TXM.app/Contents/Eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
41 45
if [ $? != 0 ]; then
42 46
	echo "** $APP: failed to remove p2 preferences"
43 47
	exit 1;
44 48
fi
45 49

  
46 50
echo " copy eclipse arch dependent build"
47
rsync -r  --exclude '.svn' "exportRCP/macosx.cocoa.x86_64/"* "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents"
51
rsync -r  --exclude '.svn' "$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/macosx/cocoa/x86_64/"* "$APP/Applications/"
48 52
if [ $? != 0 ]; then
49 53
	echo "** MacOSXIntel.sh : failed to binaries files"
50 54
	exit 1;
51 55
fi
52 56

  
53
chmod +x "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/INSTALL" &&
54
chmod +x "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/CLEAN"
57
chmod +x "$APP/INSTALL" &&
58
chmod +x "$APP/CLEAN"
55 59
if [ $? != 0 ]; then
56 60
	echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files"
57 61
	exit 1;
58 62
fi
59 63

  
60 64
#echo "set LSUIElement to 1"
61
#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' {} \;
65
#find ./$APP/Applications/TXM.app/.main.app/Contents/Info.plist -type f -exec sed -i 's/<dict>/<dict><key>LSUIElement<\/key><string>1<\/string>/g' {} \;
62 66
#if [ $? != 0 ]; then
63 67
#	echo "** MacOSXIntel.sh : failed to fix Info.plist"
64 68
#	exit 1;
65 69
#fi
66 70

  
67 71
echo " clean"
68
bash directoryCleaner.sh "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
72
bash $DIRNAME/directoryCleaner.sh "$APP"
69 73
if [ $? != 0 ]; then
70
	echo "** $APP: failed to clean mac setup TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
74
	echo "** $APP: failed to clean mac setup $APP"
71 75
	exit 1;
72 76
fi
73 77

  
74 78
echo " search&replace in files TXMVERSION"
75
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/CLEAN" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
76
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/finish_en.txt" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
77
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/INSTALL" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
78
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXM_TXMVERSION_MacOSX_installer/TXM_${VERSION}_${TIMESTAMP}_MacOSX_installer/g" {} \;
79
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
80
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMMAJORVERSION/$VERSION/g" {} \;
81
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/MacOS/TXM" -type f -exec sed -i "s/TXMMAJORVERSION/$VERSION/g" {} \;
82
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/MacOS/TXM" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
83
find "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/Info.plist" -type f -exec sed -i "s/launcher/TXM/gi" {} \;
79
find "$APP/CLEAN" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
80
find "$APP/finish_en.txt" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
81
find "$APP/INSTALL" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
82
find "$APP/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXM_TXMVERSION_MacOSX_installer/TXM_${VERSION}_${TIMESTAMP}_MacOSX_installer/g" {} \;
83
find "$APP/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
84
find "$APP/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMMAJORVERSION/$VERSION/g" {} \;
85
find "$APP/Applications/TXM.app/Contents/MacOS/TXM" -type f -exec sed -i "s/TXMMAJORVERSION/$VERSION/g" {} \;
86
find "$APP/Applications/TXM.app/Contents/MacOS/TXM" -type f -exec sed -i "s/TXMVERSION/$FULLVERSION/g" {} \;
87
find "$APP/Applications/TXM.app/Contents/Info.plist" -type f -exec sed -i "s/launcher/TXM/gi" {} \;
84 88

  
85 89
# +x the executable rights
86
chmod +x "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/MacOS/"*
90
chmod +x "$APP/Applications/TXM.app/Contents/MacOS/"*
87 91

  
88 92
echo " rename files to add VERSION=$VERSION"
89
mv "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM.app" "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX/Applications/TXM-${FULLVERSION}.app"
93
mv "$APP/Applications/TXM.app" "$APP/Applications/TXM-${FULLVERSION}.app"
90 94

  
91
echo "Tar gz TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
92
tar -zcf "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX.tar.gz" "TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
95
echo "Tar gz $APP"
96
tar -zcf "$APP.tar.gz" "$APP"
93 97
if [ $? != 0 ]; then
94
	echo "** MacOSXIntel.sh : failed to tar gz TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX"
98
	echo "** MacOSXIntel.sh : failed to tar gz $APP"
95 99
	exit 1;
96 100
fi
97 101

  
98
if [ "$STEP" = "" ] ; then
99
	echo "Local test: The archive is not sent to shared files."
100
else
101
	echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp"
102
	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
	if [ $? != 0 ]; then
104
		echo "** MacOSXIntel.sh : failed to send TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX to labo_ana_corpus"
105
		exit 1;
106
	fi
107
fi
108 102

  
109
#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
#if [ $? != 0 ]; then
111
#	echo "** $APP: TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX.tar.gz not copied PartageTemp"
112
#	exit 1;
113
#fi

Formats disponibles : Unified diff