From owner-svn-ports-all@FreeBSD.ORG Mon Sep 10 15:14:15 2012 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4651D106564A; Mon, 10 Sep 2012 15:14:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2777E8FC12; Mon, 10 Sep 2012 15:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8AFEFTW073681; Mon, 10 Sep 2012 15:14:15 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8AFEEV6073676; Mon, 10 Sep 2012 15:14:14 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201209101514.q8AFEEV6073676@svn.freebsd.org> From: Bryan Drewery Date: Mon, 10 Sep 2012 15:14:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r304038 - in head/net-mgmt/nrpe2: . files X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2012 15:14:15 -0000 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 (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 -.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}"