2 # Copyright (C) 2008-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=freeradius-server-
$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=ftp
://ftp.freeradius.org
/pub
/freeradius
/
16 PKG_MD5SUM
:=5e16a0869acdf448b191c7e30f6507d8
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/freeradius-server-
$(PKG_VERSION
)
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/freeradius2
/Default
26 URL
:=http
://freeradius.org
/
29 define Package
/freeradius2
30 $(call Package
/freeradius2
/Default
)
31 DEPENDS
:=+libltdl
+libopenssl
+libpthread
+libreadline
32 TITLE
:=A flexible RADIUS server
(version
2)
36 define Package
/freeradius2
/conffiles
37 /etc
/freeradius2
/clients.conf
38 /etc
/freeradius2
/radiusd.conf
39 /etc
/freeradius2
/sites
/default
42 define Package
/freeradius2-democerts
43 $(call Package
/freeradius2
/Default
)
45 TITLE
:=Demo certificates to
test the server
48 define Package
/freeradius2-mod-chap
49 $(call Package
/freeradius2
/Default
)
54 define Package
/freeradius2-mod-chap
/conffiles
55 /etc
/freeradius2
/modules
/chap
58 define Package
/freeradius2-mod-detail
59 $(call Package
/freeradius2
/Default
)
61 TITLE
:=Detailed accounting module
64 define Package
/freeradius2-mod-detail
/conffiles
65 /etc
/freeradius2
/modules
/detail
68 define Package
/freeradius2-mod-eap
69 $(call Package
/freeradius2
/Default
)
71 TITLE
:=Base EAP module
74 define Package
/freeradius2-mod-eap
/conffiles
75 /etc
/freeradius2
/eap.conf
78 define Package
/freeradius2-mod-eap-gtc
79 $(call Package
/freeradius2
/Default
)
80 DEPENDS
:=freeradius2-mod-eap
84 define Package
/freeradius2-mod-eap-md5
85 $(call Package
/freeradius2
/Default
)
86 DEPENDS
:=freeradius2-mod-eap
90 define Package
/freeradius2-mod-eap-mschapv2
91 $(call Package
/freeradius2
/Default
)
92 DEPENDS
:=freeradius2-mod-eap
93 TITLE
:=EAP
/MS-CHAPv2 module
96 define Package
/freeradius2-mod-eap-peap
97 $(call Package
/freeradius2
/Default
)
98 DEPENDS
:=freeradius2-mod-eap
99 TITLE
:=EAP
/PEAP module
102 define Package
/freeradius2-mod-eap-tls
103 $(call Package
/freeradius2
/Default
)
104 DEPENDS
:=freeradius2-mod-eap
105 TITLE
:=EAP
/TLS module
108 define Package
/freeradius2-mod-eap-ttls
109 $(call Package
/freeradius2
/Default
)
110 DEPENDS
:=freeradius2-mod-eap-tls
111 TITLE
:=EAP
/TTLS module
114 define Package
/freeradius2-mod-exec
115 $(call Package
/freeradius2
/Default
)
120 define Package
/freeradius2-mod-exec
/conffiles
121 /etc
/freeradius2
/modules
/exec
124 define Package
/freeradius2-mod-expiration
125 $(call Package
/freeradius2
/Default
)
127 TITLE
:=Expiration module
130 define Package
/freeradius2-mod-expiration
/conffiles
131 /etc
/freeradius2
/modules
/expiration
134 define Package
/freeradius2-mod-expr
135 $(call Package
/freeradius2
/Default
)
140 define Package
/freeradius2-mod-expr
/conffiles
141 /etc
/freeradius2
/modules
/expr
144 define Package
/freeradius2-mod-attr-filter
145 $(call Package
/freeradius2
/Default
)
147 TITLE
:=ATTR
filter module
150 define Package
/freeradius2-mod-attr-filter
/conffiles
151 /etc
/freeradius2
/modules
/attr_filter
152 /etc
/freeradius2
/attrs
153 /etc
/freeradius2
/attrs.access_reject
154 /etc
/freeradius2
/attrs.accounting_response
155 /etc
/freeradius2
/attrs.pre-proxy
158 define Package
/freeradius2-mod-attr-rewrite
159 $(call Package
/freeradius2
/Default
)
161 TITLE
:=ATTR rewrite module
164 define Package
/freeradius2-mod-attr-rewrite
/conffiles
165 /etc
/freeradius2
/modules
/attr_rewrite
168 define Package
/freeradius2-mod-files
169 $(call Package
/freeradius2
/Default
)
171 TITLE
:=Module using local files for authorization
174 define Package
/freeradius2-mod-files
/conffiles
175 /etc
/freeradius2
/acct_users
176 /etc
/freeradius2
/preproxy_users
177 /etc
/freeradius2
/users
178 /etc
/freeradius2
/modules
/files
181 define Package
/freeradius2-mod-ldap
182 $(call Package
/freeradius2
/Default
)
183 DEPENDS
:=freeradius2
+libopenldap
187 define Package
/freeradius2-mod-ldap
/conffiles
188 /etc
/freeradius2
/ldap.attrmap
189 /etc
/freeradius2
/modules
/ldap
192 define Package
/freeradius2-mod-logintime
193 $(call Package
/freeradius2
/Default
)
195 TITLE
:=Logintime module
198 define Package
/freeradius2-mod-logintime
/conffiles
199 /etc
/freeradius2
/modules
/logintime
202 define Package
/freeradius2-mod-mschap
203 $(call Package
/freeradius2
/Default
)
205 TITLE
:=MS-CHAP and MS-CHAPv2 module
208 define Package
/freeradius2-mod-mschap
/conffiles
209 /etc
/freeradius2
/modules
/mschap
212 define Package
/freeradius2-mod-pap
213 $(call Package
/freeradius2
/Default
)
218 define Package
/freeradius2-mod-pap
/conffiles
219 /etc
/freeradius2
/modules
/pap
222 define Package
/freeradius2-mod-preprocess
223 $(call Package
/freeradius2
/Default
)
225 TITLE
:=Request pre-processing module
228 define Package
/freeradius2-mod-preprocess
/conffiles
229 /etc
/freeradius2
/hints
230 /etc
/freeradius2
/huntgroups
231 /etc
/freeradius2
/modules
/preprocess
234 define Package
/freeradius2-mod-realm
235 $(call Package
/freeradius2
/Default
)
237 TITLE
:=Realms handling module
240 define Package
/freeradius2-mod-realm
/conffiles
241 /etc
/freeradius2
/proxy.conf
242 /etc
/freeradius2
/modules
/realm
245 define Package
/freeradius2-mod-sql
246 $(call Package
/freeradius2
/Default
)
248 TITLE
:=Base SQL module
251 define Package
/freeradius2-mod-sql
/conffiles
252 /etc
/freeradius2
/sql.conf
255 define Package
/freeradius2-mod-sql-mysql
256 $(call Package
/freeradius2
/Default
)
257 DEPENDS
:=freeradius2-mod-sql
+libmysqlclient
261 define Package
/freeradius2-mod-sql-pgsql
262 $(call Package
/freeradius2
/Default
)
263 DEPENDS
:=freeradius2-mod-sql
+libpq
264 TITLE
:=PostgreSQL module
267 define Package
/freeradius2-mod-sqlcounter
268 $(call Package
/freeradius2
/Default
)
269 DEPENDS
:=freeradius2-mod-sql
270 TITLE
:=Generic SQL Counter module
273 define Package
/freeradius2-mod-radutmp
274 $(call Package
/freeradius2
/Default
)
276 TITLE
:=Radius UTMP module
279 define Package
/freeradius2-mod-radutmp
/conffiles
280 /etc
/freeradius2
/modules
/radutmp
281 /etc
/freeradius2
/modules
/sradutmp
284 define Package
/freeradius2-utils
285 $(call Package
/freeradius2
/Default
)
287 TITLE
:=Misc. client utilities
291 --libdir=/usr
/lib
/freeradius2 \
292 --libexecdir
=/usr
/lib
/freeradius2 \
295 --disable-developer \
297 --with-openssl-includes
="$(STAGING_DIR)/usr/include" \
298 --with-openssl-libraries
="$(STAGING_DIR)/usr/lib" \
299 --with-system-libtool \
300 --with-system-libltdl \
301 --enable-strict-dependencies \
302 --with-raddbdir
=/etc
/freeradius2 \
303 --with-radacctdir
=/var
/db
/radacct \
304 --with-logdir
=/var
/log \
307 --without-rlm_checkval \
309 --without-rlm_counter \
312 --without-rlm_eap_sim \
313 --without-rlm_example \
314 --without-rlm_ippool \
317 --without-rlm_smsotp \
320 --without-rlm_python \
322 --without-rlm_always \
324 --with-rlm_sqlcounter \
325 --without-rlm_sqlhpwippool \
326 --without-rlm_sqlippool \
327 --without-rlm_sql_db2 \
328 --without-rlm_sql_firebird \
329 --without-rlm_sql_freetds \
330 --without-rlm_sql_iodbc \
331 --without-rlm_sql_oracle \
332 --without-rlm_sql_sybase \
333 --without-rlm_sql_unixodbc \
334 --without-rlm_sql_log \
335 --without-rlm_sql_sqlite \
337 --without-rlm_eap_tnc \
338 --without-rlm_eap_ikev2 \
339 --without-rlm_opendirectory \
340 --without-rlm_wimax \
343 freeradius freeradius.internal \
344 rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
345 rfc4372 rfc4675 rfc4679 \
349 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-ldap
),)
351 --with-rlm_ldap-include-dir
="$(STAGING_DIR)/usr/include" \
352 --with-rlm_ldap-lib-dir
="$(STAGING_DIR)/usr/lib"
353 CONFIGURE_LIBS
+= -lcrypto
-lssl
355 CONFIGURE_ARGS
+= --without-rlm_ldap
358 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql
),)
360 --with-mysql-include-dir
="$(STAGING_DIR)/usr/include" \
361 --with-mysql-lib-dir
="$(STAGING_DIR)/usr/lib/mysql"
363 CONFIGURE_VARS
+= ac_cv_lib_mysqlclient_r_mysql_init
=yes
365 CONFIGURE_ARGS
+= --without-rlm_sql_mysql
368 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-sql-pgsql
),)
370 --with-rlm_sql_postgresql-include-dir
="$(STAGING_DIR)/usr/include" \
371 --with-rlm_sql_postgresql-lib-dir
="$(STAGING_DIR)/usr/lib"
373 CONFIGURE_ARGS
+= --without-rlm_sql_postgresql
376 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap
),)
378 --with-rlm_eap_peap \
379 --with-rlm_eap_peap-include-dir
="$(STAGING_DIR)/usr/include" \
380 --with-rlm_eap_peap-lib-dir
="$(STAGING_DIR)/usr/lib"
381 CONFIGURE_LIBS
+= -lcrypto
-lssl
383 CONFIGURE_ARGS
+= --without-rlm_eap_peap
386 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-eap-tls
),)
389 --with-rlm_eap_tls-include-dir
="$(STAGING_DIR)/usr/include" \
390 --with-rlm_eap_tls-lib-dir
="$(STAGING_DIR)/usr/lib"
391 CONFIGURE_LIBS
+= -lcrypto
-lssl
393 CONFIGURE_ARGS
+= --without-rlm_eap_tls
396 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-eap-ttls
),)
398 --with-rlm_eap_ttls \
399 --with-rlm_eap_ttls-include-dir
="$(STAGING_DIR)/usr/include" \
400 --with-rlm_eap_ttls-lib-dir
="$(STAGING_DIR)/usr/lib"
401 CONFIGURE_LIBS
+= -lcrypto
-lssl
403 CONFIGURE_ARGS
+= --without-rlm_eap_ttls
406 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-attr-rewrite
),)
407 CONFIGURE_ARGS
+= --with-rlm_attr-rewrite
409 CONFIGURE_ARGS
+= --without-rlm_attr-rewrite
412 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-radutmp
),)
413 CONFIGURE_ARGS
+= --with-rlm_radutmp
415 CONFIGURE_ARGS
+= --without-rlm_radutmp
418 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-logintime
),)
419 CONFIGURE_ARGS
+= --with-rlm_logintime
421 CONFIGURE_ARGS
+= --without-rlm_logintime
424 ifneq ($(SDK
)$(CONFIG_PACKAGE_freeradius2-mod-expiration
),)
425 CONFIGURE_ARGS
+= --with-rlm_expiration
427 CONFIGURE_ARGS
+= --without-rlm_expiration
431 LDFLAGS
="$$$$LDFLAGS" \
432 LIBS
="$(CONFIGURE_LIBS)" \
434 ac_cv_lib_readline
=no \
437 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
438 R
="$(PKG_INSTALL_DIR)" \
443 define Package
/freeradius2
/install
444 $(INSTALL_DIR
) $(1)/etc
/freeradius2
445 $(INSTALL_DIR
) $(1)/etc
/freeradius2
/modules
446 $(INSTALL_DIR
) $(1)/etc
/freeradius2
/sites
447 chmod
771 $(1)/etc
/freeradius2
448 for f in clients.conf dictionary radiusd.conf policy.conf
; do \
449 $(CP
) $(PKG_INSTALL_DIR
)/etc
/freeradius2
/$$$${f} $(1)/etc
/freeradius2
/ ; \
451 $(CP
) $(PKG_INSTALL_DIR
)/etc
/freeradius2
/sites-available
/default
$(1)/etc
/freeradius2
/sites
/default
452 $(INSTALL_DIR
) $(1)/usr
/share
/freeradius2
453 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/freeradius
/dictionary
$(1)/usr
/share
/freeradius2
/
454 $(SED
) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr
/share
/freeradius2
/dictionary
455 for f in
$(PKG_DICTIONARIES
); do \
456 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/freeradius
/dictionary.
$$$${f} $(1)/usr
/share
/freeradius2
/ ; \
457 $(SED
) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr
/share
/freeradius2
/dictionary
; \
459 $(INSTALL_DIR
) $(1)/usr
/lib
/freeradius2
460 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/freeradius2
/libfreeradius-radius
{,-*}.so
$(1)/usr
/lib
/freeradius2
461 ln
-s freeradius2
/libfreeradius-radius-
$(PKG_VERSION
).so
$(1)/usr
/lib
/
462 ln
-s freeradius2
/libfreeradius-eap-
$(PKG_VERSION
).so
$(1)/usr
/lib
/
463 $(INSTALL_DIR
) $(1)/usr
/sbin
464 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/radiusd
$(1)/usr
/sbin
/
465 $(INSTALL_DIR
) $(1)/etc
/init.d
466 $(INSTALL_BIN
) .
/files
/radiusd.init
$(1)/etc
/init.d
/radiusd
469 define Package
/freeradius2-democerts
/install
470 $(INSTALL_DIR
) $(1)/etc
/freeradius2
/certs
472 $(PKG_BUILD_DIR
)/raddb
/certs
/ca.pem \
473 $(PKG_BUILD_DIR
)/raddb
/certs
/dh \
474 $(PKG_BUILD_DIR
)/raddb
/certs
/random \
475 $(PKG_BUILD_DIR
)/raddb
/certs
/server.pem \
476 $(1)/etc
/freeradius2
/certs
/
479 define Package
/freeradius2-utils
/install
480 $(INSTALL_DIR
) $(1)/usr
/bin
481 for f in radclient radeapclient
; do \
482 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$$$${f} $(1)/usr
/bin
/ ; \
487 define Package
/$(1)/install
488 [ -z
"$(2)" ] ||
$(INSTALL_DIR
) $$(1)/usr
/lib
/freeradius2
490 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/freeradius2
/$$$$$$$${m}{,-*}.so
$$(1)/usr
/lib
/freeradius2
; \
492 [ -z
"$(3)" ] ||
$(INSTALL_DIR
) $$(1)/etc
/freeradius2
493 [ -z
"$(4)" ] ||
$(INSTALL_DIR
) $$(1)/etc
/freeradius2
/$(4)
495 $(CP
) $(PKG_INSTALL_DIR
)/etc
/freeradius2
/$$$$$$$${f} $$(1)/etc
/freeradius2
/$$$$$$$${f} ; \
499 $$(eval
$$(call BuildPackage
,$(1)))
502 $(eval
$(call BuildPackage
,freeradius2
))
503 $(eval
$(call BuildPackage
,freeradius2-democerts
))
504 $(eval
$(call BuildPlugin
,freeradius2-mod-chap
,rlm_chap
,modules
/chap
,modules
,))
505 $(eval
$(call BuildPlugin
,freeradius2-mod-detail
,rlm_detail
,modules
/detail
,modules
,))
506 $(eval
$(call BuildPlugin
,freeradius2-mod-eap
,libfreeradius-eap rlm_eap
,eap.conf
))
507 $(eval
$(call BuildPlugin
,freeradius2-mod-eap-gtc
,rlm_eap_gtc
,))
508 $(eval
$(call BuildPlugin
,freeradius2-mod-eap-md5
,rlm_eap_md5
,))
509 $(eval
$(call BuildPlugin
,freeradius2-mod-eap-mschapv2
,rlm_eap_mschapv2
,))
510 $(eval
$(call BuildPlugin
,freeradius2-mod-eap-peap
,rlm_eap_peap
,))
511 $(eval
$(call BuildPlugin
,freeradius2-mod-eap-tls
,rlm_eap_tls
,))
512 $(eval
$(call BuildPlugin
,freeradius2-mod-eap-ttls
,rlm_eap_ttls
,))
513 $(eval
$(call BuildPlugin
,freeradius2-mod-exec
,rlm_exec
,modules
/exec modules
/echo
,modules
,))
514 $(eval
$(call BuildPlugin
,freeradius2-mod-attr-rewrite
,rlm_attr_rewrite
,modules
/attr_rewrite
,modules
,))
515 $(eval
$(call BuildPlugin
,freeradius2-mod-files
,rlm_files
,acct_users preproxy_users users modules
/files
,modules
,))
516 $(eval
$(call BuildPlugin
,freeradius2-mod-ldap
,rlm_ldap
,ldap.attrmap modules
/ldap
,modules
,))
517 $(eval
$(call BuildPlugin
,freeradius2-mod-mschap
,rlm_mschap
,modules
/mschap
,modules
,))
518 $(eval
$(call BuildPlugin
,freeradius2-mod-pap
,rlm_pap
,modules
/pap
,modules
,))
519 $(eval
$(call BuildPlugin
,freeradius2-mod-preprocess
,rlm_preprocess
,hints huntgroups modules
/preprocess
,modules
,))
520 $(eval
$(call BuildPlugin
,freeradius2-mod-realm
,rlm_realm
,proxy.conf modules
/realm modules
/inner-eap
,modules
,))
521 $(eval
$(call BuildPlugin
,freeradius2-mod-sql
,rlm_sql
,sql.conf
,))
522 $(eval
$(call BuildPlugin
,freeradius2-mod-sql-mysql
,rlm_sql_mysql
,))
523 $(eval
$(call BuildPlugin
,freeradius2-mod-sql-pgsql
,rlm_sql_postgresql
,))
524 $(eval
$(call BuildPlugin
,freeradius2-mod-sqlcounter
,rlm_sqlcounter
,))
525 $(eval
$(call BuildPlugin
,freeradius2-mod-radutmp
,rlm_radutmp
,modules
/radutmp modules
/sradutmp
,modules
,))
526 $(eval
$(call BuildPlugin
,freeradius2-mod-logintime
,rlm_logintime
,modules
/logintime
,modules
,))
527 $(eval
$(call BuildPlugin
,freeradius2-mod-expr
,rlm_expr
,modules
/expr
,modules
,))
528 $(eval
$(call BuildPlugin
,freeradius2-mod-attr-filter
,rlm_attr_filter
,modules
/attr_filter attrs attrs.access_reject attrs.accounting_response attrs.pre-proxy
,modules
,,))
529 $(eval
$(call BuildPlugin
,freeradius2-mod-expiration
,rlm_expiration
,modules
/expiration
,modules
,))
530 $(eval
$(call BuildPackage
,freeradius2-utils
))