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:=8ea2bd39460a06212decf2c14fdf3fb8
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-always
135 $(call Package/freeradius2/Default)
140 define Package/freeradius2-mod-always/conffiles
141 /etc/freeradius2/modules/always
144 define Package/freeradius2-mod-expr
145 $(call Package/freeradius2/Default)
150 define Package/freeradius2-mod-expr/conffiles
151 /etc/freeradius2/modules/expr
154 define Package/freeradius2-mod-attr-filter
155 $(call Package/freeradius2/Default)
157 TITLE:=ATTR filter module
160 define Package/freeradius2-mod-attr-filter/conffiles
161 /etc/freeradius2/modules/attr_filter
162 /etc/freeradius2/attrs
163 /etc/freeradius2/attrs.access_reject
164 /etc/freeradius2/attrs.accounting_response
165 /etc/freeradius2/attrs.pre-proxy
168 define Package/freeradius2-mod-attr-rewrite
169 $(call Package/freeradius2/Default)
171 TITLE:=ATTR rewrite module
174 define Package/freeradius2-mod-attr-rewrite/conffiles
175 /etc/freeradius2/modules/attr_rewrite
178 define Package/freeradius2-mod-files
179 $(call Package/freeradius2/Default)
181 TITLE:=Module using local files for authorization
184 define Package/freeradius2-mod-files/conffiles
185 /etc/freeradius2/acct_users
186 /etc/freeradius2/preproxy_users
187 /etc/freeradius2/users
188 /etc/freeradius2/modules/files
191 define Package/freeradius2-mod-passwd
192 $(call Package/freeradius2/Default)
194 TITLE:=Rlm passwd module
197 define Package/freeradius2-mod-passwd/conffiles
198 /etc/freeradius2/modules/passwd
201 define Package/freeradius2-mod-ldap
202 $(call Package/freeradius2/Default)
203 DEPENDS:=freeradius2 +libopenldap
207 define Package/freeradius2-mod-ldap/conffiles
208 /etc/freeradius2/ldap.attrmap
209 /etc/freeradius2/modules/ldap
212 define Package/freeradius2-mod-logintime
213 $(call Package/freeradius2/Default)
215 TITLE:=Logintime module
218 define Package/freeradius2-mod-logintime/conffiles
219 /etc/freeradius2/modules/logintime
222 define Package/freeradius2-mod-mschap
223 $(call Package/freeradius2/Default)
225 TITLE:=MS-CHAP and MS-CHAPv2 module
228 define Package/freeradius2-mod-mschap/conffiles
229 /etc/freeradius2/modules/mschap
232 define Package/freeradius2-mod-pap
233 $(call Package/freeradius2/Default)
238 define Package/freeradius2-mod-pap/conffiles
239 /etc/freeradius2/modules/pap
242 define Package/freeradius2-mod-preprocess
243 $(call Package/freeradius2/Default)
245 TITLE:=Request pre-processing module
248 define Package/freeradius2-mod-preprocess/conffiles
249 /etc/freeradius2/hints
250 /etc/freeradius2/huntgroups
251 /etc/freeradius2/modules/preprocess
254 define Package/freeradius2-mod-realm
255 $(call Package/freeradius2/Default)
257 TITLE:=Realms handling module
260 define Package/freeradius2-mod-realm/conffiles
261 /etc/freeradius2/proxy.conf
262 /etc/freeradius2/modules/realm
265 define Package/freeradius2-mod-sql
266 $(call Package/freeradius2/Default)
268 TITLE:=Base SQL module
271 define Package/freeradius2-mod-sql/conffiles
272 /etc/freeradius2/sql.conf
275 define Package/freeradius2-mod-sql-mysql
276 $(call Package/freeradius2/Default)
277 DEPENDS:=freeradius2-mod-sql \
278 +PACKAGE_freeradius2-mod-sql-mysql:libmysqlclient_r
282 define Package/freeradius2-mod-sql-pgsql
283 $(call Package/freeradius2/Default)
284 DEPENDS:=freeradius2-mod-sql \
285 +PACKAGE_freeradius2-mod-sql-pgsql:libpq
286 TITLE:=PostgreSQL module
289 define Package/freeradius2-mod-sql-sqlite
290 $(call Package/freeradius2/Default)
291 DEPENDS:=freeradius2-mod-sql \
292 +PACKAGE_freeradius2-mod-sql-sqlite:libsqlite3
296 define Package/freeradius2-mod-sqlcounter
297 $(call Package/freeradius2/Default)
298 DEPENDS:=freeradius2-mod-sql
299 TITLE:=Generic SQL Counter module
302 define Package/freeradius2-mod-radutmp
303 $(call Package/freeradius2/Default)
305 TITLE:=Radius UTMP module
308 define Package/freeradius2-mod-radutmp/conffiles
309 /etc/freeradius2/modules/radutmp
310 /etc/freeradius2/modules/sradutmp
313 define Package/freeradius2-utils
314 $(call Package/freeradius2/Default)
316 TITLE:=Misc. client utilities
320 --libdir=/usr/lib/freeradius2 \
321 --libexecdir=/usr/lib/freeradius2 \
324 --disable-developer \
326 --with-openssl-includes="$(STAGING_DIR)/usr/include" \
327 --with-openssl-libraries="$(STAGING_DIR)/usr/lib" \
328 --with-system-libtool \
329 --with-system-libltdl \
330 --enable-strict-dependencies \
331 --with-raddbdir=/etc/freeradius2 \
332 --with-radacctdir=/var/db/radacct \
333 --with-logdir=/var/log \
336 --without-rlm_checkval \
338 --without-rlm_counter \
341 --without-rlm_eap_sim \
342 --without-rlm_example \
343 --without-rlm_ippool \
346 --without-rlm_smsotp \
349 --without-rlm_python \
352 --with-rlm_sqlcounter \
353 --without-rlm_sqlhpwippool \
354 --without-rlm_sqlippool \
355 --without-rlm_sql_db2 \
356 --without-rlm_sql_firebird \
357 --without-rlm_sql_freetds \
358 --without-rlm_sql_iodbc \
359 --without-rlm_sql_oracle \
360 --without-rlm_sql_sybase \
361 --without-rlm_sql_unixodbc \
362 --without-rlm_sql_log \
364 --without-rlm_eap_tnc \
365 --without-rlm_eap_ikev2 \
366 --without-rlm_opendirectory \
367 --without-rlm_wimax \
371 freeradius freeradius.internal \
372 rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
373 rfc4372 rfc4675 rfc4679 \
377 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
379 --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
380 --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
381 CONFIGURE_LIBS+= -lcrypto -lssl
383 CONFIGURE_ARGS+= --without-rlm_ldap
386 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql),)
388 --with-mysql-include-dir="$(STAGING_DIR)/usr/include" \
389 --with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql"
391 CONFIGURE_VARS+= ac_cv_lib_mysqlclient_r_mysql_init=yes
393 CONFIGURE_ARGS+= --without-rlm_sql_mysql
396 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-pgsql),)
398 --with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
399 --with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
401 CONFIGURE_ARGS+= --without-rlm_sql_postgresql
404 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-sqlite),)
406 --with-rlm_sql_sqlite \
407 --with-experimental-modules \
408 --with-sqlite-include-dir="$(STAGING_DIR)/usr/include" \
409 --with-sqlite-lib-dir="$(STAGING_DIR)/usr/lib"
411 CONFIGURE_ARGS+= --without-rlm_sql_sqlite
414 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap),)
416 --with-rlm_eap_peap \
417 --with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
418 --with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
419 CONFIGURE_LIBS+= -lcrypto -lssl
421 CONFIGURE_ARGS+= --without-rlm_eap_peap
424 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-tls),)
427 --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
428 --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
429 CONFIGURE_LIBS+= -lcrypto -lssl
431 CONFIGURE_ARGS+= --without-rlm_eap_tls
434 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-ttls),)
436 --with-rlm_eap_ttls \
437 --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
438 --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
439 CONFIGURE_LIBS+= -lcrypto -lssl
441 CONFIGURE_ARGS+= --without-rlm_eap_ttls
444 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-attr-rewrite),)
445 CONFIGURE_ARGS+= --with-rlm_attr-rewrite
447 CONFIGURE_ARGS+= --without-rlm_attr-rewrite
450 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-radutmp),)
451 CONFIGURE_ARGS+= --with-rlm_radutmp
453 CONFIGURE_ARGS+= --without-rlm_radutmp
456 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-logintime),)
457 CONFIGURE_ARGS+= --with-rlm_logintime
459 CONFIGURE_ARGS+= --without-rlm_logintime
462 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-expiration),)
463 CONFIGURE_ARGS+= --with-rlm_expiration
465 CONFIGURE_ARGS+= --without-rlm_expiration
468 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-always),)
469 CONFIGURE_ARGS+= --with-rlm_always
471 CONFIGURE_ARGS+= --without-rlm_always
475 LDFLAGS="$$$$LDFLAGS" \
476 LIBS="$(CONFIGURE_LIBS)" \
478 ac_cv_lib_readline=no \
481 $(MAKE) -C $(PKG_BUILD_DIR) \
482 R="$(PKG_INSTALL_DIR)" \
487 define Package/freeradius2/install
488 $(INSTALL_DIR) $(1)/etc/freeradius2
489 $(INSTALL_DIR) $(1)/etc/freeradius2/modules
490 $(INSTALL_DIR) $(1)/etc/freeradius2/sites
491 chmod 771 $(1)/etc/freeradius2
492 for f in clients.conf dictionary radiusd.conf policy.conf; do \
493 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$${f} $(1)/etc/freeradius2/ ; \
495 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/sites-available/default $(1)/etc/freeradius2/sites/default
496 $(INSTALL_DIR) $(1)/usr/share/freeradius2
497 $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary $(1)/usr/share/freeradius2/
498 $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius2/dictionary
499 for f in $(PKG_DICTIONARIES); do \
500 $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$$$${f} $(1)/usr/share/freeradius2/ ; \
501 $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr/share/freeradius2/dictionary ; \
503 $(INSTALL_DIR) $(1)/usr/lib/freeradius2
504 $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2
505 ln -s freeradius2/libfreeradius-radius-$(PKG_VERSION).so $(1)/usr/lib/
506 ln -s freeradius2/libfreeradius-eap-$(PKG_VERSION).so $(1)/usr/lib/
507 $(INSTALL_DIR) $(1)/usr/sbin
508 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
509 $(INSTALL_DIR) $(1)/etc/init.d
510 $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
513 define Package/freeradius2-democerts/install
514 $(INSTALL_DIR) $(1)/etc/freeradius2/certs
516 $(PKG_BUILD_DIR)/raddb/certs/ca.pem \
517 $(PKG_BUILD_DIR)/raddb/certs/dh \
518 $(PKG_BUILD_DIR)/raddb/certs/random \
519 $(PKG_BUILD_DIR)/raddb/certs/server.pem \
520 $(1)/etc/freeradius2/certs/
523 define Package/freeradius2-utils/install
524 $(INSTALL_DIR) $(1)/usr/bin
525 for f in radclient radeapclient radwho; do \
526 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
531 define Package/$(1)/install
532 [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius2
534 $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/$$$$$$$${m}{,-*}.so $$(1)/usr/lib/freeradius2 ; \
536 [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2
537 [ -z "$(4)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2/$(4)
539 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$$$$$${f} $$(1)/etc/freeradius2/$$$$$$$${f} ; \
543 $$(eval $$(call BuildPackage,$(1)))
546 $(eval $(call BuildPackage,freeradius2))
547 $(eval $(call BuildPackage,freeradius2-democerts))
548 $(eval $(call BuildPlugin,freeradius2-mod-chap,rlm_chap,modules/chap,modules,))
549 $(eval $(call BuildPlugin,freeradius2-mod-detail,rlm_detail,modules/detail,modules,))
550 $(eval $(call BuildPlugin,freeradius2-mod-eap,libfreeradius-eap rlm_eap,eap.conf))
551 $(eval $(call BuildPlugin,freeradius2-mod-eap-gtc,rlm_eap_gtc,))
552 $(eval $(call BuildPlugin,freeradius2-mod-eap-md5,rlm_eap_md5,))
553 $(eval $(call BuildPlugin,freeradius2-mod-eap-mschapv2,rlm_eap_mschapv2,))
554 $(eval $(call BuildPlugin,freeradius2-mod-eap-peap,rlm_eap_peap,))
555 $(eval $(call BuildPlugin,freeradius2-mod-eap-tls,rlm_eap_tls,))
556 $(eval $(call BuildPlugin,freeradius2-mod-eap-ttls,rlm_eap_ttls,))
557 $(eval $(call BuildPlugin,freeradius2-mod-exec,rlm_exec,modules/exec modules/echo ,modules,))
558 $(eval $(call BuildPlugin,freeradius2-mod-attr-rewrite,rlm_attr_rewrite,modules/attr_rewrite,modules,))
559 $(eval $(call BuildPlugin,freeradius2-mod-files,rlm_files,acct_users preproxy_users users modules/files,modules,))
560 $(eval $(call BuildPlugin,freeradius2-mod-passwd,rlm_passwd,modules/passwd,modules,))
561 $(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap modules/ldap,modules,))
562 $(eval $(call BuildPlugin,freeradius2-mod-mschap,rlm_mschap,modules/mschap,modules,))
563 $(eval $(call BuildPlugin,freeradius2-mod-pap,rlm_pap,modules/pap,modules,))
564 $(eval $(call BuildPlugin,freeradius2-mod-preprocess,rlm_preprocess,hints huntgroups modules/preprocess,modules,))
565 $(eval $(call BuildPlugin,freeradius2-mod-realm,rlm_realm,proxy.conf modules/realm modules/inner-eap,modules,))
566 $(eval $(call BuildPlugin,freeradius2-mod-sql,rlm_sql,sql.conf,))
567 $(eval $(call BuildPlugin,freeradius2-mod-sql-mysql,rlm_sql_mysql,))
568 $(eval $(call BuildPlugin,freeradius2-mod-sql-pgsql,rlm_sql_postgresql,))
569 $(eval $(call BuildPlugin,freeradius2-mod-sql-sqlite,rlm_sql_sqlite,))
570 $(eval $(call BuildPlugin,freeradius2-mod-sqlcounter,rlm_sqlcounter,))
571 $(eval $(call BuildPlugin,freeradius2-mod-radutmp,rlm_radutmp,modules/radutmp modules/sradutmp,modules,))
572 $(eval $(call BuildPlugin,freeradius2-mod-logintime,rlm_logintime,modules/logintime,modules,))
573 $(eval $(call BuildPlugin,freeradius2-mod-expr,rlm_expr,modules/expr,modules,))
574 $(eval $(call BuildPlugin,freeradius2-mod-attr-filter,rlm_attr_filter,modules/attr_filter attrs attrs.access_reject attrs.accounting_response attrs.pre-proxy,modules,,))
575 $(eval $(call BuildPlugin,freeradius2-mod-expiration,rlm_expiration,modules/expiration,modules,))
576 $(eval $(call BuildPlugin,freeradius2-mod-always,rlm_always,modules/always,modules,))
577 $(eval $(call BuildPackage,freeradius2-utils))