From: Jeremy Laine Date: Mon, 3 Feb 2003 03:26:09 +0000 (+0000) Subject: cleanup properly on uninstall X-Git-Tag: start~13 X-Git-Url: http://git.polytechnique.org/?p=old-projects.git;a=commitdiff_plain;h=f835b396747c3e5e883a5fb0000eb7340029a9d0 cleanup properly on uninstall --- diff --git a/depview/debian/postinst b/depview/debian/postinst index 0bf8cde..eaa66f5 100644 --- a/depview/debian/postinst +++ b/depview/debian/postinst @@ -27,12 +27,12 @@ set -e . /usr/share/debconf/confmodule CFG=/var/www/depview/include/config.inc.php -rm -f $CFG set_line() { echo "$@" >> $CFG; } case "$1" in configure) + rm -f $CFG db_get depview/db_host db_host="$RET" db_get depview/db_db @@ -47,6 +47,9 @@ case "$1" in set_line "mysql_connect(\"$db_host\",\"$db_user\",\"$db_passwd\");" set_line "mysql_select_db(\"$db_db\");" set_line "?>" + + chgrp www-data $CFG + chmod o-r $CFG ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/depview/debian/prerm b/depview/debian/prerm new file mode 100644 index 0000000..3d9ce50 --- /dev/null +++ b/depview/debian/prerm @@ -0,0 +1,40 @@ +#! /bin/sh +# prerm script for deptrack +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) +# install-info --quiet --remove /usr/info/deptrack.info.gz + rm -f /var/www/depview/include/config.inc.php + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/depview/debian/rules b/depview/debian/rules index 0125ffb..9cca393 100755 --- a/depview/debian/rules +++ b/depview/debian/rules @@ -8,7 +8,7 @@ # This is the debhelper compatibility version to use. export DH_COMPAT=4 - +destdir=debian/depview/var/www/depview CFLAGS = -Wall -g @@ -45,8 +45,7 @@ clean: rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. - #-$(MAKE) clean - + dh_clean install: build @@ -56,10 +55,8 @@ install: build dh_installdirs # Add here commands to install the package into debian/depview. - #$(MAKE) install DESTDIR=$(CURDIR)/debian/depview - - cp *.php debian/depview/var/www/depview - cp include/*.php debian/depview/var/www/depview/include + cp index.php file.php list.php depview.css $(destdir) + cp include/header.inc.php include/footer.inc.php $(destdir)/include # Build architecture-independent files here. binary-indep: build install @@ -68,22 +65,16 @@ binary-indep: build install dh_installdebconf dh_installdocs dh_installexamples -# dh_installmenu # dh_installlogrotate # dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit # dh_installcron # dh_installman # dh_installinfo -# dh_undocumented dh_installchangelogs ChangeLog # dh_link # dh_strip dh_compress dh_fixperms -# dh_makeshlibs dh_installdeb # dh_perl dh_gencontrol