Statistiques
| Révision :

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

Historique | Voir | Annoter | Télécharger (2,62 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
ARCH="64"
7
ARCHCODE="x86_64"
8
TIMESTAMP=`date +"%Y-%m-%d"`
9
APP="$DIRNAME/TXM_${FULLVERSION}_${TIMESTAMP}_Win${ARCH}_installer"
10
BUILDDIR="$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/win32/win32/$ARCHCODE"
11

    
12

    
13
echo "BUILDING $APP..."
14
echo "Make dir"
15
rm -rf "${APP}"
16
mkdir "${APP}"
17

    
18
echo "copy shared files: css, xsl, scripts, samples..."
19
rsync -r  --exclude '.svn' "$DIRNAME/shared/all"/* "${APP}"
20

    
21
if [ $? != 0 ]; then
22
	echo "** ${APP}: copy Win shared files failed"
23
	exit 1;
24
fi
25

    
26
echo "convert licence files encoding to Windows-1252"
27
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/license_agreement_fr.txt > "$APP/license_agreement_fr.txt"
28
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/license_agreement.txt > "$APP/license_agreement.txt"
29
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/LICENSE_FR.TXT > "$APP/LICENSE_FR.TXT"
30
iconv -f utf8 -t WINDOWS-1252 $DIRNAME/shared/all/LICENSE.TXT > "$APP/LICENSE.TXT"
31

    
32
echo "copy win shared files: *.ico, TestPreInstall.jar..."
33
rsync -r  --exclude '.svn' "$DIRNAME/shared/win"/* "${APP}"
34

    
35
if [ $? != 0 ]; then
36
	echo "** ${APP}: copy Win arch files failed"
37
	exit 1;
38
fi
39

    
40

    
41
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
42
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
43
if [ $? != 0 ]; then
44
	echo "** $APP: failed to remove p2 preferences"
45
	exit 1;
46
fi
47

    
48
echo "copy eclipse arch dependent build"
49
rsync -r --exclude '.svn' "$BUILDDIR/"* "${APP}"
50

    
51
if [ $? != 0 ]; then
52
	echo "** ${APP}: copy Win build files failed"
53
	exit 1;
54
fi
55

    
56
#echo "copy cqp JNI libs near TXM executable"
57
echo "copy CQP binary files"
58
cp "$DIRNAME/../bundles/org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/" &&
59
cp "$DIRNAME/../bundles/org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/TXM"
60

    
61
if [ $? != 0 ]; then
62
	echo "** ${APP}: copy Win lib files failed"
63
	exit 1;
64
fi
65

    
66
echo "clean"
67
bash $DIRNAME/directoryCleaner.sh "$APP"
68
if [ $? != 0 ]; then
69
	echo "** $APP: failed to clean win64 setup $APP"
70
	exit 1;
71
fi
72

    
73
echo "set TXMVERSION and TIMESTAMP in build files"
74
find "$APP/txm.nsi" -type f -exec sed -i "s/TXMDATEVERSION/${FULLVERSION}_${TIMESTAMP}/g" {} \;
75
find "$APP/txm.nsi" -type f -exec sed -i "s/TXMVERSION/${FULLVERSION}/g" {} \;
76
find "$APP/TXM.bat" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
77

    
78
echo "build executable"
79
wine $DIRNAME/nsis/makensis.exe -V1 ${APP}/txm.nsi 2> logs64
80

    
81
if [ ! -e "${APP}.exe" ]; then
82
	echo "** ${APP}.exe : not builded"
83
	exit 1;
84
fi
85

    
86
chmod +x "${APP}.exe"