root / tmp / org.txm.setups / BuildLinux64bit.sh @ 1603
Historique | Voir | Annoter | Télécharger (3,42 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/config && |
| 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/bin/TXM" "$APP/usr/bin/TXM-$VERSION" |
| 74 |
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION" |
| 75 |
|
| 76 |
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
|
| 77 |
find "$APP/usr/share/applications/TXM.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 |
find "$APP/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
|
| 80 |
mv "$APP/usr/share/applications/TXM.desktop" "$APP/usr/share/applications/TXM-$VERSION.desktop" |
| 81 |
mv "$APP/usr/share/applications/TXM debug.desktop" "$APP/usr/share/applications/TXM-$VERSION debug.desktop" |
| 82 |
|
| 83 |
mv "$APP/usr/share/doc/txm" "$APP/usr/share/doc/txm-$VERSION" |
| 84 |
|
| 85 |
find "$APP/usr/share/lintian/overrides/txm" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
|
| 86 |
mv "$APP/usr/share/lintian/overrides/txm" "$APP/usr/share/lintian/overrides/txm-$VERSION" |
| 87 |
mv "$APP/usr/share/TXM" "$APP/usr/share/TXM-$VERSION" |
| 88 |
|
| 89 |
# build |
| 90 |
sudo fakeroot dpkg-deb --build "$APP" |
| 91 |
if [ $? != 0 ]; then |
| 92 |
echo "** $APP: failed to build debian package $APP" |
| 93 |
exit 1; |
| 94 |
fi |
| 95 |
|
| 96 |
rm -f "${APP}_installer.deb"
|
| 97 |
mv $APP.deb ${APP}_installer.deb
|