Statistiques
| Révision :

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

Historique | Voir | Annoter | Télécharger (4,45 ko)

1
VERSION=`cat VERSION`
2
STEP=$1
3
ARCH="64"
4
ARCHCODE="x86_64"
5
APP="TXM_${VERSION}_Linux${ARCH}"
6

    
7
rm -rf "$APP"
8
mkdir "$APP"
9

    
10
echo purge | sudo debconf-communicate txm
11
echo purge | sudo debconf-communicate TXM
12

    
13
# ensure postinst preinst ... rights
14
chmod 644 shared/debian/DEBIAN/templates &&
15
chmod 755 shared/debian/DEBIAN/config &&
16
chmod 755 shared/debian/DEBIAN/postinst &&
17
chmod 755 shared/debian/DEBIAN/postrm &&
18
chmod 755 shared/debian/DEBIAN/preinst &&
19
chmod 755 shared/debian/usr/bin/TXM*
20
if [ $? != 0 ]; then
21
	echo "** $APP: failed to set rights of postinst preinst ... files "
22
	exit 1;
23
fi
24

    
25
# ensure JRE files are here
26
if [ ! -d "shared/debian/usr/lib/TXM/jre/bin" ]; then
27
	echo "** $APP: JRE files are missing."
28
	exit 1;
29
fi
30

    
31
# copy debian shared files: INSTALL, R libs...
32
rsync -r  --exclude '.svn' shared/debian/* "$APP"
33
if [ $? != 0 ]; then
34
	echo "** $APP: failed to get 'debian' shared files"
35
	exit 1;
36
fi
37

    
38
# copy shared files: css, xsl, scripts, samples...
39
rsync -r  --exclude '.svn' shared/all/* "$APP/usr/lib/TXM"
40
if [ $? != 0 ]; then
41
	echo "** $APP: failed to get shared files"
42
	exit 1;
43
fi
44

    
45
# remove old profile that can contains unwanted repositories
46
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
47
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
48
if [ $? != 0 ]; then
49
	echo "** $APP: failed to remove p2 preferences"
50
	exit 1;
51
fi
52

    
53
# copy eclise arch dependent build
54
rsync -r  --exclude '.svn' "exportRCP/linux.gtk.${ARCHCODE}/TXM" "$APP/usr/lib"
55
if [ $? != 0 ]; then
56
	echo "** $APP: failed to get ${ARCH}bit binaries linux $ARCHCODE files"
57
	exit 1;
58
fi
59

    
60
echo " clean"
61
bash directoryCleaner.sh "$APP"
62
if [ $? != 0 ]; then
63
	echo "** $APP: failed to clean debian package $APP"
64
	exit 1;
65
fi
66

    
67
# for multi installation: set the package version to txm-$VERSION
68
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM_$VERSION/g" {} \;
69
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM_$VERSION/g" {} \;
70
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM_$VERSION/g" {} \;
71
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/applications\/TXM.desktop/\/usr\/share\/applications\/TXM_$VERSION.desktop/g" {} \;
72
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/applications\/TXM debug.desktop/\/usr\/share\/applications\/TXM_$VERSION debug.desktop/g" {} \;
73
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/doc\/txm/\/usr\/share\/doc\/txm-$VERSION/g" {} \;
74
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/lintiant\/overrides\/txm/\/usr\/share\/lintiant\/overrides\/txm-$VERSION/g" {} \;
75
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM_$VERSION/g" {} \;
76
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXM\&/TXM-{VERSION}\&/g" {} \;
77
find "$APP/DEBIAN/control" -type f -exec sed -i "s/Package: txm/Package: txm-${VERSION}/g" {} \;
78
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM_$VERSION/g" {} \;
79
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/\$HOME\/TXM/\$HOME\/TXM_$VERSION/g" {} \;
80
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM_$VERSION"
81
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM_$VERSION"
82
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM_$VERSION/g" {} \;
83
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM_$VERSION/g" {} \;
84
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM_$VERSION/g" {} \;
85
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM_$VERSION/g" {} \;
86
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM_$VERSION.desktop"
87
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM_$VERSION debug.desktop"
88
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
89
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/txm binary/txm-$VERSION binary/g" {} \;
90
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
91
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM_$VERSION"
92

    
93
# build
94
sudo fakeroot dpkg-deb --build "$APP"
95
if [ $? != 0 ]; then
96
	echo "** $APP: failed to build debian package $APP"
97
	exit 1;
98
fi
99

    
100
rm -f "${APP}_installer.deb"
101
mv $APP.deb ${APP}_installer.deb
102