2 # Copyright (C) 2008-2009 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:=b8df6cf0c3df1dded205ad5f954feb78
18 PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
20 include $(INCLUDE_DIR)/package.mk
22 define Package/freeradius2/Default
25 URL:=http://freeradius.org/
28 define Package/freeradius2
29 $(call Package/freeradius2/Default)
30 DEPENDS:=+libltdl +libopenssl +libpthread +libreadline
31 TITLE:=A flexible RADIUS server (version 2)
35 define Package/freeradius2/conffiles
36 /etc/freeradius2/clients.conf
37 /etc/freeradius2/radiusd.conf
38 /etc/freeradius2/sites/default
41 define Package/freeradius2-democerts
42 $(call Package/freeradius2/Default)
44 TITLE:=Demo certificates to test the server
47 define Package/freeradius2-mod-chap
48 $(call Package/freeradius2/Default)
53 define Package/freeradius2-mod-chap/conffiles
54 /etc/freeradius2/modules/chap
57 define Package/freeradius2-mod-detail
58 $(call Package/freeradius2/Default)
60 TITLE:=Detailed accounting module
63 define Package/freeradius2-mod-detail/conffiles
64 /etc/freeradius2/modules/detail
67 define Package/freeradius2-mod-eap
68 $(call Package/freeradius2/Default)
70 TITLE:=Base EAP module
73 define Package/freeradius2-mod-eap/conffiles
74 /etc/freeradius2/eap.conf
77 define Package/freeradius2-mod-eap-gtc
78 $(call Package/freeradius2/Default)
79 DEPENDS:=freeradius2-mod-eap
83 define Package/freeradius2-mod-eap-md5
84 $(call Package/freeradius2/Default)
85 DEPENDS:=freeradius2-mod-eap
89 define Package/freeradius2-mod-eap-mschapv2
90 $(call Package/freeradius2/Default)
91 DEPENDS:=freeradius2-mod-eap
92 TITLE:=EAP/MS-CHAPv2 module
95 define Package/freeradius2-mod-eap-peap
96 $(call Package/freeradius2/Default)
97 DEPENDS:=freeradius2-mod-eap
98 TITLE:=EAP/PEAP module
101 define Package/freeradius2-mod-eap-tls
102 $(call Package/freeradius2/Default)
103 DEPENDS:=freeradius2-mod-eap
104 TITLE:=EAP/TLS module
107 define Package/freeradius2-mod-eap-ttls
108 $(call Package/freeradius2/Default)
109 DEPENDS:=freeradius2-mod-eap-tls
110 TITLE:=EAP/TTLS module
113 define Package/freeradius2-mod-exec
114 $(call Package/freeradius2/Default)
119 define Package/freeradius2-mod-exec/conffiles
120 /etc/freeradius2/modules/exec
123 define Package/freeradius2-mod-expiration
124 $(call Package/freeradius2/Default)
126 TITLE:=Expiration module
129 define Package/freeradius2-mod-expiration/conffiles
130 /etc/freeradius2/modules/expiration
133 define Package/freeradius2-mod-expr
134 $(call Package/freeradius2/Default)
139 define Package/freeradius2-mod-expr/conffiles
140 /etc/freeradius2/modules/expr
143 define Package/freeradius2-mod-attr-filter
144 $(call Package/freeradius2/Default)
146 TITLE:=ATTR filter module
149 define Package/freeradius2-mod-attr-filter/conffiles
150 /etc/freeradius2/modules/attr_filter
151 /etc/freeradius2/attrs
152 /etc/freeradius2/attrs.access_reject
153 /etc/freeradius2/attrs.accounting_response
154 /etc/freeradius2/attrs.pre-proxy
157 define Package/freeradius2-mod-attr-rewrite
158 $(call Package/freeradius2/Default)
160 TITLE:=ATTR rewrite module
163 define Package/freeradius2-mod-attr-rewrite/conffiles
164 /etc/freeradius2/modules/attr_rewrite
167 define Package/freeradius2-mod-files
168 $(call Package/freeradius2/Default)
170 TITLE:=Module using local files for authorization
173 define Package/freeradius2-mod-files/conffiles
174 /etc/freeradius2/acct_users
175 /etc/freeradius2/preproxy_users
176 /etc/freeradius2/users
177 /etc/freeradius2/modules/files
180 define Package/freeradius2-mod-ldap
181 $(call Package/freeradius2/Default)
182 DEPENDS:=freeradius2 +libopenldap
186 define Package/freeradius2-mod-ldap/conffiles
187 /etc/freeradius2/ldap.attrmap
188 /etc/freeradius2/modules/ldap
191 define Package/freeradius2-mod-logintime
192 $(call Package/freeradius2/Default)
194 TITLE:=Logintime module
197 define Package/freeradius2-mod-logintime/conffiles
198 /etc/freeradius2/modules/logintime
201 define Package/freeradius2-mod-mschap
202 $(call Package/freeradius2/Default)
204 TITLE:=MS-CHAP and MS-CHAPv2 module
207 define Package/freeradius2-mod-mschap/conffiles
208 /etc/freeradius2/modules/mschap
211 define Package/freeradius2-mod-pap
212 $(call Package/freeradius2/Default)
217 define Package/freeradius2-mod-pap/conffiles
218 /etc/freeradius2/modules/pap
221 define Package/freeradius2-mod-preprocess
222 $(call Package/freeradius2/Default)
224 TITLE:=Request pre-processing module
227 define Package/freeradius2-mod-preprocess/conffiles
228 /etc/freeradius2/hints
229 /etc/freeradius2/huntgroups
230 /etc/freeradius2/modules/preprocess
233 define Package/freeradius2-mod-realm
234 $(call Package/freeradius2/Default)
236 TITLE:=Realms handling module
239 define Package/freeradius2-mod-realm/conffiles
240 /etc/freeradius2/proxy.conf
241 /etc/freeradius2/modules/realm
244 define Package/freeradius2-mod-sql
245 $(call Package/freeradius2/Default)
247 TITLE:=Base SQL module
250 define Package/freeradius2-mod-sql/conffiles
251 /etc/freeradius2/sql.conf
254 define Package/freeradius2-mod-sql-mysql
255 $(call Package/freeradius2/Default)
256 DEPENDS:=freeradius2-mod-sql +libmysqlclient
260 define Package/freeradius2-mod-sql-pgsql
261 $(call Package/freeradius2/Default)
262 DEPENDS:=freeradius2-mod-sql +libpq
263 TITLE:=PostgreSQL module
266 define Package/freeradius2-mod-sqlcounter
267 $(call Package/freeradius2/Default)
268 DEPENDS:=freeradius2-mod-sql
269 TITLE:=Generic SQL Counter module
272 define Package/freeradius2-mod-radutmp
273 $(call Package/freeradius2/Default)
275 TITLE:=Radius UTMP module
278 define Package/freeradius2-mod-radutmp/conffiles
279 /etc/freeradius2/modules/radutmp
280 /etc/freeradius2/modules/sradutmp
283 define Package/freeradius2-utils
284 $(call Package/freeradius2/Default)
286 TITLE:=Misc. client utilities
290 --libdir=/usr/lib/freeradius2 \
291 --libexecdir=/usr/lib/freeradius2 \
294 --disable-developer \
296 --with-openssl-includes="$(STAGING_DIR)/usr/include" \
297 --with-openssl-libraries="$(STAGING_DIR)/usr/lib" \
298 --with-system-libtool \
299 --with-system-libltdl \
300 --enable-strict-dependencies \
301 --with-raddbdir=/etc/freeradius2 \
302 --with-radacctdir=/var/db/radacct \
303 --with-logdir=/var/log \
306 --without-rlm_checkval \
308 --without-rlm_counter \
311 --without-rlm_eap_sim \
312 --without-rlm_example \
313 --without-rlm_ippool \
316 --without-rlm_smsotp \
319 --without-rlm_python \
321 --without-rlm_always \
323 --with-rlm_sqlcounter \
324 --without-rlm_sqlhpwippool \
325 --without-rlm_sqlippool \
326 --without-rlm_sql_db2 \
327 --without-rlm_sql_firebird \
328 --without-rlm_sql_freetds \
329 --without-rlm_sql_iodbc \
330 --without-rlm_sql_oracle \
331 --without-rlm_sql_sybase \
332 --without-rlm_sql_unixodbc \
333 --without-rlm_sql_log \
334 --without-rlm_sql_sqlite \
336 --without-rlm_eap_tnc \
337 --without-rlm_eap_ikev2 \
338 --without-rlm_opendirectory \
339 --without-rlm_wimax \
342 freeradius freeradius.internal \
343 rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
344 rfc4372 rfc4675 rfc4679 \
348 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
350 --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
351 --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
352 CONFIGURE_LIBS+= -lcrypto -lssl
354 CONFIGURE_ARGS+= --without-rlm_ldap
357 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql),)
359 --with-mysql-include-dir="$(STAGING_DIR)/usr/include" \
360 --with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql"
362 CONFIGURE_VARS+= ac_cv_lib_mysqlclient_r_mysql_init=yes
364 CONFIGURE_ARGS+= --without-rlm_sql_mysql
367 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-pgsql),)
369 --with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
370 --with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
372 CONFIGURE_ARGS+= --without-rlm_sql_postgresql
375 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap),)
377 --with-rlm_eap_peap \
378 --with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
379 --with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
380 CONFIGURE_LIBS+= -lcrypto -lssl
382 CONFIGURE_ARGS+= --without-rlm_eap_peap
385 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-tls),)
388 --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
389 --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
390 CONFIGURE_LIBS+= -lcrypto -lssl
392 CONFIGURE_ARGS+= --without-rlm_eap_tls
395 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-ttls),)
397 --with-rlm_eap_ttls \
398 --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
399 --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
400 CONFIGURE_LIBS+= -lcrypto -lssl
402 CONFIGURE_ARGS+= --without-rlm_eap_ttls
405 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-attr-rewrite),)
406 CONFIGURE_ARGS+= --with-rlm_attr-rewrite
408 CONFIGURE_ARGS+= --without-rlm_attr-rewrite
411 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-radutmp),)
412 CONFIGURE_ARGS+= --with-rlm_radutmp
414 CONFIGURE_ARGS+= --without-rlm_radutmp
417 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-logintime),)
418 CONFIGURE_ARGS+= --with-rlm_logintime
420 CONFIGURE_ARGS+= --without-rlm_logintime
423 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-expiration),)
424 CONFIGURE_ARGS+= --with-rlm_expiration
426 CONFIGURE_ARGS+= --without-rlm_expiration
430 LDFLAGS="$$$$LDFLAGS" \
431 LIBS="$(CONFIGURE_LIBS)" \
433 ac_cv_lib_readline=no \
436 $(MAKE) -C $(PKG_BUILD_DIR) \
437 R="$(PKG_INSTALL_DIR)" \
442 define Package/freeradius2/install
443 $(INSTALL_DIR) $(1)/etc/freeradius2
444 $(INSTALL_DIR) $(1)/etc/freeradius2/modules
445 $(INSTALL_DIR) $(1)/etc/freeradius2/sites
446 for f in clients.conf dictionary radiusd.conf policy.conf; do \
447 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$${f} $(1)/etc/freeradius2/ ; \
449 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/sites-available/default $(1)/etc/freeradius2/sites/default
450 $(INSTALL_DIR) $(1)/usr/share/freeradius2
451 $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary $(1)/usr/share/freeradius2/
452 $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius2/dictionary
453 for f in $(PKG_DICTIONARIES); do \
454 $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$$$${f} $(1)/usr/share/freeradius2/ ; \
455 $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr/share/freeradius2/dictionary ; \
457 $(INSTALL_DIR) $(1)/usr/lib/freeradius2
458 $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2
459 $(INSTALL_DIR) $(1)/usr/sbin
460 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
461 $(INSTALL_DIR) $(1)/etc/init.d
462 $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
465 define Package/freeradius2-democerts/install
466 $(INSTALL_DIR) $(1)/etc/freeradius2
467 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/certs $(1)/etc/freeradius2/
468 rm -rf $(1)/etc/freeradius2/certs/README
469 rm -rf $(1)/etc/freeradius2/certs/new*
470 rm -rf $(1)/etc/freeradius2/certs/demoCA/index*
471 rm -rf $(1)/etc/freeradius2/certs/demoCA/serial*
472 rm -rf $(1)/etc/freeradius2/certs/bootstrap
473 rm -rf $(1)/etc/freeradius2/certs/Makefile
474 rm -rf $(1)/etc/freeradius2/certs/ca.cnf
475 rm -rf $(1)/etc/freeradius2/certs/client.cnf
476 rm -rf $(1)/etc/freeradius2/certs/server.cnf
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))