#!/bin/sh -e

# Copyright 2009, Noah Slater <nslater@tumbolia.org>

# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved.

VERSION=%VERSION%

case $1 in
    purge)
        if test -d "/etc/couchdb"; then
            rm -r -f "/etc/couchdb" 
        fi
        if test -d "/var/lib/couchdb"; then
            rm -r -f "/var/lib/couchdb" 
        fi
        if test -d "/var/log/couchdb"; then
            rm -r -f "/var/log/couchdb" 
        fi
        if test -d "/var/run/couchdb"; then
            rm -r -f "/var/run/couchdb" 
        fi
        if getent passwd couchdb > /dev/null && which deluser > /dev/null; then
            deluser couchdb
        fi
        if getent group couchdb > /dev/null && which delgroup > /dev/null; then
            delgroup couchdb
        fi
        ;;
esac

#DEBHELPER#
