Statistics
| Revision:

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

History | View | Annotate | Download (3.5 kB)

1
VERSIONWITHOUTSUB=`cat VERSION`
2
SUBVERSION=`cat SUBVERSION`
3
VERSION=${VERSIONWITHOUTSUB}${SUBVERSION}
4

    
5
STEP=$1
6
ARCH="64"
7
ARCHCODE="x86_64"
8
TIMESTAMP=`date +"%Y-%m-%d"`
9
APP="TXM_${VERSION}_${TIMESTAMP}_Linux${ARCH}"
10

    
11
rm -rf "$APP"
12
mkdir "$APP"
13

    
14
echo purge | sudo debconf-communicate txm
15
echo purge | sudo debconf-communicate TXM
16

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

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

    
36
mkdir -p "$APP/usr/lib/TXM"
37

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

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

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

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

    
66
# for multi installation: set the package version to txm-$VERSION
67
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
68
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
69
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSIONWITHOUTSUB/${VERSIONWITHOUTSUB}/g" {} \;
70
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
71
find "$APP/DEBIAN/control" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
72

    
73
mv "$APP/usr/lib/TXM/launcher.ini" "$APP/usr/lib/TXM/TXM.ini"
74
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
75
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
76

    
77

    
78
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
79
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
80
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
81
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
82
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop"
83
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop"
84

    
85
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION"
86

    
87
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
88
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION"
89
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION"
90

    
91
# build
92
sudo fakeroot dpkg-deb --build "$APP"
93
#add "--faked faked-tcp" when called from windows WSL
94
if [ $? != 0 ]; then
95
	echo "** $APP: failed to build debian package $APP"
96
	exit 1;
97
fi
98

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