Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2007 00:16:03 GMT
From:      David Wood<david@wood2.org.uk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/108196: [maintainer update] Various fixes to net/freeradius including easier 'out of the box' configuration
Message-ID:  <200701220016.l0M0G2Vd039287@www.freebsd.org>
Resent-Message-ID: <200701220020.l0M0KGrZ061795@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 22 00:20:15 GMT 2007
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



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