home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 April
/
PCWorld_2001-04_cd.bin
/
Software
/
TemaCD
/
webclean
/
debian
/
postinst
< prev
next >
Wrap
Text File
|
2000-12-16
|
2KB
|
66 lines
#!/bin/sh
# postinst script for webcleaner
#
# see: dh_installdeb(1)
set -e
. /usr/share/debconf/confmodule
db_version 2.0
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see /usr/doc/packaging-manual/
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
package=webcleaner
DIRLIST="/usr/lib/python1.5/site-packages/webfilter /usr/lib/python1.5/site-packages/webparser"
FILELIST="WebCleanerConf.py"
SITEPACKAGES="/usr/lib/python1.5/site-packages"
COMMAND="'import sys,py_compile;py_compile.compile(sys.argv[1])'"
case "$1" in
configure|abort-upgrade|abort-remove|abort-deconfigure)
for i in $DIRLIST ; do
python -O /usr/lib/python1.5/compileall.py -q $i
python /usr/lib/python1.5/compileall.py -q $i
done
# use /bin/sh -c, otherwise I get a SyntaxError from Python
for i in $FILELIST; do
/bin/sh -c "python -O -c $COMMAND $SITEPACKAGES/$i"
/bin/sh -c "python -c $COMMAND $SITEPACKAGES/$i"
done
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
if [ "$1" = "configure" ]; then
. /usr/share/debconf/confmodule
db_version 2.0
db_get $package/port
test -n "$RET" || RET="8080"
sed -e "s/ port=.*/ port=\"$RET\"/" /etc/$package/$package.conf > /etc/$package/$package.conf.tmp
mv -f /etc/$package/$package.conf.tmp /etc/$package/$package.conf
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0