From ohauer@FreeBSD.org  Thu Oct  3 22:14:20 2013
Return-Path: <ohauer@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 530DC74E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Oct 2013 22:14:20 +0000 (UTC)
	(envelope-from ohauer@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 3F8FB2336
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Oct 2013 22:14:20 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r93MEKeY029646
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 3 Oct 2013 22:14:20 GMT
	(envelope-from ohauer@freefall.freebsd.org)
Received: (from ohauer@localhost)
	by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r93MEKKZ029645;
	Thu, 3 Oct 2013 22:14:20 GMT
	(envelope-from ohauer)
Message-Id: <201310032214.r93MEKKZ029645@freefall.freebsd.org>
Date: Thu, 3 Oct 2013 22:14:20 GMT
From: ohauer@FreeBSD.org
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] net/tac_plus4 add stage support
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         182616
>Category:       ports
>Synopsis:       [patch] net/tac_plus4 add stage support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marcus
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 03 22:20:00 UTC 2013
>Closed-Date:    Sat Oct 12 16:45:37 UTC 2013
>Last-Modified:  Sat Oct 12 16:45:37 UTC 2013
>Originator:     ohauer
>Release:        FreeBSD 8.4-RELEASE-p4 amd64
>Organization:
>Environment:

>Description:
- add stage support
- use the framework to create the tacacs user
- MAKE_JOBS_UNSAFE=yes is also required for i386

patch: http://people.freebsd.org/~ohauer/diffs/stage/stage_tinderbox.diff

>How-To-Repeat:

>Fix:
--- stage_tac_plus4.diff begins here ---
Index: tac_plus4/Makefile
===================================================================
--- tac_plus4/Makefile	(revision 329239)
+++ tac_plus4/Makefile	(working copy)
@@ -18,17 +18,11 @@
 CONFIGURE_ARGS=	--with-groupid=$$(/usr/bin/id -g tacacs 2>/dev/null || echo '559') \
 		--with-userid=$$(/usr/bin/id -u tacacs 2>/dev/null || echo '559')
 
-MAN5=		tac_plus.conf.5
-MAN8=		tac_plus.8 tac_pwd.8
+USERS=		tacacs
+GROUPS=		tacacs
 
 CONFLICTS=	ru-tac+ia-[0-9]* tac_plus-libradius-[0-9]*
-
-NO_STAGE=	yes
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} == "amd64"
 MAKE_JOBS_UNSAFE=	yes
-.endif
 
 # check expiration dates against 'expire' field of master.passwd file
 .if defined(TAC_EXPIRE_MASTER_PASSWD)
@@ -51,14 +45,9 @@
 		${WRKSRC}/configure
 
 post-install:
-	${INSTALL_DATA} ${FILESDIR}/tac_plus.conf.example ${PREFIX}/etc
-.if !defined(PACKAGE_BUILDING)
-	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-.endif
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${PREFIX}/share/doc/tac_plus
-	${INSTALL_DATA} ${WRKSRC}/users_guide ${PREFIX}/share/doc/tac_plus
-	${INSTALL_SCRIPT} ${WRKSRC}/tac_convert ${PREFIX}/share/doc/tac_plus
-.endif
+	${INSTALL_DATA} ${FILESDIR}/tac_plus.conf.example ${STAGEDIR}${PREFIX}/etc
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/doc/tac_plus
+	${INSTALL_DATA} ${WRKSRC}/users_guide ${STAGEDIR}${PREFIX}/share/doc/tac_plus
+	${INSTALL_SCRIPT} ${WRKSRC}/tac_convert ${STAGEDIR}${PREFIX}/share/doc/tac_plus
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: tac_plus4/pkg-install
===================================================================
--- tac_plus4/pkg-install	(revision 329239)
+++ tac_plus4/pkg-install	(working copy)
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-case $2 in
-POST-INSTALL)
-	USER=tacacs
-	GROUP=${USER}
-	UID=559
-	GID=${UID}
-	PW=/usr/sbin/pw
-
-	if ${PW} group show "${GROUP}" 2>/dev/null; then
-		echo "You already have a group \"${GROUP}\", so I will use it."
-	else
-		if ${PW} groupadd ${GROUP} -g ${GID}; then
-			echo "Added group \"${GROUP}\"."
-		else
-			echo "Adding group \"${GROUP}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ${PW} user show "${USER}" 2>/dev/null; then
-		echo "You already have a user \"${USER}\", so I will use it."
-	else
-		if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-			-d "/nonexistent" -s /sbin/nologin -c "TACACS+ Daemon User"
-		then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	exit 0
-	;;
-esac
Index: tac_plus4/pkg-plist
===================================================================
--- tac_plus4/pkg-plist	(revision 329239)
+++ tac_plus4/pkg-plist	(working copy)
@@ -6,6 +6,9 @@
 lib/libtacacs.la
 lib/libtacacs.so
 lib/libtacacs.so.1
+man/man5/tac_plus.conf.5.gz
+man/man8/tac_plus.8.gz
+man/man8/tac_pwd.8.gz
 %%PORTDOCS%%%%DOCSDIR%%/tac_convert
 %%PORTDOCS%%%%DOCSDIR%%/users_guide
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
--- stage_tac_plus4.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->marcus 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Oct 3 22:20:07 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182616 
State-Changed-From-To: open->feedback 
State-Changed-By: marcus 
State-Changed-When: Fri Oct 4 03:04:10 UTC 2013 
State-Changed-Why:  
Thanks for this, but why did you change the way the man pages are installed? 
The way the port is installing man pages is in line with the recommendations 
in the porter's handbook. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182616 

From: olli hauer <ohauer@gmx.de>
To: bug-followup@FreeBSD.org, Joe Marcus Clarke <marcus@marcuscom.com>
Cc: ohauer@FreeBSD.org
Subject: Re: ports/182616: [patch] net/tac_plus4 add stage support
Date: Sat, 05 Oct 2013 00:24:27 +0200

 Hi Joe,
 
 if stage is enabled the old MAN* macros should be no longer used,
 therefore I removed MAN5 and MAN8.
 
 
 See:
 https://wiki.freebsd.org/ports/StageDir [1]
 http://svnweb.freebsd.org/changeset/ports/327910 [2]
 
 
 from [2]
 Unsupported macro if NO_STAGE is not set:
 - MAN* with staging man page compression and handling of hardlinks and
   symlinks is automatically done in the stage. the manpages becomes then a
   "normal" plist files and should be tracked in pkg-plist.
 
 -- 
 olli

From: Joe Marcus Clarke <marcus@marcuscom.com>
To: olli hauer <ohauer@gmx.de>, bug-followup@FreeBSD.org
Cc: ohauer@FreeBSD.org
Subject: Re: ports/182616: [patch] net/tac_plus4 add stage support
Date: Fri, 04 Oct 2013 20:39:21 -0400

 On 10/4/13 6:24 PM, olli hauer wrote:
 > Hi Joe,
 >
 > if stage is enabled the old MAN* macros should be no longer used,
 > therefore I removed MAN5 and MAN8.
 >
 >
 > See:
 > https://wiki.freebsd.org/ports/StageDir [1]
 > http://svnweb.freebsd.org/changeset/ports/327910 [2]
 >
 >
 > from [2]
 > Unsupported macro if NO_STAGE is not set:
 > - MAN* with staging man page compression and handling of hardlinks and
 >    symlinks is automatically done in the stage. the manpages becomes then a
 >    "normal" plist files and should be tracked in pkg-plist.
 >
 
 Ah, so stage essentially forces compressed man pages.  I think the 
 porter's handbook needs an update.
 
 Joe
 
 -- 
 PGP Key : http://www.marcuscom.com/pgp.asc

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/182616: commit references a PR
Date: Sat, 12 Oct 2013 16:38:12 +0000 (UTC)

 Author: marcus
 Date: Sat Oct 12 16:38:05 2013
 New Revision: 330138
 URL: http://svnweb.freebsd.org/changeset/ports/330138
 
 Log:
   * Add STAGE support
   * Use the USERS/GROUPS framework to create the tacacs user
   * Apparently, MAKE_JOB_UNSAFE is needed on i386 as well as amd64
   
   PR:		182616
   Submitted by:	ohauer
 
 Deleted:
   head/net/tac_plus4/pkg-install
 Modified:
   head/net/tac_plus4/Makefile
   head/net/tac_plus4/pkg-plist
 
 Modified: head/net/tac_plus4/Makefile
 ==============================================================================
 --- head/net/tac_plus4/Makefile	Sat Oct 12 16:33:59 2013	(r330137)
 +++ head/net/tac_plus4/Makefile	Sat Oct 12 16:38:05 2013	(r330138)
 @@ -18,17 +18,11 @@ USE_LDCONFIG=	yes
  CONFIGURE_ARGS=	--with-groupid=$$(/usr/bin/id -g tacacs 2>/dev/null || echo '559') \
  		--with-userid=$$(/usr/bin/id -u tacacs 2>/dev/null || echo '559')
  
 -MAN5=		tac_plus.conf.5
 -MAN8=		tac_plus.8 tac_pwd.8
 +USERS=		tacacs
 +GROUPS=		tacacs
  
  CONFLICTS=	ru-tac+ia-[0-9]* tac_plus-libradius-[0-9]*
 -
 -NO_STAGE=	yes
 -.include <bsd.port.pre.mk>
 -
 -.if ${ARCH} == "amd64"
  MAKE_JOBS_UNSAFE=	yes
 -.endif
  
  # check expiration dates against 'expire' field of master.passwd file
  .if defined(TAC_EXPIRE_MASTER_PASSWD)
 @@ -51,14 +45,9 @@ post-patch:
  		${WRKSRC}/configure
  
  post-install:
 -	${INSTALL_DATA} ${FILESDIR}/tac_plus.conf.example ${PREFIX}/etc
 -.if !defined(PACKAGE_BUILDING)
 -	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 -.endif
 -.if !defined(NOPORTDOCS)
 -	@${MKDIR} ${PREFIX}/share/doc/tac_plus
 -	${INSTALL_DATA} ${WRKSRC}/users_guide ${PREFIX}/share/doc/tac_plus
 -	${INSTALL_SCRIPT} ${WRKSRC}/tac_convert ${PREFIX}/share/doc/tac_plus
 -.endif
 +	${INSTALL_DATA} ${FILESDIR}/tac_plus.conf.example ${STAGEDIR}${PREFIX}/etc
 +	@${MKDIR} ${STAGEDIR}${PREFIX}/share/doc/tac_plus
 +	${INSTALL_DATA} ${WRKSRC}/users_guide ${STAGEDIR}${PREFIX}/share/doc/tac_plus
 +	${INSTALL_SCRIPT} ${WRKSRC}/tac_convert ${STAGEDIR}${PREFIX}/share/doc/tac_plus
  
 -.include <bsd.port.post.mk>
 +.include <bsd.port.mk>
 
 Modified: head/net/tac_plus4/pkg-plist
 ==============================================================================
 --- head/net/tac_plus4/pkg-plist	Sat Oct 12 16:33:59 2013	(r330137)
 +++ head/net/tac_plus4/pkg-plist	Sat Oct 12 16:38:05 2013	(r330138)
 @@ -6,6 +6,9 @@ lib/libtacacs.a
  lib/libtacacs.la
  lib/libtacacs.so
  lib/libtacacs.so.1
 +man/man5/tac_plus.conf.5.gz
 +man/man8/tac_plus.8.gz
 +man/man8/tac_pwd.8.gz
  %%PORTDOCS%%%%DOCSDIR%%/tac_convert
  %%PORTDOCS%%%%DOCSDIR%%/users_guide
  %%PORTDOCS%%@dirrm %%DOCSDIR%%
 _______________________________________________
 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 
State-Changed-By: marcus 
State-Changed-When: Sat Oct 12 16:45:24 UTC 2013 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182616 
>Unformatted:
