Statistics
| Revision:

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

History | View | Annotate | Download (3.4 kB)

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 817 mdecorde
# remove old profile that can contains unwanted repositories
26 817 mdecorde
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
27 817 mdecorde
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
28 817 mdecorde
if [ $? != 0 ]; then
29 817 mdecorde
	echo "** $APP: failed to remove p2 preferences"
30 728 mdecorde
	exit 1;
31 728 mdecorde
fi
32 728 mdecorde
33 817 mdecorde
mkdir -p "$APP/usr/lib/TXM"
34 817 mdecorde
35 728 mdecorde
# copy debian shared files: INSTALL, R libs...
36 728 mdecorde
rsync -r  --exclude '.svn' shared/debian/* "$APP"
37 728 mdecorde
if [ $? != 0 ]; then
38 728 mdecorde
	echo "** $APP: failed to get 'debian' shared files"
39 728 mdecorde
	exit 1;
40 728 mdecorde
fi
41 728 mdecorde
42 728 mdecorde
# copy shared files: css, xsl, scripts, samples...
43 728 mdecorde
rsync -r  --exclude '.svn' shared/all/* "$APP/usr/lib/TXM"
44 728 mdecorde
if [ $? != 0 ]; then
45 728 mdecorde
	echo "** $APP: failed to get shared files"
46 728 mdecorde
	exit 1;
47 728 mdecorde
fi
48 728 mdecorde
49 728 mdecorde
# copy eclise arch dependent build
50 728 mdecorde
rsync -r  --exclude '.svn' "exportRCP/linux.gtk.${ARCHCODE}/TXM" "$APP/usr/lib"
51 728 mdecorde
if [ $? != 0 ]; then
52 840 mdecorde
	echo "** $APP: failed to get ${ARCH}bit binaries Linux $ARCHCODE files"
53 728 mdecorde
	exit 1;
54 728 mdecorde
fi
55 728 mdecorde
56 728 mdecorde
echo " clean"
57 728 mdecorde
bash directoryCleaner.sh "$APP"
58 728 mdecorde
if [ $? != 0 ]; then
59 840 mdecorde
	echo "** $APP: failed to clean Debian package $APP"
60 728 mdecorde
	exit 1;
61 728 mdecorde
fi
62 728 mdecorde
63 730 mdecorde
# for multi installation: set the package version to txm-$VERSION
64 840 mdecorde
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
65 840 mdecorde
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
66 840 mdecorde
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
67 730 mdecorde
find "$APP/DEBIAN/control" -type f -exec sed -i "s/Package: txm/Package: txm-${VERSION}/g" {} \;
68 817 mdecorde
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
69 817 mdecorde
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
70 817 mdecorde
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM-$VERSION/g" {} \;
71 817 mdecorde
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM-$VERSION/g" {} \;
72 817 mdecorde
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM-$VERSION/g" {} \;
73 817 mdecorde
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM-$VERSION/g" {} \;
74 817 mdecorde
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop"
75 817 mdecorde
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop"
76 730 mdecorde
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
77 730 mdecorde
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/txm binary/txm-$VERSION binary/g" {} \;
78 730 mdecorde
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
79 817 mdecorde
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION"
80 728 mdecorde
81 728 mdecorde
# build
82 728 mdecorde
sudo fakeroot dpkg-deb --build "$APP"
83 728 mdecorde
if [ $? != 0 ]; then
84 728 mdecorde
	echo "** $APP: failed to build debian package $APP"
85 728 mdecorde
	exit 1;
86 728 mdecorde
fi
87 728 mdecorde
88 728 mdecorde
rm -f "${APP}_installer.deb"
89 728 mdecorde
mv $APP.deb ${APP}_installer.deb