tags 721622 + patch
stop

This is a patch changing Asterisk to use FreeRADIUS-client, it is just a
matter of changing the header and the check for the library in configure.ac

It could be extended further to allow either client to be selected
through configure



diff --git a/debian/control b/debian/control
index 4157cce..ec87c96 100644
--- a/debian/control
+++ b/debian/control
@@ -32,7 +32,7 @@ Build-Depends: debhelper (>= 8),
  libxml2-dev,
  libpopt-dev,
  libiksemel-dev,
- libradiusclient-ng-dev,
+ libfreeradius-client-dev,
  freetds-dev,
  libvorbis-dev,
  libsnmp-dev,
diff --git a/debian/patches/freeradius-client b/debian/patches/freeradius-client
new file mode 100644
index 0000000..308b925
--- /dev/null
+++ b/debian/patches/freeradius-client
@@ -0,0 +1,50 @@
+diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
+index 61af334..e07be10 100644
+--- a/cdr/cdr_radius.c
++++ b/cdr/cdr_radius.c
+@@ -36,7 +36,11 @@
+ 
+ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328259 $")
+ 
++#ifdef FREERADIUS_CLIENT
++#include <freeradius-client.h>
++#else
+ #include <radiusclient-ng.h>
++#endif
+ 
+ #include "asterisk/channel.h"
+ #include "asterisk/cdr.h"
+diff --git a/cel/cel_radius.c b/cel/cel_radius.c
+index fbe87da..3faabe5 100644
+--- a/cel/cel_radius.c
++++ b/cel/cel_radius.c
+@@ -35,7 +35,11 @@
+ 
+ ASTERISK_FILE_VERSION(__FILE__, "$Rev: 328259 $")
+ 
++#ifdef FREERADIUS_CLIENT
++#include <freeradius-client.h>
++#else
+ #include <radiusclient-ng.h>
++#endif
+ 
+ #include "asterisk/channel.h"
+ #include "asterisk/cel.h"
+diff --git a/configure.ac b/configure.ac
+index d2a8f32..0db2f63 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2100,7 +2100,12 @@ fi
+ # Some distributions (like SuSE) remove the 5.1 suffix.
+ AST_EXT_LIB_CHECK([LUA], [lua], [luaL_register], [lua.h], [-lm])
+ 
+-AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
++# This should really be able to accept either RADIUS client, their
++# APIs are fully compatible, just different header filenames and
++# different SONAMEs
++#AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
++AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
++AC_DEFINE(FREERADIUS_CLIENT, [], [Use the FreeRADIUS-client])
+ 
+ AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcfg])
+ AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])
diff --git a/debian/patches/series b/debian/patches/series
index 3f8bc59..5b0959c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -31,3 +31,6 @@ dahdi_create_channels
 astdb_mans
 hyphen
 reenable
+
+freeradius-client
+

Reply via email to