Statistiques
| Révision :

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

Historique | Voir | Annoter | Télécharger (3,55 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 2241 mdecorde
TIMESTAMP=`date +"%Y-%m-%d"`
9 2241 mdecorde
APP="TXM_${VERSION}_${TIMESTAMP}_Linux${ARCH}"
10 728 mdecorde
11 728 mdecorde
rm -rf "$APP"
12 728 mdecorde
mkdir "$APP"
13 728 mdecorde
14 728 mdecorde
echo purge | sudo debconf-communicate txm
15 728 mdecorde
echo purge | sudo debconf-communicate TXM
16 728 mdecorde
17 728 mdecorde
# ensure postinst preinst ... rights
18 728 mdecorde
chmod 644 shared/debian/DEBIAN/templates &&
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 2859 mdecorde
find "$APP/DEBIAN/postrm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
70 1214 mdecorde
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSIONWITHOUTSUB/${VERSIONWITHOUTSUB}/g" {} \;
71 840 mdecorde
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
72 1199 mdecorde
find "$APP/DEBIAN/control" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
73 1199 mdecorde
74 817 mdecorde
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
75 817 mdecorde
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
76 1199 mdecorde
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.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 1199 mdecorde
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
81 817 mdecorde
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop"
82 817 mdecorde
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop"
83 1199 mdecorde
84 730 mdecorde
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
85 1199 mdecorde
86 1199 mdecorde
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
87 730 mdecorde
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
88 817 mdecorde
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION"
89 728 mdecorde
90 728 mdecorde
# build
91 728 mdecorde
sudo fakeroot dpkg-deb --build "$APP"
92 2800 mdecorde
#add "--faked faked-tcp" when called from windows WSL
93 728 mdecorde
if [ $? != 0 ]; then
94 728 mdecorde
	echo "** $APP: failed to build debian package $APP"
95 728 mdecorde
	exit 1;
96 728 mdecorde
fi
97 728 mdecorde
98 728 mdecorde
rm -f "${APP}_installer.deb"
99 728 mdecorde
mv $APP.deb ${APP}_installer.deb