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