summaryrefslogtreecommitdiff
path: root/security/sudo/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'security/sudo/pkg')
-rw-r--r--security/sudo/pkg/DEINSTALL59
-rwxr-xr-xsecurity/sudo/pkg/INSTALL50
-rw-r--r--security/sudo/pkg/MESSAGE10
-rw-r--r--security/sudo/pkg/PLIST.common6
4 files changed, 122 insertions, 3 deletions
diff --git a/security/sudo/pkg/DEINSTALL b/security/sudo/pkg/DEINSTALL
new file mode 100644
index 00000000000..92722a32e51
--- /dev/null
+++ b/security/sudo/pkg/DEINSTALL
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1 2000/12/06 06:33:40 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+SAMPLECONFDIR=${PKG_PREFIX}/share/examples/sudo
+CONFDIR=/etc
+CONFFILES="sudoers"
+
+case ${STAGE} in
+DEINSTALL)
+ # Remove configuration files if they don't differ from the default
+ # config file.
+ #
+ for file in ${CONFFILES}
+ do
+ FILE=${CONFDIR}/${file}
+ SAMPLEFILE=${SAMPLECONFDIR}/${file}
+ if diff -q ${FILE} ${SAMPLEFILE} >/dev/null
+ then
+ rm -f ${FILE}
+ fi
+ done
+ ;;
+POST-DEINSTALL)
+ modified_files=''
+ for file in ${CONFFILES}
+ do
+ FILE=${CONFDIR}/${file}
+ if [ -f ${FILE} ]
+ then
+ modified_files="${modified_files} ${FILE}"
+ fi
+ done
+ if [ -n "${modified_files}" ]
+ then
+ cat << EOF
+===========================================================================
+If you won't be using ${PKGNAME} any longer, you may want to remove the
+following files:
+
+EOF
+ for file in ${modified_files}
+ do
+ echo " ${file}"
+ done
+ cat << EOF
+===========================================================================
+EOF
+ fi
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/security/sudo/pkg/INSTALL b/security/sudo/pkg/INSTALL
new file mode 100755
index 00000000000..f68c418762c
--- /dev/null
+++ b/security/sudo/pkg/INSTALL
@@ -0,0 +1,50 @@
+#! /bin/sh
+#
+# $NetBSD: INSTALL,v 1.3 2000/12/06 06:33:40 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+SAMPLECONFDIR=${PKG_PREFIX}/share/examples/sudo
+CONFDIR=/etc
+CONFFILES="sudoers"
+
+case ${STAGE} in
+PRE-INSTALL)
+ ;;
+POST-INSTALL)
+ echo "Installing configuration files:"
+ for file in ${CONFFILES}
+ do
+ FILE=${CONFDIR}/${file}
+ SAMPLEFILE=${SAMPLECONFDIR}/${file}
+ if [ -f ${FILE} ]
+ then
+ echo " ${FILE} already exists"
+ else
+ echo " ${FILE}"
+ cp ${SAMPLEFILE} ${FILE}
+ chown 0:0 ${FILE}
+ chmod 0440 ${FILE}
+ fi
+ done
+ cat << EOF
+===========================================================================
+Some files you might need to customize include the following:
+
+EOF
+ for file in ${CONFFILES}
+ do
+ FILE=${CONFDIR}/${file}
+ echo " ${FILE}"
+ done
+ cat << EOF
+===========================================================================
+EOF
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/security/sudo/pkg/MESSAGE b/security/sudo/pkg/MESSAGE
new file mode 100644
index 00000000000..f1ff8fa5979
--- /dev/null
+++ b/security/sudo/pkg/MESSAGE
@@ -0,0 +1,10 @@
+=============================================================================
+$NetBSD: MESSAGE,v 1.1 2000/12/06 06:33:40 jlam Exp $
+
+If you are upgrading from a version of sudo prior to 1.6, then please read
+
+ @PREFIX@/share/doc/sudo/UPGRADE
+
+on how to modify your sudoers file appropriately.
+
+=============================================================================
diff --git a/security/sudo/pkg/PLIST.common b/security/sudo/pkg/PLIST.common
index 4e08e1687ac..448bb7f86ab 100644
--- a/security/sudo/pkg/PLIST.common
+++ b/security/sudo/pkg/PLIST.common
@@ -1,8 +1,8 @@
-@comment $NetBSD: PLIST.common,v 1.1 2000/07/26 15:12:10 veego Exp $
+@comment $NetBSD: PLIST.common,v 1.2 2000/12/06 06:33:40 jlam Exp $
bin/sudo
sbin/visudo
+share/doc/sudo/UPGRADE
share/examples/sudo/sudoers
-@exec if [ ! -f /etc/sudoers ]; then cp %D/%F /etc/sudoers; fi; chown 0:0 /etc/sudoers; chmod 0440 /etc/sudoers
-@unexec echo "If you won't be using the sudo package anymore, you may want to manually delete /etc/sudoers."
share/examples/sudo/sudoers.sample
@dirrm share/examples/sudo
+@dirrm share/doc/sudo