root / tmp / org.txm.setups / BuildMacOSXIntel.sh @ 2813
History | View | Annotate | Download (5.4 kB)
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 " rename TXM eclipse launcher" |
47 |
if [ ! -f "exportRCP/macosx.cocoa.x86_64/MacOS/launcher" ]; then |
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}_${TIMESTAMP}_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}_${TIMESTAMP}_MacOSX/INSTALL" && |
63 |
chmod +x "TXM_${fullversion}_${TIMESTAMP}_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}_${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' {} \; |
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}_${TIMESTAMP}_MacOSX" |
78 |
if [ $? != 0 ]; then |
79 |
echo "** $APP: failed to clean mac setup TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
80 |
exit 1; |
81 |
fi |
82 |
|
83 |
echo " search&replace in files TXMVERSION" |
84 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/CLEAN" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \; |
85 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/finish_en.txt" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \; |
86 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/INSTALL" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \; |
87 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXM_TXMVERSION_MacOSX_installer/TXM_${version}_${TIMESTAMP}_MacOSX_installer/g" {} \; |
88 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \; |
89 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/BUILDPKG.pkgproj" -type f -exec sed -i "s/TXMMAJORVERSION/$version/g" {} \; |
90 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/MacOS/TXM" -type f -exec sed -i "s/TXMMAJORVERSION/$version/g" {} \; |
91 |
find "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM.app/Contents/MacOS/TXM" -type f -exec sed -i "s/TXMVERSION/$fullversion/g" {} \; |
92 |
|
93 |
echo " rename files to add version=$version" |
94 |
mv "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM.app" "TXM_${fullversion}_${TIMESTAMP}_MacOSX/Applications/TXM-${fullversion}.app" |
95 |
|
96 |
echo "Tar gz TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
97 |
tar -zcf "TXM_${fullversion}_${TIMESTAMP}_MacOSX.tar.gz" "TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
98 |
if [ $? != 0 ]; then |
99 |
echo "** MacOSXIntel.sh : failed to tar gz TXM_${fullversion}_${TIMESTAMP}_MacOSX" |
100 |
exit 1; |
101 |
fi |
102 |
|
103 |
if [ "$STEP" = "" ] ; then |
104 |
echo "Local test: The archive is not sent to shared files." |
105 |
else |
106 |
echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp" |
107 |
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" |
108 |
if [ $? != 0 ]; then |
109 |
echo "** MacOSXIntel.sh : failed to send TXM_${fullversion}_${TIMESTAMP}_MacOSX to labo_ana_corpus" |
110 |
exit 1; |
111 |
fi |
112 |
fi |
113 |
|
114 |
#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 |
115 |
#if [ $? != 0 ]; then |
116 |
# echo "** $APP: TXM_${fullversion}_${TIMESTAMP}_MacOSX.tar.gz not copied PartageTemp" |
117 |
# exit 1; |
118 |
#fi |