1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

net/gnu-radius: Modernize port

- OptionsNG
- LICENSE
- Whitespace cleanup
- EXAMPLE rewrite
- Remove @unexec
- radiusd.in modification
- files/patch-dbm -> files/patch-radiusd_builddbm.c move and fix

PR:		206457
This commit is contained in:
Mark Felder 2016-03-18 14:02:41 +00:00
parent b422b3f790
commit 93677d1156
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=411356
8 changed files with 42 additions and 95 deletions

View File

@ -11,6 +11,9 @@ DISTNAME= radius-${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= GNU RADIUS server
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libltdl.so:${PORTSDIR}/devel/libltdl
CONFLICTS= freeradius-0.* openradius-0.* radiusd-cistron-1.*
@ -34,89 +37,37 @@ SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
CONFIGURE_ARGS+=--with-include-path="${LOCALBASE}/include/" \
--with-lib-path="${LOCALBASE}/lib/"
OPTIONS_DEFINE= CLIENT EXAMPLES DBM MYSQL PGSQL SNMP EMACS PAM
OPTIONS_DEFINE= CLIENT MYSQL PGSQL EXAMPLES DBM SNMP EMACS PAM NLS
OPTIONS_DEFAULT=MYSQL
OPTIONS_SUB= yes
CLIENT_DESC= Build client
EMACS_DESC= Install Emacs dotfiles
EXAMPLE_FILES= README ascend.rw c3620.rw cisco.rw comos.rw config.syntax \
filter.rw hints-0.96 jetstream.rw nt.rw pam.conf radius.php
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MSNMP}
CONFIGURE_ARGS+=--enable-snmp
.endif
.if ${PORT_OPTIONS:MCLIENT}
LIB_DEPENDS+= libguile.so:${PORTSDIR}/lang/guile
CONFIGURE_ARGS+=--enable-client
PLIST_SUB+= CLIENT=""
.else
CONFIGURE_ARGS+=--without-guile
PLIST_SUB+= CLIENT="@comment "
.endif
.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL= yes
CONFIGURE_ARGS+=--with-mysql
PLIST_SUB+= MYSQL=""
.else
PLIST_SUB+= MYSQL="@comment "
.endif
.if ${PORT_OPTIONS:MPGSQL}
USES+= pgsql
CONFIGURE_ARGS+=--with-postgres
PLIST_SUB+= PGSQL=""
.else
PLIST_SUB+= PGSQL="@comment "
.endif
.if ${PORT_OPTIONS:MMYSQL} || ${PORT_OPTIONS:MPGSQL}
PLIST_SUB+= MODULES=""
.else
PLIST_SUB+= MODULES="@comment "
.endif
.if ${PORT_OPTIONS:MDBM}
CONFIGURE_ARGS+=--enable-dbm=ndbm
.endif
.if ${PORT_OPTIONS:MEMACS}
.include "${PORTSDIR}/Mk/bsd.emacs.mk"
USE_EMACS= yes
CONFIGURE_ARGS+=--with-lispdir=${PREFIX}/${EMACS_SITE_LISPDIR}
PLIST_SUB+= EMACS=""
.else
CONFIGURE_ARGS+=--without-lispdir
PLIST_SUB+= EMACS="@comment "
.endif
.if ${PORT_OPTIONS:MNLS}
USES+= gettext
PLIST_SUB+= NLS=""
.else
CONFIGURE_ARGS+=--disable-nls
PLIST_SUB+= NLS="@comment "
.endif
.if ${PORT_OPTIONS:MPAM}
CONFIGURE_ARGS+=--enable-pam
.endif
SNMP_CONFIGURE_ENABLE= snmp
CLIENT_CONFIGURE_ENABLE= client
CLIENT_LIB_DEPENDS= libguile.so:${PORTSDIR}/lang/guile
CLIENT_CONFIGURE_OFF= --without-guile
MYSQL_USE= mysql=yes
MYSQL_CONFIGURE_WITH= mysql
PGSQL_USES= pgsql
PGSQL_CONFIGURE_WITH= postgres
DBM_CONFIGURE_ENABLE= dbm=ndbm
EMACS_USE= emacs=yes
EMACS_CONFIGURE_WITH= lispdir=${PREFIX}/${EMACS_SITE_LISPDIR}
NLS_USES= gettext
NLS_CONFIGURE_OFF= --disable-nls
PAM_CONFIGURE_ENABLE= pam
post-patch:
${REINPLACE_CMD} -e 's|extern unsigned scheme_gc_interval;||g' \
${WRKSRC}/include/radiusd.h
${REINPLACE_CMD} -e 's|int getline|ssize_t getline|' \
${WRKSRC}/radtest/input.l ${WRKSRC}/radtest/input.c
${WRKSRC}/radtest/input.l ${WRKSRC}/radtest/input.c
post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
. for ex_file in ${EXAMPLE_FILES}
${INSTALL_DATA} ${WRKSRC}/examples/${ex_file} ${STAGEDIR}${EXAMPLESDIR}
. endfor
.endif
( cd ${WRKSRC}/examples && ${COPYTREE_SHARE} .\
${STAGEDIR}${EXAMPLESDIR}\
"! ( -name Makefile -o -name Makefile\.* ) " )
.include <bsd.port.mk>

View File

@ -1,6 +1,6 @@
--- configure.orig Sat Nov 20 21:39:50 2004
+++ configure Wed Jul 27 23:13:31 2005
@@ -22804,7 +22804,7 @@
--- configure.orig 2008-12-17 11:09:36 UTC
+++ configure
@@ -36624,7 +36624,7 @@ if test "${ra_cv_lib_mysqlclient+set}" =
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@ -9,7 +9,7 @@
do
LIBS="$save_LIBS -lm -L$path -lmysqlclient"
cat >conftest.$ac_ext <<_ACEOF
@@ -22925,7 +22925,7 @@
@@ -36742,7 +36742,7 @@ if test "${ra_cv_lib_pq+set}" = set; the
echo $ECHO_N "(cached) $ECHO_C" >&6
else

View File

@ -1,5 +1,5 @@
--- include/radius/radutmp.h.orig 2009-05-07 22:24:02.000000000 +0200
+++ include/radius/radutmp.h 2009-05-07 22:24:45.000000000 +0200
--- include/radius/radutmp.h.orig 2008-12-15 08:03:24 UTC
+++ include/radius/radutmp.h
@@ -30,7 +30,7 @@
#define P_ACCT_ENABLED 131

View File

@ -1,6 +1,6 @@
--- raddb/Makefile.in.orig Wed Jul 27 21:46:31 2005
+++ raddb/Makefile.in Wed Jul 27 21:52:38 2005
@@ -556,10 +556,10 @@
--- raddb/Makefile.in.orig 2008-12-17 11:09:50 UTC
+++ raddb/Makefile.in
@@ -893,10 +893,10 @@ install-data-local:
echo '================================================================='; \
else \
for file in $(raddb_files_644); do \

View File

@ -1,6 +1,6 @@
--- radiusd/builddbm.c.orig 2008-12-08 14:22:12.000000000 +0100
+++ radiusd/builddbm.c 2008-12-08 14:22:37.000000000 +0100
@@ -58,7 +58,7 @@
--- radiusd/builddbm.c.orig 2008-12-15 08:03:24 UTC
+++ radiusd/builddbm.c
@@ -58,7 +58,7 @@ append_symbol(DBM_closure *closure, User
if (2 + check_len + reply_len > closure->pair_buffer_size) {
grad_log(GRAD_LOG_ERR, "%s:%d: %s",

View File

@ -1,6 +1,6 @@
--- radwho/radwho.c.orig 2010-01-21 22:29:51.000000000 +0100
+++ radwho/radwho.c 2010-01-21 22:37:37.000000000 +0100
@@ -41,7 +41,8 @@
--- radwho/radwho.c.orig 2008-12-15 08:03:24 UTC
+++ radwho/radwho.c
@@ -41,7 +41,8 @@ void print_header();
int want_rad_record(struct radutmp *rt);
/* UTMP stuff. Uses utmpx on svr4 */
@ -10,7 +10,7 @@
# include <utmpx.h>
# include <sys/fcntl.h>
# define utmp utmpx
@@ -49,7 +50,9 @@
@@ -49,7 +50,9 @@ int want_rad_record(struct radutmp *rt);
# define UT_LINESIZE 32
# define UT_HOSTSIZE 257
# undef UTMP_FILE
@ -20,7 +20,7 @@
# undef WTMP_FILE
# define WTMP_FILE WTMPX_FILE
#else
@@ -60,13 +63,19 @@
@@ -60,13 +63,19 @@ int want_rad_record(struct radutmp *rt);
# define UT_LINESIZE 32
# define UT_HOSTSIZE 64
#endif

View File

@ -2,7 +2,7 @@
# $FreeBSD$
#
# PROVIDE radiusd
# PROVIDE: radiusd
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

View File

@ -78,7 +78,6 @@ share/aclocal/radius.m4
%%NLS%%share/locale/id/LC_MESSAGES/radius.mo
%%NLS%%share/locale/pl/LC_MESSAGES/radius.mo
%%NLS%%share/locale/ru/LC_MESSAGES/radius.mo
@comment %%NLS%%share/locale/rw/LC_MESSAGES/radius.mo
%%NLS%%share/locale/uk/LC_MESSAGES/radius.mo
%%NLS%%share/locale/vi/LC_MESSAGES/radius.mo
%%CLIENT%%%%DATADIR%%/%%PORTVERSION%%/scheme/gnuradius.scm
@ -109,7 +108,4 @@ share/aclocal/radius.m4
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pam.conf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radius.php
@dir %%DATADIR%%/%%PORTVERSION%%/scheme
@dir lib/security
@unexec rm -f %B/run/radiusd.pid
@unexec rm -rf %B/log/radius 2>&1 >/dev/null || true
@unexec echo "Leaving /var/run/radutmp, /var/log/radwtmp and /var/log/radstat alone."
@dir lib/radius/%%PORTVERSION%%/modules