Statistiques
| Révision :

root / tmp / org.txm.setups / BuildLinux64bit.sh @ 775

Historique | Voir | Annoter | Télécharger (4,45 ko)

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