root / TXM / trunk / org.txm.setups / BuildMacOSXIntel.sh @ 3812
Historique | Voir | Annoter | Télécharger (3,96 ko)
1 |
DIRNAME=`dirname $0` |
---|---|
2 |
VERSION=`cat $DIRNAME/../bundles/org.txm.rcp/VERSION` |
3 |
SUBVERSION=`cat $DIRNAME/../bundles/org.txm.rcp/SUBVERSION` |
4 |
FULLVERSION=${VERSION}${SUBVERSION} |
5 |
STEP=$1 |
6 |
TIMESTAMP=`date +"%Y-%m-%d"` |
7 |
APP="$DIRNAME/TXM_${FULLVERSION}_${TIMESTAMP}_MacOSX" |
8 |
SHAREDMAC="$DIRNAME/shared/mac" |
9 |
SHAREDALL="$DIRNAME/shared/all" |
10 |
|
11 |
rm -f "$APP.tar.gz" |
12 |
rm -rf "$APP" |
13 |
mkdir "$APP" |
14 |
|
15 |
# ensure INSTALL CLEAN file rights |
16 |
chmod 775 $SHAREDMAC/INSTALL $SHAREDMAC/CLEAN |
17 |
if [ $? != 0 ]; then |
18 |
echo "** $APP: failed to set rights of INSTALL CLEAN files " |
19 |
exit 1; |
20 |
fi |
21 |
|
22 |
echo " copy mac shared files: R" |
23 |
rsync -r --exclude '.svn' $SHAREDMAC/* "$APP" |
24 |
if [ $? != 0 ]; then |
25 |
echo "** MacOSXIntel.sh : failed to copy Mac shared files" |
26 |
exit 1; |
27 |
fi |
28 |
|
29 |
echo " copy shared files: css, xsl, scripts, samples..." |
30 |
rsync -r --exclude '.svn' $SHAREDALL/* "$APP/Applications/TXM.app/Contents/Eclipse" |
31 |
if [ $? != 0 ]; then |
32 |
echo "** MacOSXIntel.sh : failed to copy shared files" |
33 |
exit 1; |
34 |
fi |
35 |
|
36 |
echo " convert licence files encoding to MacRoman" |
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" |
41 |
|
42 |
echo " remove parasite 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/*" |
45 |
if [ $? != 0 ]; then |
46 |
echo "** $APP: failed to remove p2 preferences" |
47 |
exit 1; |
48 |
fi |
49 |
|
50 |
echo " copy eclipse arch dependent build" |
51 |
rsync -r --exclude '.svn' "$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/macosx/cocoa/x86_64/"* "$APP/Applications/" |
52 |
if [ $? != 0 ]; then |
53 |
echo "** MacOSXIntel.sh : failed to binaries files" |
54 |
exit 1; |
55 |
fi |
56 |
|
57 |
chmod +x "$APP/INSTALL" && |
58 |
chmod +x "$APP/CLEAN" |
59 |
if [ $? != 0 ]; then |
60 |
echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files" |
61 |
exit 1; |
62 |
fi |
63 |
|
64 |
#echo "set LSUIElement to 1" |
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' {} \; |
66 |
#if [ $? != 0 ]; then |
67 |
# echo "** MacOSXIntel.sh : failed to fix Info.plist" |
68 |
# exit 1; |
69 |
#fi |
70 |
|
71 |
echo " clean" |
72 |
bash $DIRNAME/directoryCleaner.sh "$APP" |
73 |
if [ $? != 0 ]; then |
74 |
echo "** $APP: failed to clean mac setup $APP" |
75 |
exit 1; |
76 |
fi |
77 |
|
78 |
echo " search&replace in files TXMVERSION" |
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" {} \; |
88 |
|
89 |
# +x the executable rights |
90 |
chmod +x "$APP/Applications/TXM.app/Contents/MacOS/"* |
91 |
|
92 |
echo " rename files to add VERSION=$VERSION" |
93 |
mv "$APP/Applications/TXM.app" "$APP/Applications/TXM-${FULLVERSION}.app" |
94 |
|
95 |
echo "Tar gz $APP" |
96 |
tar -zcf "$APP.tar.gz" "$APP" |
97 |
if [ $? != 0 ]; then |
98 |
echo "** MacOSXIntel.sh : failed to tar gz $APP" |
99 |
exit 1; |
100 |
fi |
101 |
|
102 |
|