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