From nobody@FreeBSD.org  Mon Jan 22 00:16:03 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 5D1A516A400
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Jan 2007 00:16:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B8DC13C457
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Jan 2007 00:16:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l0M0G3Js039288
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Jan 2007 00:16:03 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l0M0G2Vd039287;
	Mon, 22 Jan 2007 00:16:03 GMT
	(envelope-from nobody)
Message-Id: <200701220016.l0M0G2Vd039287@www.freebsd.org>
Date: Mon, 22 Jan 2007 00:16:03 GMT
From: David Wood<david@wood2.org.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [maintainer update] Various fixes to net/freeradius including easier 'out of the box' configuration
X-Send-Pr-Version: www-3.0

>Number:         108196
>Category:       ports
>Synopsis:       [maintainer update] Various fixes to net/freeradius including easier 'out of the box' configuration
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sem
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 22 00:20:15 GMT 2007
>Closed-Date:    Tue Jan 23 12:39:15 GMT 2007
>Last-Modified:  Tue Jan 23 12:40:20 GMT 2007
>Originator:     David Wood
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD titanium.wood2.org.uk 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Wed Jan 17 11:50:20 GMT 2007     david@titanium.wood2.org.uk:/usr/obj/usr/src/sys/TITANIUM  i386
>Description:
On make install or pkg_add, copy <config_file>.sample to <config_file> if <config_file> doesn't exist. On deinstall, remove <config_file> if <config_file>.sample and <config_file> are identical. These changes make configuring FreeRADIUS 'out of the box' much more straightforward as you have a default configuration in place ready to customise. Hand crafted configuration files are left alone. [1]

Add US mirror to MASTER_SITES.

Fix CFLAGS so that the problem with AC_LIBLTDL_INSTALLABLE mentioned in ports/104949 goes away.

Tidy CONFIGURE_ARGS so that it matches the order of configure --help

Remove EXAMPLESDIR references from the post-install target of Makefile and pkg-plist. This folder isn't used; the change gets rid of an error message when deinstalling the package.

Pet portlint(1) somewhat (it doesn't like the python kludge in the Makefile, but I can't see a way around that). 


[1] Requested by Alan DeKok of the FreeRADIUS Project. See http://lists.freeradius.org/pipermail/freeradius-users/2007-January/059487.html
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN /usr/ports/net/freeradius/Makefile /usr/ports_updated/net/freeradius/Makefile
--- /usr/ports/net/freeradius/Makefile	Thu Jan 18 19:13:29 2007
+++ /usr/ports_updated/net/freeradius/Makefile	Sun Jan 21 23:05:12 2007
@@ -12,6 +12,7 @@
 MASTER_SITES=	ftp://ftp.freeradius.org/pub/radius/ \
 		ftp://ftp.ntua.gr/pub/net/radius/freeradius/ \
 		ftp://ftp.uk.freeradius.org/pub/radius/ \
+		ftp://ftp.us.freeradius.org/pub/radius/ \
 		ftp://ftp.freeradius.org/pub/radius/old/ \
 		http://freeradius.portal-to-web.de/
 
@@ -29,7 +30,7 @@
 USE_GMAKE=	yes
 USE_OPENSSL=	yes
 MAKE_ARGS+=	LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
-CFLAGS+=	-I${LOCALBASE}/include
+CFLAGS+=	-I${LOCALBASE}/include -L${LOCALBASE}/lib
 
 PLIST_SUB=	PORTVERSION=${PORTVERSION}
 
@@ -45,17 +46,20 @@
 
 .include <bsd.port.pre.mk>
 
-CONFIGURE_ARGS=	--prefix=${PREFIX} --quiet --with-logdir=${LOGDIR} \
+CONFIGURE_ARGS=	--quiet \
+		--prefix=${PREFIX} \
 		--localstatedir=/var \
+		--mandir=${PREFIX}/man \
 		--with-system-libtool \
-		--disable-ltdl-install \
 		--with-docdir=${DOCSDIR} \
-		--mandir=${PREFIX}/man \
-		--with-large-files --without-rlm_sql_unixodbc \
-		--without-rlm_sql_oracle --without-rlm_sql_iodbc \
-		--without-rlm_sql_db2 \
+		--with-logdir=${LOGDIR} \
+		--with-large-files \
 		--with-openssl-includes=${OPENSSLINC} \
-		--with-openssl-libraries=${OPENSSLLIB}
+		--with-openssl-libraries=${OPENSSLLIB} \
+		--without-rlm_sql_unixodbc \
+		--without-rlm_sql_oracle \
+		--without-rlm_sql_iodbc \
+		--without-rlm_sql_db2
 
 .if ${OSVERSION} < 500000 && ${OPENSSLBASE} == "/usr"
 PLIST_SUB+=	4SSL="@comment "
@@ -206,9 +210,13 @@
 .endif
 
 post-install:
-	@${MKDIR} ${PREFIX}/etc/raddb ${DATADIR} ${EXAMPLESDIR}
+	@${MKDIR} ${PREFIX}/etc/raddb ${DATADIR}
 .for dict in ${DICTS}
 	${INSTALL_DATA} ${WRKSRC}/share/${dict} ${DATADIR}/${dict}
 .endfor
+	for i in `${FIND} ${PREFIX}/etc/raddb -maxdepth 1 -regex '.*\.sample' -print \
+	| ${SED} -e 's/\.sample//g'`; do \
+		if [ ! -f $${i} ]; then ${CP} -p $${i}.sample $${i}; fi; \
+	done
 
 .include <bsd.port.post.mk>
diff -ruN /usr/ports/net/freeradius/pkg-plist /usr/ports_updated/net/freeradius/pkg-plist
--- /usr/ports/net/freeradius/pkg-plist	Mon Jan 15 14:55:38 2007
+++ /usr/ports_updated/net/freeradius/pkg-plist	Sun Jan 21 19:41:43 2007
@@ -12,6 +12,7 @@
 bin/rlm_dbm_parser
 bin/rlm_ippool_tool
 bin/smbencrypt
+@unexec for i in `find %D/etc/raddb -maxdepth 1 -regex '.*\.sample' -print | sed -e 's/\.sample//g'`; do if [ -f ${i} ]; then if cmp -s ${i}.sample ${i}; then rm -f ${i}; fi; fi; done
 etc/raddb/acct_users.sample
 etc/raddb/attrs.sample
 etc/raddb/certs/README
@@ -56,6 +57,7 @@
 etc/raddb/sql.conf.sample
 etc/raddb/sqlippool.conf.sample
 etc/raddb/users.sample
+@exec for i in `find %D/etc/raddb -maxdepth 1 -regex '.*\.sample' -print | sed -e 's/\.sample//g'`; do if [ ! -f ${i} ]; then cp -p ${i}.sample ${i}; fi; done
 lib/libeap-%%PORTVERSION%%.la
 lib/libeap-%%PORTVERSION%%.so
 lib/libeap.a
@@ -492,7 +494,6 @@
 %%DATADIR%%/dictionary.xedia
 %%DATADIR%%/dictionary.xylan
 %%DATADIR%%/dictionary.zyxel
-@dirrm %%EXAMPLESDIR%%
 @dirrm %%DATADIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/rfc
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/examples
@@ -503,4 +504,5 @@
 @exec chmod -R og= /var/log/raddb
 @exec mkdir -p /var/run/radiusd
 @unexec rm -fr /var/run/radiusd
-@unexec rmdir %D/etc/raddb 2> /dev/null || echo "You should remove %D/etc/raddb if you don't need it anymore."
+@dirrmtry %D/etc/raddb
+@unexec if [ -d %D/etc/raddb ]; then echo "You should remove %D/etc/raddb if you don't need it anymore."; fi

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->sem 
Responsible-Changed-By: sem 
Responsible-Changed-When: Tue Jan 23 07:00:52 UTC 2007 
Responsible-Changed-Why:  
Take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108196 
State-Changed-From-To: open->closed 
State-Changed-By: sem 
State-Changed-When: Tue Jan 23 12:38:22 UTC 2007 
State-Changed-Why:  
Committed with a modification. Thanks!  Please note: you should not use 
%D with @dirrmtry. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108196: commit references a PR
Date: Tue, 23 Jan 2007 12:35:58 +0000 (UTC)

 sem         2007-01-23 12:35:53 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/freeradius       Makefile pkg-plist 
   Log:
   - Create default config files from *.sample and remove them if they did not
     changed. (Requested by Alan DeKok of the FreeRADIUS Project.)
   - Add US mirror to MASTER_SITES.
   - Fix CFLAGS.
   - Tidy CONFIGURE_ARGS.
   - Remove EXAMPLESDIR references. It's using nowhere.
   - Pet portlint(1).
   
   PR:             ports/108196
   Submitted by:   David Wood (maintainer)
   
   Revision  Changes    Path
   1.54      +17 -9     ports/net/freeradius/Makefile
   1.27      +4 -2      ports/net/freeradius/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
