Statistiques
| Révision :

root / TXM / trunk / org.txm.setups / BuildLinux64bit.sh @ 3816

Historique | Voir | Annoter | Télécharger (3,83 ko)

1
DIRNAME=`dirname $0`
2
VERSIONWITHOUTSUB=`cat $DIRNAME/../bundles/org.txm.rcp/VERSION`
3
SUBVERSION=`cat $DIRNAME/../bundles/org.txm.rcp/SUBVERSION`
4
VERSION=${VERSIONWITHOUTSUB}${SUBVERSION}
5

    
6
STEP=$1
7
ARCH="64"
8
ARCHCODE="x86_64"
9
TIMESTAMP=`date +"%Y-%m-%d"`
10
APP="$DIRNAME/TXM_${VERSION}_${TIMESTAMP}_Linux${ARCH}"
11
BUILDDIR="$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/linux/gtk/$ARCHCODE"
12

    
13
rm -rf "$APP"
14
mkdir "$APP"
15

    
16
echo purge | sudo debconf-communicate txm
17
echo purge | sudo debconf-communicate TXM
18

    
19
# ensure postinst preinst ... rights
20
chmod 644 $DIRNAME/shared/debian/DEBIAN/templates &&
21
chmod 755 $DIRNAME/shared/debian/DEBIAN/postinst &&
22
chmod 755 $DIRNAME/shared/debian/DEBIAN/postrm &&
23
chmod 755 $DIRNAME/shared/debian/DEBIAN/preinst &&
24
chmod 755 $DIRNAME/shared/debian/usr/bin/TXM*
25
if [ $? != 0 ]; then
26
	echo "** $APP: failed to set rights of postinst preinst ... files "
27
	exit 1;
28
fi
29

    
30
# remove old profile that can contains unwanted repositories
31
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
32
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
33
if [ $? != 0 ]; then
34
	echo "** $APP: failed to remove p2 preferences"
35
	exit 1;
36
fi
37

    
38
mkdir -p "$APP/usr/lib/TXM"
39

    
40
# copy debian shared files: INSTALL, R libs...
41
rsync -r  --exclude '.svn' $DIRNAME/shared/debian/* "$APP"
42
if [ $? != 0 ]; then
43
	echo "** $APP: failed to get 'debian' shared files"
44
	exit 1;
45
fi
46

    
47
# copy shared files: css, xsl, scripts, samples...
48
rsync -r  --exclude '.svn' $DIRNAME/shared/all/* "$APP/usr/lib/TXM"
49
if [ $? != 0 ]; then
50
	echo "** $APP: failed to get shared files"
51
	exit 1;
52
fi
53

    
54
# copy eclise arch dependent build
55
rsync -r  --exclude '.svn' "$BUILDDIR" "$APP/usr/lib/TXM"
56
cp -rf "$APP/usr/lib/TXM/$ARCHCODE/"* "$APP/usr/lib/TXM"
57
rm -rf "$APP/usr/lib/TXM/$ARCHCODE"
58
if [ $? != 0 ]; then
59
	echo "** $APP: failed to get ${ARCH}bit binaries Linux $ARCHCODE files"
60
	exit 1;
61
fi
62

    
63
echo " clean"
64
bash $DIRNAME/directoryCleaner.sh "$APP"
65
if [ $? != 0 ]; then
66
	echo "** $APP: failed to clean Debian package $APP"
67
	exit 1;
68
fi
69

    
70
# for multi installation: set the package version to txm-$VERSION
71
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
72
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
73
find "$APP/DEBIAN/postrm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
74
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSIONWITHOUTSUB/${VERSIONWITHOUTSUB}/g" {} \;
75
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
76
find "$APP/DEBIAN/control" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
77

    
78
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
79
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
80

    
81
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
82
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
83
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
84
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
85
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop"
86
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop"
87

    
88
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
89

    
90
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
91
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
92
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION"
93

    
94
# build
95
sudo fakeroot dpkg-deb --build "$APP"
96
#add "--faked faked-tcp" when called from windows WSL
97
if [ $? != 0 ]; then
98
	echo "** $APP: failed to build debian package $APP"
99
	exit 1;
100
fi
101

    
102
rm -f "${APP}_installer.deb"
103
mv $APP.deb ${APP}_installer.deb