Statistiques
| Révision :

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

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

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