Statistiques
| Révision :

root / TXM / trunk / org.txm.setups / BuildWin64bit.sh

Historique | Voir | Annoter | Télécharger (2,7 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 728 mdecorde
ARCH="64"
7 728 mdecorde
ARCHCODE="x86_64"
8 2241 mdecorde
TIMESTAMP=`date +"%Y-%m-%d"`
9 3628 mdecorde
APP="$DIRNAME/TXM_${FULLVERSION}_${TIMESTAMP}_Win${ARCH}_installer"
10 3628 mdecorde
BUILDDIR="$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/win32/win32/$ARCHCODE"
11 728 mdecorde
12 3628 mdecorde
13 1566 mdecorde
echo "BUILDING $APP..."
14 728 mdecorde
echo "Make dir"
15 728 mdecorde
rm -rf "${APP}"
16 728 mdecorde
mkdir "${APP}"
17 728 mdecorde
18 728 mdecorde
echo "copy shared files: css, xsl, scripts, samples..."
19 3628 mdecorde
rsync -r  --exclude '.svn' "$DIRNAME/shared/all"/* "${APP}"
20 728 mdecorde
21 728 mdecorde
if [ $? != 0 ]; then
22 728 mdecorde
	echo "** ${APP}: copy Win shared files failed"
23 728 mdecorde
	exit 1;
24 728 mdecorde
fi
25 728 mdecorde
26 728 mdecorde
echo "convert licence files encoding to Windows-1252"
27 3628 mdecorde
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/license_agreement_fr.txt > "$APP/license_agreement_fr.txt"
28 3628 mdecorde
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/license_agreement.txt > "$APP/license_agreement.txt"
29 3628 mdecorde
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/LICENSE_FR.TXT > "$APP/LICENSE_FR.TXT"
30 3628 mdecorde
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/LICENSE.TXT > "$APP/LICENSE.TXT"
31 728 mdecorde
32 728 mdecorde
echo "copy win shared files: *.ico, TestPreInstall.jar..."
33 3628 mdecorde
rsync -r  --exclude '.svn' "$DIRNAME/shared/win"/* "${APP}"
34 728 mdecorde
35 728 mdecorde
if [ $? != 0 ]; then
36 728 mdecorde
	echo "** ${APP}: copy Win arch files failed"
37 728 mdecorde
	exit 1;
38 728 mdecorde
fi
39 728 mdecorde
40 2750 mdecorde
41 3628 mdecorde
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
42 3628 mdecorde
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
43 728 mdecorde
if [ $? != 0 ]; then
44 728 mdecorde
	echo "** $APP: failed to remove p2 preferences"
45 728 mdecorde
	exit 1;
46 728 mdecorde
fi
47 728 mdecorde
48 728 mdecorde
echo "copy eclipse arch dependent build"
49 3628 mdecorde
rsync -r --exclude '.svn' "$BUILDDIR/"* "${APP}"
50 728 mdecorde
51 728 mdecorde
if [ $? != 0 ]; then
52 728 mdecorde
	echo "** ${APP}: copy Win build files failed"
53 728 mdecorde
	exit 1;
54 728 mdecorde
fi
55 728 mdecorde
56 728 mdecorde
#echo "copy cqp JNI libs near TXM executable"
57 728 mdecorde
echo "copy CQP binary files"
58 3628 mdecorde
cp "$DIRNAME/../bundles/org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/" &&
59 3628 mdecorde
cp "$DIRNAME/../bundles/org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/TXM"
60 728 mdecorde
61 728 mdecorde
if [ $? != 0 ]; then
62 728 mdecorde
	echo "** ${APP}: copy Win lib files failed"
63 728 mdecorde
	exit 1;
64 728 mdecorde
fi
65 728 mdecorde
66 1189 mdecorde
echo "clean"
67 3628 mdecorde
bash $DIRNAME/directoryCleaner.sh "$APP"
68 728 mdecorde
if [ $? != 0 ]; then
69 728 mdecorde
	echo "** $APP: failed to clean win64 setup $APP"
70 728 mdecorde
	exit 1;
71 728 mdecorde
fi
72 728 mdecorde
73 2750 mdecorde
echo "set TXMVERSION and TIMESTAMP in build files"
74 2831 mdecorde
find "$APP/txm.nsi" -type f -exec sed -i "s/TXMDATEVERSION/${FULLVERSION}_${TIMESTAMP}/g" {} \;
75 2831 mdecorde
find "$APP/txm.nsi" -type f -exec sed -i "s/TXMVERSION/${FULLVERSION}/g" {} \;
76 3868 mdecorde
find "$APP/messages.nsi" -type f -exec sed -i "s/TXMVERSION/${FULLVERSION}/g" {} \;
77 2784 mdecorde
find "$APP/TXM.bat" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
78 1566 mdecorde
79 728 mdecorde
echo "build executable"
80 3628 mdecorde
wine $DIRNAME/nsis/makensis.exe -V1 ${APP}/txm.nsi 2> logs64
81 728 mdecorde
82 1566 mdecorde
if [ ! -e "${APP}.exe" ]; then
83 1566 mdecorde
	echo "** ${APP}.exe : not builded"
84 728 mdecorde
	exit 1;
85 728 mdecorde
fi
86 728 mdecorde
87 1566 mdecorde
chmod +x "${APP}.exe"