From b498f61e68f8afcbc7bf46787cada7a53e4e07d9 Mon Sep 17 00:00:00 2001 From: LtWorf Date: Thu, 26 Feb 2009 12:58:20 +0000 Subject: [PATCH] moved some scripts outside the makefile git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@92 014f5005-505e-4b48-8d0a-63407b615a7c --- Makefile | 6 ++++-- debscript/gencontrol.sh | 7 +++++-- debscript/postinst | 6 ++++++ debscript/prerm | 10 ++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 debscript/postinst create mode 100644 debscript/prerm diff --git a/Makefile b/Makefile index fadb8d4..f12103b 100644 --- a/Makefile +++ b/Makefile @@ -76,10 +76,12 @@ debian: mkdir -p data/DEBIAN #package description - debscript/gencontrol.sh data/DEBIAN/control + debscript/gencontrol.sh > data/DEBIAN/control + cp debscript/rules data/DEBIAN #Postrm file to remove optimized generated python files - #cp debscript/prerm data/DEBIAN/prerm + cp debscript/prerm data/DEBIAN/prerm + cp debscript/postinst data/DEBIAN/postinst chmod 0755 data/DEBIAN/prerm data/DEBIAN/postinst diff --git a/debscript/gencontrol.sh b/debscript/gencontrol.sh index 4746b58..a471a33 100755 --- a/debscript/gencontrol.sh +++ b/debscript/gencontrol.sh @@ -1,8 +1,9 @@ #!/bin/bash - echo "Version: "`../relational.py -v | cut -d. -f1`":"`../relational.py -v`+SVN`svn update | cut -d" " -f3 | tr -d "."` + echo "Package: relational" + echo "Version: "`./relational.py -v | cut -d. -f1`":"`./relational.py -v`+SVN`svn update | cut -d" " -f3 | tr -d "."` echo "Architecture: all" echo "Maintainer: Salvo 'LtWorf' Tomaselli " - echo "Installed-Size: "`du -s --apparent-size ../data/ | cut -f1` + echo "Installed-Size: "`du -s --apparent-size data/ | cut -f1` echo "Depends: python-qt4 (>= 4.0.1-5), python (>= 2.3), debhelper (>= 5.0.38), python-central (>= 0.5.6), ttf-dejavu-core (>= 2.25-3)" echo "Recommends: libqt4-webkit (>= 4.4.3-1)" echo "Section: devel" @@ -11,3 +12,5 @@ echo "Description: Python implementation of Relational algebra." echo " This program provides a GUI to execute relational algebra queries." echo " It is meant to be used for educational purposes." +echo "" +echo "" diff --git a/debscript/postinst b/debscript/postinst new file mode 100644 index 0000000..8e316b6 --- /dev/null +++ b/debscript/postinst @@ -0,0 +1,6 @@ +#!/usr/bin/python +import py_compile +import os +for i in os.listdir("/usr/share/python-support/relational/"): + if i.endswith(".py"): + py_compile.compile("/usr/share/python-support/relational/"+i) diff --git a/debscript/prerm b/debscript/prerm new file mode 100644 index 0000000..8865c44 --- /dev/null +++ b/debscript/prerm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +case $1 in + remove) + rm -rf /usr/share/python-support/relational/;; +esac + +exit 0 +