aboutsummaryrefslogtreecommitdiff
path: root/net/freeradius2
diff options
context:
space:
mode:
Diffstat (limited to 'net/freeradius2')
-rw-r--r--net/freeradius2/Makefile39
-rw-r--r--net/freeradius2/files/radiusd.sh7
-rw-r--r--net/freeradius2/pkg-plist28
3 files changed, 58 insertions, 16 deletions
diff --git a/net/freeradius2/Makefile b/net/freeradius2/Makefile
index 7da6afea4e4a..f83937c11472 100644
--- a/net/freeradius2/Makefile
+++ b/net/freeradius2/Makefile
@@ -16,13 +16,46 @@ COMMENT= A free RADIUS server implementation
LIB_DEPENDS= gdbm.3:${PORTSDIR}/databases/gdbm
-BROKEN= "Incorrect pkg-plist"
-
LOGDIR?= /var/log
USE_GMAKE= yes
USE_LIBTOOL= yes
-CONFIGURE_ARGS= --prefix=${PREFIX} --quiet --with-logdir=${LOGDIR}
+CONFIGURE_ARGS= --prefix=${PREFIX} --quiet --with-logdir=${LOGDIR} \
+ --localstatedir=/var
+
+.if defined(WITH_OPENLDAP_VER)
+.if ${WITH_OPENLDAP_VER} == 20 || ${WITH_OPENLDAP_VER} == 21
+LIB_DEPENDS+= ldap.2:${PORTSDIR}/net/openldap${WITH_OPENLDAP_VER}
+LIB_DEPENDS+= lber.2:${PORTSDIR}/net/openldap${WITH_OPENLDAP_VER}
+.else
+BROKEN= "WITH_OPENLDAP_VER must be 20 or 21"
+.endif
+PLIST_SUB+= LDAP=""
+.else
+CONFIGURE_ARGS+=--without-rlm_ldap
+PLIST_SUB+= LDAP="@comment "
+.endif
+
+.if defined(WITH_MYSQL_VER)
+.if ${WITH_MYSQL_VER} == 41
+LIB_DEPENDS+= mysqlclient.14:${PORTSDIR}/databases/mysql41-client
+.elif ${WITH_MYSQL_VER} == 40
+LIB_DEPENDS+= mysqlclient.12:${PORTSDIR}/databases/mysql40-client
+.elif ${WITH_MYSQL_VER} == 3
+LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client
+.else
+BROKEN= "WITH_MYSQL_VER must be 3, 40 or 41"
+.endif
+PLIST_SUB+= MYSQL=""
+.else
+CONFIGURE_ARGS+=--without-rlm_sql_mysql
+PLIST_SUB+= MYSQL="@comment "
+.endif
+
+# rlm_x99_token seems broken
+CONFIGURE_ARGS+=--without-rlm_x99_token
+PLIST_SUB+= TOKEN="@comment "
+
INSTALLS_SHLIB= yes
MAN1= radclient.1 radlast.1 radtest.1 raduse.1 radwho.1 radzap.1
diff --git a/net/freeradius2/files/radiusd.sh b/net/freeradius2/files/radiusd.sh
index fd077412dafa..798339462cd1 100644
--- a/net/freeradius2/files/radiusd.sh
+++ b/net/freeradius2/files/radiusd.sh
@@ -22,13 +22,12 @@ fi
case $1 in
start)
- touch /var/run/radiusd.pid
- chown nobody:nobody /var/run/radiusd.pid
-
"$PREFIX"/sbin/radiusd $RADIUSD_FLAGS && echo -n " radiusd"
;;
stop)
- killall radiusd && echo -n ' radiusd'
+ if [ -f /var/run/radiusd/radiusd.pid ]; then
+ kill `cat /var/run/radiusd/radiusd.pid` && echo -n ' radiusd'
+ fi
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
diff --git a/net/freeradius2/pkg-plist b/net/freeradius2/pkg-plist
index 74ec41fea882..c4da0b07690f 100644
--- a/net/freeradius2/pkg-plist
+++ b/net/freeradius2/pkg-plist
@@ -139,6 +139,11 @@ lib/rlm_files-0.8.1.so
lib/rlm_files.a
lib/rlm_files.la
lib/rlm_files.so
+%%LDAP%%lib/rlm_ldap-0.8.1.la
+%%LDAP%%lib/rlm_ldap-0.8.1.so
+%%LDAP%%lib/rlm_ldap.a
+%%LDAP%%lib/rlm_ldap.la
+%%LDAP%%lib/rlm_ldap.so
lib/rlm_mschap-0.8.1.la
lib/rlm_mschap-0.8.1.so
lib/rlm_mschap.a
@@ -179,23 +184,28 @@ lib/rlm_sql-0.8.1.so
lib/rlm_sql.a
lib/rlm_sql.la
lib/rlm_sql.so
-lib/rlm_sql_mysql.a
-lib/rlm_sql_mysql.la
-lib/rlm_sql_mysql.so
-lib/rlm_sql_mysql.so.0
+%%MYSQL%%lib/rlm_sql_mysql.a
+%%MYSQL%%lib/rlm_sql_mysql.la
+%%MYSQL%%lib/rlm_sql_mysql.so
+%%MYSQL%%lib/rlm_sql_mysql.so.0
lib/rlm_unix-0.8.1.la
lib/rlm_unix-0.8.1.so
lib/rlm_unix.a
lib/rlm_unix.la
lib/rlm_unix.so
-lib/rlm_x99_token-0.8.1.la
-lib/rlm_x99_token-0.8.1.so
-lib/rlm_x99_token.a
-lib/rlm_x99_token.la
-lib/rlm_x99_token.so
+%%TOKEN%%lib/rlm_x99_token-0.8.1.la
+%%TOKEN%%lib/rlm_x99_token-0.8.1.so
+%%TOKEN%%lib/rlm_x99_token.a
+%%TOKEN%%lib/rlm_x99_token.la
+%%TOKEN%%lib/rlm_x99_token.so
sbin/check-radiusd-config
sbin/checkrad
sbin/radiusd
sbin/radwatch
sbin/rc.radiusd
@dirrm etc/raddb
+@exec mkdir -p /var/log/raddb
+@exec chmod -R og= /var/log/raddb
+@unexec rm -fr /var/log/raddb
+@exec mkdir -p /var/run/radiusd
+@unexec rm -fr /var/run/radiusd