From: Jameson Graef Rollins Date: Sat, 28 Feb 2009 18:07:36 +0000 (-0500) Subject: work on maintainer scripts: X-Git-Tag: monkeysphere_0.24~54 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=54abd85dc6b4c54a99644eec21ce51635012ea8b;p=monkeysphere.git work on maintainer scripts: - 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 --- diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 58a80a3..46f7863 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -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 Sun, 22 Feb 2009 12:02:06 -0500 + -- Jameson Graef Rollins Sat, 28 Feb 2009 13:02:57 -0500 monkeysphere (0.23.1-1) unstable; urgency=low diff --git a/packaging/debian/monkeysphere.postinst b/packaging/debian/monkeysphere.postinst index 3d0d66f..bbb02cf 100755 --- a/packaging/debian/monkeysphere.postinst +++ b/packaging/debian/monkeysphere.postinst @@ -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. diff --git a/packaging/debian/monkeysphere.postrm b/packaging/debian/monkeysphere.postrm index 79f7245..e70a1b1 100755 --- a/packaging/debian/monkeysphere.postrm +++ b/packaging/debian/monkeysphere.postrm @@ -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 index fd22f6f..0000000 --- a/packaging/debian/monkeysphere.preinst +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -e - -# preinst script for monkeysphere - -# Author: Jameson Rollins -# 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 index 5835f53..0000000 --- a/packaging/debian/monkeysphere.prerm +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e - -# prerm script for monkeysphere - -# Author: Jameson Rollins -# Copyright 2008-2009 - -true - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0