Adds proper USERS/GROUPS support without the need for interactive asking during install. Also removes redundant notices on deinstall already hanelded by bsd.port.mk.
Responsible Changed From-To: freebsd-ports-bugs->crees crees@ wants his PRs (via the GNATS Auto Assign Tool)
Maintainer of net-mgmt/nrpe2, Please note that PR ports/169918 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/169918 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Though some weeks old now, these changes are being included in the tidy up task mentioned in ports/168225. I'm aiming to have these out later in the week along with an updated patch for ports/169977. Jarrod.
Responsible Changed From-To: crees->bdrewery I thought I'd already sent it back to you... sorry for the delay
Jarrod, Do you approve the patch in 169918? Would be nice to get this committed before 9.1. 168225 can be done separately after adequate testing. Bryan
Approved, with thanks - and an apology for the delay. Jarrod.
Author: bdrewery Date: Mon Sep 10 15:14:14 2012 New Revision: 304038 URL: http://svn.freebsd.org/changeset/ports/304038 Log: - Switch to using USERS/GROUPS [1] - Convert to new options framework PR: ports/169918 [1] Submitted by: bdrewery Approved by: Jarrod Sayers <jarrod@downtools.com.au> (maintainer) [1] Approved by: eadler, bapt (mentors, implicit) Modified: head/net-mgmt/nrpe2/Makefile head/net-mgmt/nrpe2/files/pkg-deinstall.in head/net-mgmt/nrpe2/files/pkg-install.in Modified: head/net-mgmt/nrpe2/Makefile ============================================================================== --- head/net-mgmt/nrpe2/Makefile Mon Sep 10 13:33:08 2012 (r304037) +++ head/net-mgmt/nrpe2/Makefile Mon Sep 10 15:14:14 2012 (r304038) @@ -7,6 +7,7 @@ PORTNAME= nrpe DISTVERSION= 2.13 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/nagios/${PORTNAME}-2.x/${PORTNAME}-${PORTVERSION} @@ -22,14 +23,17 @@ USE_RC_SUBR= nrpe2 CONFLICTS= nrpe-1.* -OPTIONS= SSL "Enable SSL support (disables plain-text server)" off \ - ARGS "Enable command argument processing **Security Risk**" off +OPTIONS_DEFINE= SSL ARGS +SSL_DESC= Enable SSL support (disables plain-text server) +ARGS_DESC= Enable command argument processing **Security Risk** GNU_CONFIGURE= yes NAGIOSUSER?= nagios NAGIOSGROUP?= nagios NAGIOSDIR?= /var/spool/nagios +USERS= ${NAGIOSUSER} +GROUPS= ${NAGIOSGROUP} NAGIOSUID= 181 NAGIOSGID= ${NAGIOSUID} @@ -56,14 +60,14 @@ SUB_LIST= PREFIX=${PREFIX} \ .include <bsd.port.pre.mk> -.if defined(WITH_SSL) +.if ${PORT_OPTIONS:MSSL} .include "${PORTSDIR}/Mk/bsd.openssl.mk" CONFIGURE_ARGS+= --enable-ssl .else CONFIGURE_ARGS+= --disable-ssl .endif -.if defined(WITH_ARGS) +.if ${PORT_OPTIONS:MARGS} CONFIGURE_ARGS+= --enable-command-args .else CONFIGURE_ARGS+= --disable-command-args Modified: head/net-mgmt/nrpe2/files/pkg-deinstall.in ============================================================================== --- head/net-mgmt/nrpe2/files/pkg-deinstall.in Mon Sep 10 13:33:08 2012 (r304037) +++ head/net-mgmt/nrpe2/files/pkg-deinstall.in Mon Sep 10 15:14:14 2012 (r304038) @@ -4,18 +4,8 @@ # NAGIOSDIR=%%NAGIOSDIR%% -NAGIOSUSER=%%NAGIOSUSER%% -NAGIOSGROUP=%%NAGIOSGROUP%% if [ "$2" = "POST-DEINSTALL" ]; then - if /usr/sbin/pw group show "${NAGIOSGROUP}" 2>&1 >/dev/null; then - echo "You should manually remove the \"${NAGIOSGROUP}\" group." - fi - - if /usr/sbin/pw user show "${NAGIOSUSER}" 2>&1 >/dev/null; then - echo "You should manually remove the \"${NAGIOSUSER}\" user." - fi - if [ -e "${NAGIOSDIR}" ]; then echo "You should manually remove the \"${NAGIOSDIR}\" directory." fi Modified: head/net-mgmt/nrpe2/files/pkg-install.in ============================================================================== --- head/net-mgmt/nrpe2/files/pkg-install.in Mon Sep 10 13:33:08 2012 (r304037) +++ head/net-mgmt/nrpe2/files/pkg-install.in Mon Sep 10 15:14:14 2012 (r304038) @@ -9,69 +9,7 @@ NAGIOSGROUP=%%NAGIOSGROUP%% NAGIOSUID=%%NAGIOSUID%% NAGIOSGID=%%NAGIOSGID%% -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ "x${answer}" = "x" ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local default question answer - - question=$1 - default=$2 - while :; do - answer=$(ask "${question}" "${default}") - case "${answer}" in - [Yy][Ee][Ss]|[Yy]) - return 0 - ;; - [Nn][Oo]|[Nn]) - return 1 - ;; - esac - echo "Please answer yes or no." - done -} - -if [ "$2" = "PRE-INSTALL" ]; then - if /usr/sbin/pw group show "${NAGIOSGROUP}" 2>&1 >/dev/null; then - echo "You already have a \"${NAGIOSGROUP}\" group, so I will use it." - else - echo "You need a \"${NAGIOSGROUP}\" group." - if yesno "Would you like me to create it" "YES"; then - /usr/sbin/pw groupadd "${NAGIOSGROUP}" -g "${NAGIOSGID}" -h - || \ - /usr/sbin/pw groupadd "${NAGIOSGROUP}" -h - || exit - echo "Done." - else - echo "Please create the \"${NAGIOSGROUP}\" group manually and try again." - exit 1 - fi - fi - - if /usr/sbin/pw user show "${NAGIOSUSER}" 2>&1 >/dev/null; then - echo "You already have a \"${NAGIOSUSER}\" user, so I will use it." - else - echo "You need a \"${NAGIOSUSER}\" user." - if yesno "Would you like me to create it" "YES"; then - /usr/sbin/pw useradd "${NAGIOSUSER}" -u "${NAGIOSUID}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \ - -s /sbin/nologin -c "Nagios pseudo-user" || \ - /usr/sbin/pw useradd "${NAGIOSUSER}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \ - -s /sbin/nologin -c "Nagios pseudo-user" || exit - else - echo "Please create the \"${NAGIOSUSER}\" user manually and try again." - exit 1 - fi - fi -elif [ "$2" = "POST-INSTALL" ]; then +if [ "$2" = "POST-INSTALL" ]; then if [ ! -e "${NAGIOSDIR}" ]; then /bin/mkdir -p "${NAGIOSDIR}" /bin/chmod 775 "${NAGIOSDIR}" _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->closed Committed. Also updated to the new options framework as described here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-options.html