root / tmp / org.txm.setups / BuildMacOSXIntel.sh @ 2862
Historique | Voir | Annoter | Télécharger (5,1 ko)
1 |
version=`cat VERSION` |
---|---|
2 |
subversion=`cat SUBVERSION` |
3 |
fullversion="${version}${subversion}" |
4 |
STEP=$1 |
5 |
TIMESTAMP=`date +"%Y-%m-%d"` |
6 |
|
7 |
rm -f "TXM_${fullversion}_${TIMESTAMP}_MacOSX.tar.gz" |
8 |
rm -rf "TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
9 |
mkdir "TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
10 |
|
11 |
# ensure INSTALL CLEAN file rights |
12 |
chmod 775 shared/mac/INSTALL shared/mac/CLEAN |
13 |
if [ $? != 0 ]; then |
14 |
echo "** $APP: failed to set rights of INSTALL CLEAN files " |
15 |
exit 1; |
16 |
fi |
17 |
|
18 |
echo " copy mac shared files: R" |
19 |
rsync -r --exclude '.svn' shared/mac/* "TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
20 |
if [ $? != 0 ]; then |
21 |
echo "** MacOSXIntel.sh : failed to copy Mac shared files" |
22 |
exit 1; |
23 |
fi |
24 |
|
25 |
echo " copy shared files: css, xsl, scripts, samples..." |
26 |
rsync -r --exclude '.svn' shared/all/* "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/TXM" |
27 |
if [ $? != 0 ]; then |
28 |
echo "** MacOSXIntel.sh : failed to copy shared files" |
29 |
exit 1; |
30 |
fi |
31 |
|
32 |
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 |
|
38 |
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/*" |
41 |
if [ $? != 0 ]; then |
42 |
echo "** $APP: failed to remove p2 preferences" |
43 |
exit 1; |
44 |
fi |
45 |
|
46 |
echo " copy eclipse arch dependent build" |
47 |
rsync -r --exclude '.svn' "exportRCP/macosx.cocoa.x86_64/"* "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents" |
48 |
if [ $? != 0 ]; then |
49 |
echo "** MacOSXIntel.sh : failed to binaries files" |
50 |
exit 1; |
51 |
fi |
52 |
|
53 |
chmod +x "TXM_${fullversion}_${TIMESTAMP}_MacOSX/INSTALL" && |
54 |
chmod +x "TXM_${fullversion}_${TIMESTAMP}_MacOSX/CLEAN" |
55 |
if [ $? != 0 ]; then |
56 |
echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files" |
57 |
exit 1; |
58 |
fi |
59 |
|
60 |
#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' {} \; |
62 |
#if [ $? != 0 ]; then |
63 |
# echo "** MacOSXIntel.sh : failed to fix Info.plist" |
64 |
# exit 1; |
65 |
#fi |
66 |
|
67 |
echo " clean" |
68 |
bash directoryCleaner.sh "TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
69 |
if [ $? != 0 ]; then |
70 |
echo "** $APP: failed to clean mac setup TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
71 |
exit 1; |
72 |
fi |
73 |
|
74 |
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 |
|
84 |
echo " rename files to add version=$version" |
85 |
mv "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM.app" "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM-${fullversion}.app" |
86 |
|
87 |
echo "Tar gz TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
88 |
tar -zcf "TXM_${fullversion}_${TIMESTAMP}_MacOSX.tar.gz" "TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
89 |
if [ $? != 0 ]; then |
90 |
echo "** MacOSXIntel.sh : failed to tar gz TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
91 |
exit 1; |
92 |
fi |
93 |
|
94 |
if [ "$STEP" = "" ] ; then |
95 |
echo "Local test: The archive is not sent to shared files." |
96 |
else |
97 |
echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp" |
98 |
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" |
99 |
if [ $? != 0 ]; then |
100 |
echo "** MacOSXIntel.sh : failed to send TXM_${fullversion}_${TIMESTAMP}_MacOSX to labo_ana_corpus" |
101 |
exit 1; |
102 |
fi |
103 |
fi |
104 |
|
105 |
#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 |
106 |
#if [ $? != 0 ]; then |
107 |
# echo "** $APP: TXM_${fullversion}_${TIMESTAMP}_MacOSX.tar.gz not copied PartageTemp" |
108 |
# exit 1; |
109 |
#fi |