Statistics
| Revision:

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

History | View | Annotate | Download (3.4 kB)

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