work on maintainer scripts:
authorJameson Graef Rollins <jrollins@finestructure.net>
Sat, 28 Feb 2009 18:07:36 +0000 (13:07 -0500)
committerJameson Graef Rollins <jrollins@finestructure.net>
Sat, 28 Feb 2009 18:07:36 +0000 (13:07 -0500)
- remove preinst and prerm because they were empty
- put everything in postint into 'config' argument, since that's
  really what it is
- make sure deletion of monkeysphere user is correct, based on what we
  found here: http://wiki.debian.org/AccountHandlingInMaintainerScripts

packaging/debian/changelog
packaging/debian/monkeysphere.postinst
packaging/debian/monkeysphere.postrm
packaging/debian/monkeysphere.preinst [deleted file]
packaging/debian/monkeysphere.prerm [deleted file]

index 58a80a3b0975cec16a9d1f469a02a1bf496fd3f1..46f7863032f9589b77e413be31bc45ebaf4d4999 100644 (file)
@@ -1,9 +1,10 @@
 monkeysphere (0.24~pre-1) UNRELEASED; urgency=low
 
+  * update/cleanup mainterscripts
   * New upstream release:
     - Fixed how version information is stored/retrieved.
 
- -- Jameson Graef Rollins <jrollins@finestructure.net>  Sun, 22 Feb 2009 12:02:06 -0500
+ -- Jameson Graef Rollins <jrollins@finestructure.net>  Sat, 28 Feb 2009 13:02:57 -0500
 
 monkeysphere (0.23.1-1) unstable; urgency=low
 
index 3d0d66ff1417a365dd9bf0f1b4f2351a75c22bc2..bbb02cfd0c658300057d5c94b89c9a8e8575fa00 100755 (executable)
@@ -7,21 +7,25 @@
 
 VARLIB="/var/lib/monkeysphere"
 
-# add a monkeysphere user if one does not already exist
-if ! getent passwd monkeysphere >/dev/null ; then
-    echo "adding monkeysphere user..."
-    adduser --quiet --system --no-create-home --group \
-       --home "$VARLIB" \
-       --shell '/bin/bash' \
-       --gecos 'monkeysphere authentication user,,,' \
-       monkeysphere
-fi
-
-# try to transition from to 0.23:
-/usr/share/monkeysphere/transitions/0.23
-
-# setup monkeysphere authentication
-monkeysphere-authentication setup
+case $1 in
+    configure)
+       # add a monkeysphere user if one does not already exist
+       if ! getent passwd monkeysphere >/dev/null ; then
+           echo "adding monkeysphere user..."
+           adduser --quiet --system --no-create-home --group \
+               --home "$VARLIB" \
+               --shell '/bin/bash' \
+               --gecos 'monkeysphere authentication user,,,' \
+               monkeysphere
+       fi
+
+       # try to transition from to 0.23:
+       /usr/share/monkeysphere/transitions/0.23
+
+       # setup monkeysphere authentication
+       monkeysphere-authentication setup
+       ;;
+esac
 
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
index 79f7245c738411594df1e4d61c496bc0f3cee9eb..e70a1b1824aca5b6156be9daffe41f7c9a08fa15 100755 (executable)
@@ -7,8 +7,13 @@
 
 case $1 in
     purge)
-        echo "removing monkeysphere user..."
-        userdel monkeysphere > /dev/null || true
+       # delete monkeysphere user
+       # http://wiki.debian.org/AccountHandlingInMaintainerScripts
+       if type deluser >/dev/null 2>&1; then
+           deluser --quiet --system monkeysphere > /dev/null || true
+       else
+           echo >&2 "not removing monkeysphere system account because deluser command was not found"
+       fi
         ;;
 esac
 
diff --git a/packaging/debian/monkeysphere.preinst b/packaging/debian/monkeysphere.preinst
deleted file mode 100755 (executable)
index fd22f6f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh -e
-
-# preinst script for monkeysphere
-
-# Author: Jameson Rollins <jrollins@finestructure.net>
-# Copyright 2008-2009
-
-ETC="/etc/monkeysphere"
-
-# move the old server conf file to be the authentication conf file
-if [ -f "$ETC"/monkeysphere-server.conf -a \
-    ! -f "$ETC"/monkeysphere-authentication.conf ] ; then
-    mv "$ETC"/monkeysphere-server.conf "$ETC"/monkeysphere-authentication.conf
-fi
-
-# remove the old gpg-*.conf files
-rm -f "$ETC"/gpg-host.conf
-rm -f "$ETC"/gpg-authentication.conf
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/packaging/debian/monkeysphere.prerm b/packaging/debian/monkeysphere.prerm
deleted file mode 100755 (executable)
index 5835f53..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh -e
-
-# prerm script for monkeysphere
-
-# Author: Jameson Rollins <jrollins@finestructure.net>
-# Copyright 2008-2009
-
-true
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0