summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorjlam <jlam>2000-12-06 06:33:39 +0000
committerjlam <jlam>2000-12-06 06:33:39 +0000
commit5b1651979e99e9bc625753e971fc692d2ea77d28 (patch)
tree7ee66f7dc854da669e4e9b70a00b77e3c575d3ca /security
parente2ba998ebc5adf2ef04ca5c21feffcdf9e9da5e6 (diff)
downloadpkgsrc-5b1651979e99e9bc625753e971fc692d2ea77d28.tar.gz
* Cosmetic changes to Makefile.
* Use DEINSTALL/INSTALL scripts to handle config files. * Install the UPGRADE file and add a MESSAGE file to refer to it, instead of spewing a big file every time sudo is installed.
Diffstat (limited to 'security')
-rw-r--r--security/sudo/Makefile69
-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
5 files changed, 159 insertions, 35 deletions
diff --git a/security/sudo/Makefile b/security/sudo/Makefile
index 33bd979753b..305a3ff0186 100644
--- a/security/sudo/Makefile
+++ b/security/sudo/Makefile
@@ -1,61 +1,66 @@
-# $NetBSD: Makefile,v 1.26 2000/12/05 18:30:05 jlam Exp $
+# $NetBSD: Makefile,v 1.27 2000/12/06 06:33:39 jlam Exp $
# FreeBSD Id: Makefile,v 1.9 1997/11/12 03:24:41 obrien Exp
#
-DISTNAME= sudo-1.6.3p5
-CATEGORIES= security
-MASTER_SITES= http://www.courtesan.com/sudo/dist/ \
- ftp://ftp.courtesan.com/pub/sudo/ \
- ftp://ftp.cs.colorado.edu/pub/sudo/ \
- ftp://ftp.uu.net/pub/security/sudo/ \
- ftp://ftp.tux.org/pub/security/sudo/
+DISTNAME= sudo-1.6.3p5
+CATEGORIES= security
+MASTER_SITES= http://www.courtesan.com/sudo/dist/ \
+ ftp://ftp.courtesan.com/pub/sudo/ \
+ ftp://ftp.cs.colorado.edu/pub/sudo/ \
+ ftp://ftp.uu.net/pub/security/sudo/ \
+ ftp://ftp.tux.org/pub/security/sudo/
-MAINTAINER= packages@netbsd.org
-HOMEPAGE= http://www.courtesan.com/sudo/
+MAINTAINER= packages@netbsd.org
+HOMEPAGE= http://www.courtesan.com/sudo/
-BUILD_DEPENDS+= ${LOCALBASE}/bin/autoconf:../../devel/autoconf
+BUILD_DEPENDS+= ${LOCALBASE}/bin/autoconf:../../devel/autoconf
.include "../../mk/bsd.prefs.mk"
-GNU_CONFIGURE= yes
+GNU_CONFIGURE= # defined
.if ${OPSYS} == "NetBSD"
-CONFIGURE_ARGS+=--with-skey
+CONFIGURE_ARGS+= --with-skey
.elif ${OPSYS} == "SunOS"
-CONFIGURE_ARGS+=--without-skey
+CONFIGURE_ARGS+= --without-skey
.endif
.if defined(KERBEROS) && ${KERBEROS} == 4
-USE_KERBEROS= yes
-CONFIGURE_ARGS+=--with-kerb4
+USE_KERBEROS= # defined
+CONFIGURE_ARGS+= --with-kerb4
.else
-CONFIGURE_ARGS+=--without-kerb4
+CONFIGURE_ARGS+= --without-kerb4
.endif
.if defined(KERBEROS) && ${KERBEROS} == 5
-USE_KERBEROS= yes
-CONFIGURE_ARGS+=--with-kerb5
+USE_KERBEROS= # defined
+CONFIGURE_ARGS+= --with-kerb5
.else
-CONFIGURE_ARGS+=--without-kerb5
+CONFIGURE_ARGS+= --without-kerb5
.endif
-CONFIGURE_ARGS+=--with-nbsdops --disable-path-info
+CONFIGURE_ARGS+= --with-nbsdops --disable-path-info
-PLIST_SRC= ${WRKDIR}/.PLIST_SRC
+PLIST_SRC= ${PKGDIR}/PLIST.common
+PLIST_SRC+= ${PKGDIR}/PLIST.${LOWER_OPSYS}
+MESSAGE_FILE= ${WRKDIR}/MESSAGE
-# The UPGRADE file has important information on upgrading from a previous
-# version of sudo.
-#
-MESSAGE_FILE= ${WRKSRC}/UPGRADE
+DOCDIR= ${PREFIX}/share/doc/sudo
+EGDIR= ${PREFIX}/share/examples/sudo
pre-configure:
- cd ${WRKSRC}; ${LOCALBASE}/bin/autoconf
+ cd ${WRKSRC} && autoconf
+
+post-build:
+ ${SED} -e "s,@PREFIX@,${PREFIX},g" \
+ < ${PKGDIR}/MESSAGE > ${MESSAGE_FILE}
post-install:
- ${CAT} ${PKGDIR}/PLIST.common ${PKGDIR}/PLIST.${LOWER_OPSYS} > ${PLIST_SRC}
- ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/sudo
- ${INSTALL_DATA} ${WRKSRC}/sudoers ${PREFIX}/share/examples/sudo/sudoers
- ${INSTALL_DATA} ${WRKSRC}/sample.sudoers \
- ${PREFIX}/share/examples/sudo/sudoers.sample
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/UPGRADE ${DOCDIR}
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/sudoers ${EGDIR}/sudoers
+ ${INSTALL_DATA} ${WRKSRC}/sample.sudoers ${EGDIR}/sudoers.sample
+ PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
.include "../../mk/bsd.pkg.mk"
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