Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 2008 11:22:38 +0200 (EET)
From:      Valentin Nechayev <netch@portaone.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/129250: new port: net/freeradius-client
Message-ID:  <200811280922.mAS9Mcbr023557@segfault.kiev.ua>
Resent-Message-ID: <200811280940.mAS9e1lc037683@freefall.freebsd.org>

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

>Number:         129250
>Category:       ports
>Synopsis:       new port: net/freeradius-client
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 28 09:40:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Valentin Nechayev
>Release:        FreeBSD 6.3-RELEASE-p1 i386
>Organization:
PortaOne, Inc.
>Environment:
System: FreeBSD 6.3-RELEASE-p1

>Description:

Following is port for freeradius-client with is forked development of
known radiusclient library for C and useful binaries (net/radiusclient).
I have made basic FreeBSD specific fixing. Also, the PortaOne specific
patch is leaved for nasaddr overloading in config.

As soon it is supposed as full equivalent of radiusclient, I didn't do
anything special against conflict between its binaries and new port
binaries.

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./Makefile
#	./distinfo
#	./pkg-descr
#	./pkg-plist
#	./files/patch-configure.in
#	./files/patch-configure
#	./files/patch-lib::sendserver.c
#	./files/patch-lib::options.h
#	./files/patch-lib::ip_util.c
#	./files/patch-lib::config.c
#
echo x - ./Makefile
sed 's/^X//' >./Makefile << 'END-of-./Makefile'
X# New ports collection makefile for:   freeradius-client
X# Date created:			Wed Nov 26 18:14:37 EET 2008
X# Whom:				netch@segfault.kiev.ua
X#
X# $FreeBSD$
X#
X
XPORTNAME=	freeradius-client
XPORTVERSION=	1.1.6
XCATEGORIES=	net
XMASTER_SITES=	ftp://ftp.freeradius.org/pub/freeradius/ \
X		ftp://ftp.suntel.com.tr/pub/freeradius/
X
XMAINTAINER=	netch@segfault.kiev.ua
XCOMMENT=	Client library and basic utilities for RADIUS AAA
X
XUSE_BZIP2=	yes
XUSE_GMAKE=	yes
XGNU_CONFIGURE=	yes
XUSE_AUTOTOOLS=	libtool:15
XINSTALLS_SHLIB=	yes
X
XCONFLICTS=	radiusclient-*
X
X.include <bsd.port.mk>
END-of-./Makefile
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'END-of-./distinfo'
XMD5 (freeradius-client-1.1.6.tar.bz2) = 2e46564e450ae13aedb70dc133b158ac
XSHA256 (freeradius-client-1.1.6.tar.bz2) = a3c9522ed6d9bc795794595a8f3eebada868ea11a0c046637500faf257f9688f
XSIZE (freeradius-client-1.1.6.tar.bz2) = 297916
END-of-./distinfo
echo x - ./pkg-descr
sed 's/^X//' >./pkg-descr << 'END-of-./pkg-descr'
XThe FreeRADIUS Client is a framework and library for writing RADIUS
XClients which additionally includes radlogin, a flexible RADIUS aware
Xlogin replacement, a command line program to send RADIUS
Xauthentication/authorisation requests and accounting records and a
Xutility to query the status of a RADIUS server.  All these programs are
Xbased on a library which lets you develop a RADIUS-aware application in
Xless than 50 lines of C code. It is highly portable and runs on Linux,
Xmany BSD variants and Solaris.
X
XWWW: http://wiki.freeradius.org/Radiusclient
END-of-./pkg-descr
echo x - ./pkg-plist
sed 's/^X//' >./pkg-plist << 'END-of-./pkg-plist'
Xetc/radiusclient/dictionary
Xetc/radiusclient/dictionary.ascend
Xetc/radiusclient/dictionary.compat
Xetc/radiusclient/dictionary.merit
Xetc/radiusclient/dictionary.sip
Xetc/radiusclient/issue
Xetc/radiusclient/port-id-map
Xetc/radiusclient/radiusclient.conf
Xetc/radiusclient/servers
Xinclude/freeradius-client.h
Xlib/libfreeradius-client.a
Xlib/libfreeradius-client.la
Xlib/libfreeradius-client.so
Xlib/libfreeradius-client.so.2
Xsbin/login.radius
Xsbin/radacct
Xsbin/radembedded
Xsbin/radexample
Xsbin/radiusclient
Xsbin/radlogin
Xsbin/radstatus
X@dirrm etc/radiusclient
END-of-./pkg-plist
echo x - ./files/patch-configure.in
sed 's/^X//' >./files/patch-configure.in << 'END-of-./files/patch-configure.in'
X--- configure.in
X+++ configure.in
X@@ -66,14 +66,6 @@
X dnl We need #stdio.h to define NULL on FreeBSD (at least)
X gethostbyaddrrstyle=""
X AC_MSG_CHECKING([gethostbyaddr_r() syntax])
X-case "$host" in
X-*-freebsd*)
X-	AC_DEFINE([GETHOSTBYADDR_R], [], [Define to 1 us gethostbyaddr_r()])
X-        AC_DEFINE([GETHOSTBYADDRRSTYLE_BSD], [], [Define to 1 to use bsd-style gethostbyaddr_r()])
X-        gethostbyaddrrstyle=BSD
X-        AC_MSG_WARN([FreeBSD overridden to BSD-style])
X-        ;;
X-esac
X if test "x$gethostbyaddrrstyle" = "x"; then
X         AC_TRY_LINK([
X #include <stdio.h>
END-of-./files/patch-configure.in
echo x - ./files/patch-configure
sed 's/^X//' >./files/patch-configure << 'END-of-./files/patch-configure'
X--- configure
X+++ configure
X@@ -1632,10 +1632,10 @@
X 
X # The aliases save the names the user supplied, while $host etc.
X # will get canonicalized.
X-test -n "$target_alias" &&
X-  test "$program_prefix$program_suffix$program_transform_name" = \
X-    NONENONEs,x,x, &&
X-  program_prefix=${target_alias}-
X+#test -n "$target_alias" &&
X+#  test "$program_prefix$program_suffix$program_transform_name" = \
X+#    NONENONEs,x,x, &&
X+#  program_prefix=${target_alias}-
X 
X case "$target" in
X 	*)
X@@ -1767,11 +1767,11 @@
X fi
X echo "$as_me:$LINENO: result: yes" >&5
X echo "${ECHO_T}yes" >&6
X-test "$program_prefix" != NONE &&
X-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
X+#test "$program_prefix" != NONE &&
X+#  program_transform_name="s,^,$program_prefix,;$program_transform_name"
X # Use a double $ so make ignores it.
X-test "$program_suffix" != NONE &&
X-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
X+#test "$program_suffix" != NONE &&
X+#  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
X # Double any \ or $.  echo might interpret backslashes.
X # By default was `s,x,x', remove it if useless.
X cat <<\_ACEOF >conftest.sed
X@@ -9911,13 +9911,6 @@
X 	;;
X     esac
X 
X-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
X-    then
X-      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
X-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
X-   { (exit 1); exit 1; }; }
X-    fi
X-
X     # Update the list of available tags.
X     if test -n "$tagname"; then
X       echo appending configuration tag \"$tagname\" to $ofile
X@@ -18646,6 +18639,7 @@
X 
X # This can be used to rebuild libtool when needed
X LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
X+$ac_aux_dir/ltconfig $LIBTOOL_DEPS
X 
X # Always use our own libtool.
X LIBTOOL='$(SHELL) $(top_builddir)/libtool'
X@@ -19728,23 +19722,6 @@
X gethostbyaddrrstyle=""
X echo "$as_me:$LINENO: checking gethostbyaddr_r() syntax" >&5
X echo $ECHO_N "checking gethostbyaddr_r() syntax... $ECHO_C" >&6
X-case "$host" in
X-*-freebsd*)
X-
X-cat >>confdefs.h <<\_ACEOF
X-#define GETHOSTBYADDR_R
X-_ACEOF
X-
X-
X-cat >>confdefs.h <<\_ACEOF
X-#define GETHOSTBYADDRRSTYLE_BSD
X-_ACEOF
X-
X-        gethostbyaddrrstyle=BSD
X-        { echo "$as_me:$LINENO: WARNING: FreeBSD overridden to BSD-style" >&5
X-echo "$as_me: WARNING: FreeBSD overridden to BSD-style" >&2;}
X-        ;;
X-esac
X if test "x$gethostbyaddrrstyle" = "x"; then
X         cat >conftest.$ac_ext <<_ACEOF
X /* confdefs.h.  */
END-of-./files/patch-configure
echo x - ./files/patch-lib::sendserver.c
sed 's/^X//' >./files/patch-lib::sendserver.c << 'END-of-./files/patch-lib::sendserver.c'
X--- lib/sendserver.c
X+++ lib/sendserver.c
X@@ -196,6 +196,7 @@
X 	char            send_buffer[BUFFER_LEN];
X 	int		retries;
X 	VALUE_PAIR 	*vp;
X+	unsigned long	nasaddr;
X 
X 	server_name = data->server;
X 	if (server_name == NULL || server_name[0] == '\0')
X@@ -259,6 +262,9 @@
X 	/*
X 	 * Fill in NAS-IP-Address
X 	 */
X+	nas_ipaddr = rc_nasaddress(rh);
X+	if (nas_ipaddr != 0)
X+		sinlocal.sin_addr.s_addr = htonl(nas_ipaddr);
X 	if (sinlocal.sin_addr.s_addr == htonl(INADDR_ANY)) {
X 		if (rc_get_srcaddr(SA(&sinlocal), SA(&sinremote)) != 0) {
X 			close (sockfd);
END-of-./files/patch-lib::sendserver.c
echo x - ./files/patch-lib::options.h
sed 's/^X//' >./files/patch-lib::options.h << 'END-of-./files/patch-lib::options.h'
X--- lib/options.h
X+++ lib/options.h
X@@ -50,6 +50,7 @@
X {"radius_retries",	OT_INT,	ST_UNDEF, NULL},
X {"radius_deadtime",	OT_INT, ST_UNDEF, NULL},
X {"bindaddr",		OT_STR, ST_UNDEF, NULL},
X+{"nasaddr",		OT_STR, ST_UNDEF, NULL},
X /* local options */
X {"login_local",		OT_STR, ST_UNDEF, NULL},
X };
END-of-./files/patch-lib::options.h
echo x - ./files/patch-lib::ip_util.c
sed 's/^X//' >./files/patch-lib::ip_util.c << 'END-of-./files/patch-lib::ip_util.c'
X--- lib/ip_util.c
X+++ lib/ip_util.c
X@@ -350,6 +350,36 @@
X }
X 
X /*
X+ * Function: rc_nasaddress
X+ *
X+ * Purpose: get the IP address to be declared as NAS-Address
X+ *          for sending requests in host order
X+ *
X+ * Returns: IP address, or 0 if didn't specified
X+ *
X+ */
X+
X+uint32_t rc_nasaddress(rc_handle *rh)
X+{
X+	const char *cs;
X+	char hostname[256];
X+	uint32_t rval;
X+
X+	cs = rc_conf_str(rh, "nasaddr");
X+	if (cs == NULL || 0 == strcmp(cs, "*"))
X+		return 0;
X+
X+	strncpy(hostname, cs, sizeof(hostname));
X+	hostname[sizeof(hostname) - 1] = '\0';
X+	if ((rval = rc_get_ipaddr(hostname)) == 0) {
X+		rc_log(LOG_ERR, "rc_own_ipaddress: couldn't get IP address from bindaddr");
X+		rval = INADDR_ANY;
X+	}
X+
X+	return rval;
X+}
X+
X+/*
X  * Function: rc_get_srcaddr
X  *
X  * Purpose: given remote address find local address which the
END-of-./files/patch-lib::ip_util.c
echo x - ./files/patch-lib::config.c
sed 's/^X//' >./files/patch-lib::config.c << 'END-of-./files/patch-lib::config.c'
X--- lib/config.c
X+++ lib/config.c
X@@ -491,7 +491,7 @@
X 	option = find_option(rh, optname, OT_INT|OT_AUO);
X 
X 	if (option != NULL) {
X-		return *((int *)option->val);
X+		return option->val ? *((int *)option->val) : 0;
X 	} else {
X 		rc_log(LOG_CRIT, "rc_conf_int: unkown config option requested: %s", optname);
X 		abort();
END-of-./files/patch-lib::config.c
exit




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