Statistics
| Revision:

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

History | View | Annotate | Download (3.4 kB)

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
# remove old profile that can contains unwanted repositories
26
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
27
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
28
if [ $? != 0 ]; then
29
	echo "** $APP: failed to remove p2 preferences"
30
	exit 1;
31
fi
32

    
33
mkdir -p "$APP/usr/lib/TXM"
34

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

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

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

    
56
echo " clean"
57
bash directoryCleaner.sh "$APP"
58
if [ $? != 0 ]; then
59
	echo "** $APP: failed to clean Debian package $APP"
60
	exit 1;
61
fi
62

    
63
# for multi installation: set the package version to txm-$VERSION
64
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
65
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
66
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
67
find "$APP/DEBIAN/control" -type f -exec sed -i "s/Package: txm/Package: txm-${VERSION}/g" {} \;
68
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
69
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
70
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM-$VERSION/g" {} \;
71
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM-$VERSION/g" {} \;
72
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM-$VERSION/g" {} \;
73
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM-$VERSION/g" {} \;
74
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop"
75
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop"
76
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
77
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/txm binary/txm-$VERSION binary/g" {} \;
78
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
79
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION"
80

    
81
# build
82
sudo fakeroot dpkg-deb --build "$APP"
83
if [ $? != 0 ]; then
84
	echo "** $APP: failed to build debian package $APP"
85
	exit 1;
86
fi
87

    
88
rm -f "${APP}_installer.deb"
89
mv $APP.deb ${APP}_installer.deb