Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Sep 2012 15:14:14 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r304038 - in head/net-mgmt/nrpe2: . files
Message-ID:  <201209101514.q8AFEEV6073676@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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}"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209101514.q8AFEEV6073676>