Deb postinstall generates optimized files

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@71 014f5005-505e-4b48-8d0a-63407b615a7c
master
LtWorf 2008-12-09 17:24:24 +07:00
parent 0a16e41a14
commit a9ac98e7bb
3 changed files with 25 additions and 9 deletions

@ -49,4 +49,5 @@
0.8
- Added __eq__ to relation object, will compare ignoring order.
- New default relation's format is csv, as defined in RFC4180
- Converted sample's relations to csv
- Converted sample's relations to csv
- Deb postinstall generates optimized files

@ -45,7 +45,7 @@ debian:
echo "This program is under the GPLv3 license" >> data/usr/share/doc/relational/copyright
cp CHANGELOG data/usr/share/doc/relational/changelog
echo "relational ("`./relational.py -v | cut -d. -f1`":"`./relational.py -v`") unstable; urgency=low" >> data/usr/share/doc/relational/changelog.Debian
echo "relational ("`./relational.py -v | cut -d. -f1`":"`./relational.py -v`+SVN`svn update | cut -d" " -f3 | tr -d "."`") unstable; urgency=low" >> data/usr/share/doc/relational/changelog.Debian
echo "" >> data/usr/share/doc/relational/changelog.Debian
echo " * Automatically generated package, see changelog.gz" >> data/usr/share/doc/relational/changelog.Debian
echo "" >> data/usr/share/doc/relational/changelog.Debian
@ -77,10 +77,10 @@ debian:
mkdir -p data/DEBIAN
#package description
echo "Package: relational" >> data/DEBIAN/control
echo "Version: "`./relational.py -v | cut -d. -f1`":"`./relational.py -v` >> data/DEBIAN/control
echo "Version: "`./relational.py -v | cut -d. -f1`":"`./relational.py -v`+SVN`svn update | cut -d" " -f3 | tr -d "."`>> data/DEBIAN/control
echo "Architecture: all" >> data/DEBIAN/control
echo "Maintainer: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>" >> data/DEBIAN/control
echo "Installed-Size: "`du -bs --apparent-size data/ | cut -f1` >> data/DEBIAN/control
echo "Installed-Size: "`du -s --apparent-size data/ | cut -f1` >> data/DEBIAN/control
echo "Depends: python-qt4 (>= 4.0.1-5), python (>= 2.3)" >> data/DEBIAN/control
echo "Recommends: libqt4-webkit (>= 4.4.3-1)" >> data/DEBIAN/control
echo "Section: devel" >> data/DEBIAN/control
@ -89,8 +89,23 @@ debian:
echo "Description: Python implementation of Relational algebra.">> data/DEBIAN/control
echo " This program provides a GUI to execute relational algebra queries.">> data/DEBIAN/control
echo " It is meant to be used for educational purposes.">> data/DEBIAN/control
su -c "chown -R root:root data/*; dpkg -b data/ relational.deb; rm -rf data/"
cp relational.deb relational_`./relational.py -v`.deb
rm -f relational.deb
#Postinst to generate optimized files
echo "#!/usr/bin/python" > data/DEBIAN/postinst
echo "import py_compile" >> data/DEBIAN/postinst
echo "import os" >> data/DEBIAN/postinst
printf "for i in os.listdir(\"/usr/share/python-support/relational/\"):\n" >> data/DEBIAN/postinst
printf " if i.endswith(\".py\"):\n" >> data/DEBIAN/postinst
printf " py_compile.compile(\"/usr/share/python-support/relational/\"+i)\n" >> data/DEBIAN/postinst
#Postrm file to remove optimized generated python files
echo "#!/bin/sh" > data/DEBIAN/postrm
echo "set -e" >> data/DEBIAN/postrm
echo "rm -rf /usr/share/python-support/relational/" >> data/DEBIAN/postrm
echo "exit 0" >> data/DEBIAN/postrm
chmod 0755 data/DEBIAN/postrm data/DEBIAN/postinst
su -c "chown -R root:root data/*; dpkg -b data/ relational.deb; rm -rf data/"
cp relational.deb relational_`./relational.py -v`+SVN`svn update | cut -d" " -f3 | tr -d "."`.deb
rm -f relational.deb

@ -1,6 +1,6 @@
.TH "Relational" "1"
.SH "NAME"
relational \(em .Python implementation of Relational algebra.
relational \(em Python implementation of Relational algebra.
.SH "SYNOPSIS"
.PP
\fBrelational\fR [\-v\fR\fP]