ports/117160: maintainer update] net/freeradius; variuos small fixes

David Wood david at wood2.org.uk
Sat Oct 13 22:10:01 UTC 2007


>Number:         117160
>Category:       ports
>Synopsis:       maintainer update] net/freeradius; variuos small fixes
>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:   Sat Oct 13 22:10:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     David Wood
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD titanium.wood2.org.uk 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #0: Thu Aug  2 18:30:40 BST 2007     david at titanium.wood2.org.uk:/usr/obj/usr/src/sys/TITANIUM  i386
>Description:
- Remove more 4.x cruft (obsolete comment in Makefile, obsolete patch,
  simplification in WITH_NOPERL handling in Makefile).
- Use MASTER_SITE_SUBDIR rather than an explicit /old reference in
  MASTER_SITES.
- Tidy pkg-plist, including the use of @stopdaemon and some mild reordering
  so that it is more logical.
- Avoid spurious -L/usr/lib in the radiusd build step when using base OpenSSL.
- Use ${PTHREAD_LIBS} rather than -pthread.
- Remove the -p flag to cp when copying files into /usr/local/etc/raddb (this
  may help stop FreeRADIUS stomping over explicitly set ownership and
  permissions in this directory). [1]
- Generalise CONFLICTS.
- Support WITH_DEVELOPER (though it has to be used as a knob - I see no reason
  to add this to the OPTIONS).
- Bump PORTREVISION.

[1] May address a concern of sem@ (discussion by private mail)


Whilst it was hoped that the -L/usr/lib change would help with the problems on
7.x amd64 (which is, unfortunately, not as simple as a lack of -fPIC), and
indeed the tendency to generate a broken radiusd binary with gcc 4.2 on other
platforms, this now looks to be a libtool problem which I will bring up on
freebsd-ports and/or in a separate PR. However, the port should do the right
thing anyway, and I wanted to tidy up these issues before asking for help.

These updates are also a precursor to submitting net/freeradius-devel for
FreeRADIUS 2.0.0-pre2, which will be submitted as a patch from the port as it
stands after these changes in a separate PR.


Note: files/patch-src-modules-rlm_attr_rewrite-rlm_attr_rewrite.c has been
removed.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN --exclude=.svn /usr/ports/net/freeradius/Makefile /usr/ports_updated/net/freeradius/Makefile
--- /usr/ports/net/freeradius/Makefile	Thu Oct  4 03:10:48 2007
+++ /usr/ports/net/freeradius/Makefile	Sat Oct 13 22:27:14 2007
@@ -7,14 +7,14 @@
 
 PORTNAME=	freeradius
 PORTVERSION?=	1.1.7
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES=	net
 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/
+MASTER_SITE_SUBDIR=	. old
 
 MAINTAINER?=	david at wood2.org.uk
 COMMENT?=	A free RADIUS server implementation
@@ -29,7 +29,7 @@
 # If FREERADIUS_SLAVE_MYSQL is defined, we want to build the
 # freeradius-mysql slave port
 
-CONFLICTS=	gnu-radius-1.* openradius-0.* radiusd-cistron-1.*
+CONFLICTS=	gnu-radius-[0-9].* openradius-[0-9].* radiusd-cistron-[0-9].*
 .ifdef(FREERADIUS_SLAVE_MYSQL)
 CONFLICTS+=	freeradius-[0-9].* freeradius-mysql-[02-9].*
 PKGNAMESUFFIX=	-mysql
@@ -87,9 +87,13 @@
 .endif
 CONFIGURE_ARGS+=--with-logdir=${LOGDIR} \
 		--with-large-files \
-		--with-openssl-includes=${OPENSSLINC} \
-		--with-openssl-libraries=${OPENSSLLIB} \
-		--without-rlm_sql_db2 \
+		--with-openssl-includes=${OPENSSLINC}
+# This conditionality avoids -L/usr/lib in the radiusd build step when
+# building with base system OpenSSL
+.if ${OPENSSLLIB} != "/usr/lib"
+CONFIGURE_ARGS+=--with-openssl-libraries=${OPENSSLLIB}
+.endif
+CONFIGURE_ARGS+=--without-rlm_sql_db2 \
 		--without-rlm_sql_freetds \
 		--without-rlm_sql_iodbc \
 		--without-rlm_sql_oracle \
@@ -186,15 +190,15 @@
 PLIST_SUB+=	EXPM="@comment "
 .endif
 
-.ifndef(WITH_NOPERL)
-USE_PERL5=	yes
+.ifdef(WITH_DEVELOPER)
+CONFIGURE_ARGS+=--enable-developer
 .endif
 
-# rlm_perl does not build on 4.x
-.if defined(WITH_NOPERL)
+.ifdef(WITH_NOPERL)
 CONFIGURE_ARGS+=--without-rlm_perl
 PLIST_SUB+=	RLMPERL="@comment "
 .else
+USE_PERL5=	yes
 CONFIGURE_ARGS+=--with-rlm_perl
 PLIST_SUB+=	RLMPERL=""
 .endif
@@ -222,6 +226,9 @@
 	@${FIND} -E ${WRKSRC} -regex '.*/Makefile(\.in)?\.(orig|bak)$$' -delete
 
 pre-configure:
+# Replace -pthread with ${PTHREAD_LIBS} in configure(.in) files
+	@${FIND} -E ${WRKSRC} -regex '.*/configure(\.in)?$$' -exec \
+		${REINPLACE_CMD} -e "s:-pthread:${PTHREAD_LIBS}:g" {} \;
 # Force the rebuild of some configures from configure.in, as we're patching
 # the configure.in
 # NOTE: ${WRKSRC}/configure is rebuilt automatically once autoconf:261 is
@@ -245,7 +252,7 @@
 	@for i in `${FIND} ${EXAMPLESDIR}/raddb/ -type f -print \
 	| ${SED} -e 's:^${EXAMPLESDIR}/raddb/::g'`; do \
 		if [ ! -f ${PREFIX}/etc/raddb/$${i} ]; then \
-			${CP} -p ${EXAMPLESDIR}/raddb/$${i} ${PREFIX}/etc/raddb/$${i}; \
+			${CP} ${EXAMPLESDIR}/raddb/$${i} ${PREFIX}/etc/raddb/$${i}; \
 		fi; \
 	done
 # Set ${PREFIX}/etc/raddb and all the files and folders in it to g-w,o-rwx
diff -ruN --exclude=.svn /usr/ports/net/freeradius/files/patch-src-modules-rlm_attr_rewrite-rlm_attr_rewrite.c /usr/ports_updated/net/freeradius/files/patch-src-modules-rlm_attr_rewrite-rlm_attr_rewrite.c
--- /usr/ports/net/freeradius/patch-src-modules-rlm_attr_rewrite-rlm_attr_rewrite.c	Sat Jun 18 03:53:32 2005
+++ /usr/ports/net/freeradius/patch-src-modules-rlm_attr_rewrite-rlm_attr_rewrite.c	Thu Jan  1 01:00:00 1970
@@ -1,10 +0,0 @@
---- src/modules/rlm_attr_rewrite/rlm_attr_rewrite.c.orig	Sat Jun 18 14:29:43 2005
-+++ src/modules/rlm_attr_rewrite/rlm_attr_rewrite.c	Sat Jun 18 14:31:48 2005
-@@ -27,6 +27,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/types.h>
- #ifdef HAVE_REGEX_H
- #	include <regex.h>
- #endif
diff -ruN --exclude=.svn /usr/ports/net/freeradius/pkg-plist /usr/ports_updated/net/freeradius/pkg-plist
--- /usr/ports/net/freeradius/pkg-plist	Thu Oct  4 03:10:48 2007
+++ /usr/ports/net/freeradius/pkg-plist	Sat Oct 13 11:19:55 2007
@@ -1,5 +1,4 @@
- at unexec %D/etc/rc.d/radiusd.sh forcestop 2>/dev/null || true
- at unexec %D/etc/rc.d/radiusd forcestop 2>/dev/null || true
+ at stopdaemon radiusd
 bin/radclient
 bin/radeapclient
 bin/radlast
@@ -14,6 +13,10 @@
 bin/smbencrypt
 @unexec for i in `find %D/%%EXAMPLESDIR%%/raddb/ -type f -print | sed -e 's:^%D/%%EXAMPLESDIR%%/raddb/::g'`; do if [ -f %D/%%EXAMPLESDIR%%/raddb/${i} ]; then if cmp -s %D/%%EXAMPLESDIR%%/raddb/${i} %D/etc/raddb/${i}; then rm -f %D/etc/raddb/${i}; fi; fi; done
 @unexec for i in `find -d %D/%%EXAMPLESDIR%%/raddb/ -type d -mindepth 1 -print | sed -e 's:^%D/%%EXAMPLESDIR%%/raddb/::g'`; do if [ -d %D/etc/raddb/${i} ]; then rmdir %D/etc/raddb/${i} 2>/dev/null || true; fi; done
+ at dirrmtry etc/raddb/certs/demoCA
+ at dirrmtry etc/raddb/certs
+ at dirrmtry etc/raddb
+ at unexec if [ -d %D/etc/raddb ]; then echo "You should remove %D/etc/raddb if you don't need it any more."; fi
 %%EXAMPLESDIR%%/raddb/acct_users
 %%EXAMPLESDIR%%/raddb/attrs
 %%EXAMPLESDIR%%/raddb/certs/README
@@ -35,11 +38,10 @@
 %%EXAMPLESDIR%%/raddb/certs/root.der
 %%EXAMPLESDIR%%/raddb/certs/root.p12
 %%EXAMPLESDIR%%/raddb/certs/root.pem
-%%EXAMPLESDIR%%/raddb/clients.conf
 %%EXAMPLESDIR%%/raddb/clients
+%%EXAMPLESDIR%%/raddb/clients.conf
 %%EXAMPLESDIR%%/raddb/dictionary
 %%EXAMPLESDIR%%/raddb/eap.conf
-%%EXAMPLESDIR%%/raddb/example.pl
 %%EXAMPLESDIR%%/raddb/experimental.conf
 %%EXAMPLESDIR%%/raddb/hints
 %%EXAMPLESDIR%%/raddb/huntgroups
@@ -59,8 +61,9 @@
 %%EXAMPLESDIR%%/raddb/sql.conf
 %%EXAMPLESDIR%%/raddb/sqlippool.conf
 %%EXAMPLESDIR%%/raddb/users
+%%EXAMPLESDIR%%/raddb/example.pl
 @exec for i in `find %D/%%EXAMPLESDIR%%/raddb/ -type d -mindepth 1 -print | sed -e 's:^%D/%%EXAMPLESDIR%%/raddb/::g'`; do if [ ! -d %D/etc/raddb/${i} ]; then mkdir -p %D/etc/raddb/${i}; fi; done
- at exec for i in `find %D/%%EXAMPLESDIR%%/raddb/ -type f -print | sed -e 's:^%D/%%EXAMPLESDIR%%/raddb/::g'`; do if [ ! -f %D/etc/raddb/${i} ]; then cp -p %D/%%EXAMPLESDIR%%/raddb/${i} %D/etc/raddb/${i}; fi; done
+ at exec for i in `find %D/%%EXAMPLESDIR%%/raddb/ -type f -print | sed -e 's:^%D/%%EXAMPLESDIR%%/raddb/::g'`; do if [ ! -f %D/etc/raddb/${i} ]; then cp %D/%%EXAMPLESDIR%%/raddb/${i} %D/etc/raddb/${i}; fi; done
 @exec chmod -R g-w,o-rwx %D/etc/raddb
 @dirrm %%EXAMPLESDIR%%/raddb/certs/demoCA
 @dirrm %%EXAMPLESDIR%%/raddb/certs
@@ -421,6 +424,9 @@
 %%PORTDOCS%%%%DOCSDIR%%/supervise-radiusd.txt
 %%PORTDOCS%%%%DOCSDIR%%/tuning_guide
 %%PORTDOCS%%%%DOCSDIR%%/variables.txt
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/rfc
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/examples
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
 %%DATADIR%%/dictionary
 %%DATADIR%%/dictionary.3com
 %%DATADIR%%/dictionary.3gpp
@@ -522,14 +528,7 @@
 %%DATADIR%%/dictionary.xylan
 %%DATADIR%%/dictionary.zyxel
 @dirrm %%DATADIR%%
-%%PORTDOCS%%@dirrm %%DOCSDIR%%/rfc
-%%PORTDOCS%%@dirrm %%DOCSDIR%%/examples
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
 @exec mkdir -p /var/log/raddb
 @exec chmod -R og= /var/log/raddb
 @exec mkdir -p /var/run/radiusd
 @unexec rm -fr /var/run/radiusd
- at dirrmtry etc/raddb/certs/demoCA
- at dirrmtry etc/raddb/certs
- at dirrmtry etc/raddb
- at 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:



More information about the freebsd-ports-bugs mailing list