cleanup properly on uninstall
authorJeremy Laine <jeremy.laine@m4x.org>
Mon, 3 Feb 2003 03:26:09 +0000 (03:26 +0000)
committerJeremy Laine <jeremy.laine@m4x.org>
Mon, 3 Feb 2003 03:26:09 +0000 (03:26 +0000)
depview/debian/postinst
depview/debian/prerm [new file with mode: 0644]
depview/debian/rules

index 0bf8cde..eaa66f5 100644 (file)
@@ -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 (file)
index 0000000..3d9ce50
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh
+# prerm script for deptrack
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# 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
+
+
index 0125ffb..9cca393 100755 (executable)
@@ -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