Statistiques
| Révision :

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

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

1 3628 mdecorde
DIRNAME=`dirname $0`
2 3628 mdecorde
VERSIONWITHOUTSUB=`cat $DIRNAME/../bundles/org.txm.rcp/VERSION`
3 3628 mdecorde
SUBVERSION=`cat $DIRNAME/../bundles/org.txm.rcp/SUBVERSION`
4 1214 mdecorde
VERSION=${VERSIONWITHOUTSUB}${SUBVERSION}
5 1214 mdecorde
6 728 mdecorde
STEP=$1
7 728 mdecorde
ARCH="64"
8 728 mdecorde
ARCHCODE="x86_64"
9 2241 mdecorde
TIMESTAMP=`date +"%Y-%m-%d"`
10 3628 mdecorde
APP="$DIRNAME/TXM_${VERSION}_${TIMESTAMP}_Linux${ARCH}"
11 3628 mdecorde
BUILDDIR="$DIRNAME/../products/org.txm.rcp.product/target/products/org.txm.rcp.app/linux/gtk/$ARCHCODE"
12 728 mdecorde
13 728 mdecorde
rm -rf "$APP"
14 728 mdecorde
mkdir "$APP"
15 728 mdecorde
16 728 mdecorde
echo purge | sudo debconf-communicate txm
17 728 mdecorde
echo purge | sudo debconf-communicate TXM
18 728 mdecorde
19 728 mdecorde
# ensure postinst preinst ... rights
20 3628 mdecorde
chmod 644 $DIRNAME/shared/debian/DEBIAN/templates &&
21 3628 mdecorde
chmod 755 $DIRNAME/shared/debian/DEBIAN/postinst &&
22 3628 mdecorde
chmod 755 $DIRNAME/shared/debian/DEBIAN/postrm &&
23 3628 mdecorde
chmod 755 $DIRNAME/shared/debian/DEBIAN/preinst &&
24 3628 mdecorde
chmod 755 $DIRNAME/shared/debian/usr/bin/TXM*
25 728 mdecorde
if [ $? != 0 ]; then
26 728 mdecorde
	echo "** $APP: failed to set rights of postinst preinst ... files "
27 728 mdecorde
	exit 1;
28 728 mdecorde
fi
29 728 mdecorde
30 817 mdecorde
# remove old profile that can contains unwanted repositories
31 3628 mdecorde
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
32 3628 mdecorde
rm -f "$BUILDDIR/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
33 817 mdecorde
if [ $? != 0 ]; then
34 817 mdecorde
	echo "** $APP: failed to remove p2 preferences"
35 728 mdecorde
	exit 1;
36 728 mdecorde
fi
37 728 mdecorde
38 817 mdecorde
mkdir -p "$APP/usr/lib/TXM"
39 817 mdecorde
40 728 mdecorde
# copy debian shared files: INSTALL, R libs...
41 3628 mdecorde
rsync -r  --exclude '.svn' $DIRNAME/shared/debian/* "$APP"
42 728 mdecorde
if [ $? != 0 ]; then
43 728 mdecorde
	echo "** $APP: failed to get 'debian' shared files"
44 728 mdecorde
	exit 1;
45 728 mdecorde
fi
46 728 mdecorde
47 728 mdecorde
# copy shared files: css, xsl, scripts, samples...
48 3628 mdecorde
rsync -r  --exclude '.svn' $DIRNAME/shared/all/* "$APP/usr/lib/TXM"
49 728 mdecorde
if [ $? != 0 ]; then
50 728 mdecorde
	echo "** $APP: failed to get shared files"
51 728 mdecorde
	exit 1;
52 728 mdecorde
fi
53 728 mdecorde
54 728 mdecorde
# copy eclise arch dependent build
55 3628 mdecorde
rsync -r  --exclude '.svn' "$BUILDDIR" "$APP/usr/lib/TXM"
56 3628 mdecorde
cp -rf "$APP/usr/lib/TXM/$ARCHCODE/"* "$APP/usr/lib/TXM"
57 3628 mdecorde
rm -rf "$APP/usr/lib/TXM/$ARCHCODE"
58 728 mdecorde
if [ $? != 0 ]; then
59 840 mdecorde
	echo "** $APP: failed to get ${ARCH}bit binaries Linux $ARCHCODE files"
60 728 mdecorde
	exit 1;
61 728 mdecorde
fi
62 728 mdecorde
63 728 mdecorde
echo " clean"
64 3628 mdecorde
bash $DIRNAME/directoryCleaner.sh "$APP"
65 728 mdecorde
if [ $? != 0 ]; then
66 840 mdecorde
	echo "** $APP: failed to clean Debian package $APP"
67 728 mdecorde
	exit 1;
68 728 mdecorde
fi
69 728 mdecorde
70 730 mdecorde
# for multi installation: set the package version to txm-$VERSION
71 840 mdecorde
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
72 840 mdecorde
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
73 2859 mdecorde
find "$APP/DEBIAN/postrm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
74 1214 mdecorde
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSIONWITHOUTSUB/${VERSIONWITHOUTSUB}/g" {} \;
75 840 mdecorde
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
76 1199 mdecorde
find "$APP/DEBIAN/control" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
77 1199 mdecorde
78 817 mdecorde
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
79 817 mdecorde
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
80 1199 mdecorde
81 1199 mdecorde
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
82 1199 mdecorde
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
83 1199 mdecorde
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
84 1199 mdecorde
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
85 817 mdecorde
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop"
86 817 mdecorde
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop"
87 1199 mdecorde
88 730 mdecorde
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
89 1199 mdecorde
90 1199 mdecorde
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
91 730 mdecorde
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
92 817 mdecorde
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION"
93 728 mdecorde
94 728 mdecorde
# build
95 728 mdecorde
sudo fakeroot dpkg-deb --build "$APP"
96 2800 mdecorde
#add "--faked faked-tcp" when called from windows WSL
97 728 mdecorde
if [ $? != 0 ]; then
98 728 mdecorde
	echo "** $APP: failed to build debian package $APP"
99 728 mdecorde
	exit 1;
100 728 mdecorde
fi
101 728 mdecorde
102 728 mdecorde
rm -f "${APP}_installer.deb"
103 728 mdecorde
mv $APP.deb ${APP}_installer.deb