Bug 169918 - [PATCH] net-mgmt/nrpe2: Support USERS/GROUPS
Summary: [PATCH] net-mgmt/nrpe2: Support USERS/GROUPS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-16 21:50 UTC by Bryan Drewery
Modified: 2012-09-10 16:20 UTC (History)
0 users

See Also:


Attachments
patch-nrpe2-USERS-GROUPS.txt (3.41 KB, patch)
2012-07-16 21:50 UTC, Bryan Drewery
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Drewery 2012-07-16 21:50:12 UTC
	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.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-16 21:50:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

crees@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-16 21:50:29 UTC
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
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-16 21:50:31 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 jarrod 2012-07-23 11:12:06 UTC
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.
Comment 5 Chris Rees freebsd_committer freebsd_triage 2012-09-08 11:18:31 UTC
Responsible Changed
From-To: crees->bdrewery

I thought I'd already sent it back to you... sorry for the delay
Comment 6 Bryan Drewery freebsd_committer freebsd_triage 2012-09-09 16:36:08 UTC
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
Comment 7 jarrod 2012-09-10 12:29:47 UTC
Approved, with thanks - and an apology for the delay.

Jarrod.
Comment 8 dfilter service freebsd_committer freebsd_triage 2012-09-10 16:14:25 UTC
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"
Comment 9 Bryan Drewery freebsd_committer freebsd_triage 2012-09-10 16:15:18 UTC
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