+case $2 in
+POST-INSTALL)
+ USER=monkeysphere
+ GROUP=${USER}
+ UID=641
+ GID=${UID}
+ SHELL=/usr/local/bin/bash
+
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if oldshell=`pw user show "${USER}" 2>/dev/null`; then
+ if [ x"$oldshell" != x"$SHELL" ]; then
+ echo "You already have a \"${USER}\" user, but its shell is '$oldshell'."
+ echo "This package requires that \"${USER}\"'s shell be '$SHELL'."
+ echo "You should fix this by hand and then re-install the package."
+ echo " hint: pw usermod '$USER' -s '$SHELL'"
+ exit 1
+ fi
+ echo "You already have a user \"${USER}\" with the proper shell, so I will use it."
+ else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d "$VARLIB" -s /usr/local/bin/bash -c "monkeysphere authentication user,,,"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+
+ ## set up the cache directories:
+
+ install -d -o root -g monkeysphere -m 750 "$VARLIB"/gnupg-host
+ cat <<EOF > "$VARLIB"/gnupg-host/gpg.conf
+list-options show-uid-validity