You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

645 lines
19 KiB

  1. #
  2. # Copyright (C) 2008-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=freeradius3
  9. PKG_VERSION:=release_3_0_17
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/FreeRADIUS/freeradius-server/archive
  13. PKG_HASH:=5b2382f08c0d9d064298281c1fb8348fc13df76550ce7a5cfc47ea91361fad91
  14. PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=COPYRIGHT LICENSE
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
  18. PKG_FIXUP:=autoreconf
  19. PKG_CONFIG_DEPENDS := \
  20. FREERADIUS3_OPENSSL \
  21. FREERADIUS3_NOSSL
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/freeradius3/config
  24. source "$(SOURCE)/Config.in"
  25. endef
  26. define Package/freeradius3/Default
  27. SECTION:=net
  28. CATEGORY:=Network
  29. URL:=http://freeradius.org/
  30. SUBMENU:=FreeRADIUS (version 3)
  31. endef
  32. define Package/freeradius3
  33. $(call Package/freeradius3/Default)
  34. DEPENDS:=+freeradius3-common
  35. TITLE:=A flexible RADIUS server (version 3)
  36. endef
  37. define Package/freeradius3/conffiles
  38. /etc/freeradius3/clients.conf
  39. /etc/freeradius3/radiusd.conf
  40. /etc/freeradius3/sites/default
  41. endef
  42. define Package/freeradius3-common
  43. $(call Package/freeradius3/Default)
  44. TITLE:=common files
  45. DEPENDS:=+USE_GLIBC:libpthread +FREERADIUS3_OPENSSL:libopenssl +libcap +libpcap +libncurses +PACKAGE_libpcre:libpcre +libreadline +libtalloc
  46. endef
  47. define Package/freeradius3-default
  48. $(call Package/freeradius3/Default)
  49. DEPENDS:=freeradius3 \
  50. +freeradius3-democerts \
  51. +freeradius3-mod-always \
  52. +freeradius3-mod-attr-filter \
  53. +freeradius3-mod-chap \
  54. +freeradius3-mod-detail \
  55. +freeradius3-mod-digest \
  56. +freeradius3-mod-eap \
  57. +freeradius3-mod-eap-gtc \
  58. +freeradius3-mod-eap-leap \
  59. +freeradius3-mod-eap-md5 \
  60. +freeradius3-mod-eap-mschapv2 \
  61. +freeradius3-mod-eap-peap \
  62. +freeradius3-mod-eap-tls \
  63. +freeradius3-mod-eap-ttls \
  64. +freeradius3-mod-eap-pwd \
  65. +freeradius3-mod-exec \
  66. +freeradius3-mod-expiration \
  67. +freeradius3-mod-expr \
  68. +freeradius3-mod-files \
  69. +freeradius3-mod-logintime \
  70. +freeradius3-mod-mschap \
  71. +freeradius3-mod-pap \
  72. +freeradius3-mod-preprocess \
  73. +freeradius3-mod-radutmp \
  74. +freeradius3-mod-realm \
  75. +freeradius3-mod-unix
  76. TITLE:=Modules needed for Radius default configuration
  77. endef
  78. define Package/freeradius3-democerts
  79. $(call Package/freeradius3/Default)
  80. DEPENDS:=freeradius3
  81. TITLE:=Demo certificates to test the server
  82. endef
  83. define Package/freeradius3-mod-chap
  84. $(call Package/freeradius3/Default)
  85. DEPENDS:=freeradius3
  86. TITLE:=CHAP module
  87. endef
  88. define Package/freeradius3-mod-chap/conffiles
  89. /etc/freeradius3/mods-available/chap
  90. /etc/freeradius3/mods-enabled/chap
  91. endef
  92. define Package/freeradius3-mod-detail
  93. $(call Package/freeradius3/Default)
  94. DEPENDS:=freeradius3
  95. TITLE:=Detailed accounting module
  96. endef
  97. define Package/freeradius3-mod-detail/conffiles
  98. /etc/freeradius3/mods-available/detail
  99. /etc/freeradius3/mods-enabled/detail
  100. endef
  101. define Package/freeradius3-mod-digest
  102. $(call Package/freeradius3/Default)
  103. DEPENDS:=freeradius3
  104. TITLE:=HTTP Digest Authentication
  105. endef
  106. define Package/freeradius3-mod-digest/conffiles
  107. /etc/freeradius3/mods-available/digest
  108. /etc/freeradius3/mods-enabled/digest
  109. endef
  110. define Package/freeradius3-mod-eap
  111. $(call Package/freeradius3/Default)
  112. DEPENDS:=freeradius3
  113. TITLE:=Base EAP module
  114. endef
  115. define Package/freeradius3-mod-eap/conffiles
  116. /etc/freeradius3/mods-available/eap
  117. /etc/freeradius3/mods-enabled/eap
  118. /etc/freeradius3/policy.d/eap
  119. /etc/freeradius3/sites-enabled/inner-tunnel
  120. /etc/freeradius3/sites-available/inner-tunnel
  121. endef
  122. define Package/freeradius3-mod-eap-gtc
  123. $(call Package/freeradius3/Default)
  124. DEPENDS:=freeradius3-mod-eap
  125. TITLE:=EAP/GTC module
  126. endef
  127. define Package/freeradius3-mod-eap-leap
  128. $(call Package/freeradius3/Default)
  129. DEPENDS:=freeradius3-mod-eap
  130. TITLE:=EAP/LEAP module
  131. endef
  132. define Package/freeradius3-mod-eap-md5
  133. $(call Package/freeradius3/Default)
  134. DEPENDS:=freeradius3-mod-eap
  135. TITLE:=EAP/MD5 module
  136. endef
  137. define Package/freeradius3-mod-eap-mschapv2
  138. $(call Package/freeradius3/Default)
  139. DEPENDS:=freeradius3-mod-eap +freeradius3-mod-mschap
  140. TITLE:=EAP/MS-CHAPv2 module
  141. endef
  142. define Package/freeradius3-mod-eap-peap
  143. $(call Package/freeradius3/Default)
  144. DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
  145. TITLE:=EAP/PEAP module
  146. endef
  147. define Package/freeradius3-mod-eap-tls
  148. $(call Package/freeradius3/Default)
  149. DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
  150. TITLE:=EAP/TLS module
  151. endef
  152. define Package/freeradius3-mod-eap-ttls
  153. $(call Package/freeradius3/Default)
  154. DEPENDS:=freeradius3-mod-eap-tls
  155. TITLE:=EAP/TTLS module
  156. endef
  157. define Package/freeradius3-mod-eap-pwd
  158. $(call Package/freeradius3/Default)
  159. DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
  160. TITLE:=EAP/PWD module
  161. endef
  162. define Package/freeradius3-mod-exec
  163. $(call Package/freeradius3/Default)
  164. DEPENDS:=freeradius3
  165. TITLE:=EXEC module
  166. endef
  167. define Package/freeradius3-mod-exec/conffiles
  168. /etc/freeradius3/mods-available/exec
  169. /etc/freeradius3/mods-enabled/exec
  170. endef
  171. define Package/freeradius3-mod-expiration
  172. $(call Package/freeradius3/Default)
  173. DEPENDS:=freeradius3
  174. TITLE:=Expiration module
  175. endef
  176. define Package/freeradius3-mod-expiration/conffiles
  177. /etc/freeradius3/mods-available/expiration
  178. /etc/freeradius3/mods-enabled/expiration
  179. endef
  180. define Package/freeradius3-mod-always
  181. $(call Package/freeradius3/Default)
  182. DEPENDS:=freeradius3
  183. TITLE:=Always module
  184. endef
  185. define Package/freeradius3-mod-always/conffiles
  186. /etc/freeradius3/mods-available/always
  187. /etc/freeradius3/mods-enabled/always
  188. endef
  189. define Package/freeradius3-mod-expr
  190. $(call Package/freeradius3/Default)
  191. DEPENDS:=freeradius3
  192. TITLE:=EXPR module
  193. endef
  194. define Package/freeradius3-mod-expr/conffiles
  195. /etc/freeradius3/mods-available/expr
  196. /etc/freeradius3/mods-enabled/expr
  197. endef
  198. define Package/freeradius3-mod-attr-filter
  199. $(call Package/freeradius3/Default)
  200. DEPENDS:=freeradius3
  201. TITLE:=ATTR filter module
  202. endef
  203. define Package/freeradius3-mod-attr-filter/conffiles
  204. /etc/freeradius3/mods-available/attr_filter
  205. /etc/freeradius3/mods-enabled/attr_filter
  206. /etc/freeradius3/mods-config/attr_filter/access_challenge
  207. /etc/freeradius3/mods-config/attr_filter/access_reject
  208. /etc/freeradius3/mods-config/attr_filter/accounting_response
  209. /etc/freeradius3/mods-config/attr_filter/post-proxy
  210. /etc/freeradius3/mods-config/attr_filter/pre-proxy
  211. endef
  212. define Package/freeradius3-mod-attr-rewrite
  213. $(call Package/freeradius3/Default)
  214. DEPENDS:=freeradius3
  215. TITLE:=ATTR rewrite module
  216. endef
  217. define Package/freeradius3-mod-files
  218. $(call Package/freeradius3/Default)
  219. DEPENDS:=freeradius3
  220. TITLE:=Module using local files for authorization
  221. endef
  222. define Package/freeradius3-mod-files/conffiles
  223. /etc/freeradius3/mods-available/files
  224. /etc/freeradius3/mods-enabled/files
  225. /etc/freeradius3/mods-config/files/accounting
  226. /etc/freeradius3/mods-config/files/authorize
  227. /etc/freeradius3/mods-config/files/pre-proxy
  228. endef
  229. define Package/freeradius3-mod-passwd
  230. $(call Package/freeradius3/Default)
  231. DEPENDS:=freeradius3
  232. TITLE:=Rlm passwd module
  233. endef
  234. define Package/freeradius3-mod-passwd/conffiles
  235. /etc/freeradius3/mods-available/passwd
  236. /etc/freeradius3/mods-enabled/passwd
  237. endef
  238. define Package/freeradius3-mod-ldap
  239. $(call Package/freeradius3/Default)
  240. DEPENDS:=freeradius3 +libopenldap @FREERADIUS3_OPENSSL
  241. TITLE:=LDAP Authentication
  242. endef
  243. define Package/freeradius3-mod-ldap/conffiles
  244. /etc/freeradius3/mods-available/ldap
  245. endef
  246. define Package/freeradius3-mod-logintime
  247. $(call Package/freeradius3/Default)
  248. DEPENDS:=freeradius3
  249. TITLE:=Logintime module
  250. endef
  251. define Package/freeradius3-mod-logintime/conffiles
  252. /etc/freeradius3/mods-available/logintime
  253. /etc/freeradius3/mods-enabled/logintime
  254. endef
  255. define Package/freeradius3-mod-mschap
  256. $(call Package/freeradius3/Default)
  257. DEPENDS:=freeradius3
  258. TITLE:=MS-CHAP and MS-CHAPv2 module
  259. endef
  260. define Package/freeradius3-mod-mschap/conffiles
  261. /etc/freeradius3/mods-available/mschap
  262. /etc/freeradius3/mods-enabled/mschap
  263. endef
  264. define Package/freeradius3-mod-pap
  265. $(call Package/freeradius3/Default)
  266. DEPENDS:=freeradius3
  267. TITLE:=PAP module
  268. endef
  269. define Package/freeradius3-mod-pap/conffiles
  270. /etc/freeradius3/mods-available/pap
  271. /etc/freeradius3/mods-enabled/pap
  272. endef
  273. define Package/freeradius3-mod-preprocess
  274. $(call Package/freeradius3/Default)
  275. DEPENDS:=freeradius3
  276. TITLE:=Request pre-processing module
  277. endef
  278. define Package/freeradius3-mod-preprocess/conffiles
  279. /etc/freeradius3/mods-config/preprocess/hints
  280. /etc/freeradius3/mods-config/preprocess/huntgroups
  281. /etc/freeradius3/mods-available/preprocess
  282. /etc/freeradius3/mods-enabled/preprocess
  283. endef
  284. define Package/freeradius3-mod-realm
  285. $(call Package/freeradius3/Default)
  286. DEPENDS:=freeradius3
  287. TITLE:=Realms handling module
  288. endef
  289. define Package/freeradius3-mod-realm/conffiles
  290. /etc/freeradius3/proxy.conf
  291. /etc/freeradius3/mods-available/realm
  292. /etc/freeradius3/mods-enabled/realm
  293. endef
  294. # SQL support has not been ported
  295. define Package/freeradius3-mod-radutmp
  296. $(call Package/freeradius3/Default)
  297. DEPENDS:=freeradius3
  298. TITLE:=Radius UTMP module
  299. endef
  300. define Package/freeradius3-mod-radutmp/conffiles
  301. /etc/freeradius3/mods-available/radutmp
  302. /etc/freeradius3/mods-enabled/radutmp
  303. /etc/freeradius3/mods-available/sradutmp
  304. /etc/freeradius3/mods-enabled/sradutmp
  305. endef
  306. define Package/freeradius3-mod-unix
  307. $(call Package/freeradius3/Default)
  308. DEPENDS:=freeradius3
  309. TITLE:=System Authentication
  310. endef
  311. define Package/freeradius3-mod-unix/conffiles
  312. /etc/freeradius3/mods-available/unix
  313. /etc/freeradius3/mods-enabled/unix
  314. endef
  315. define Package/freeradius3-utils
  316. $(call Package/freeradius3/Default)
  317. DEPENDS:=+freeradius3-common
  318. TITLE:=Misc. client utilities
  319. endef
  320. # This is a workaround for a bug in configure.ac, that does not check
  321. # for the openss/rand.h header. Setting the macro is safe for openwrt,
  322. # and faster than rebuilding configure.
  323. # This has been fixed upstream in the 3.0.x branch, and should not be
  324. # needed in a future release.
  325. EXTRA_CFLAGS+= -DHAVE_OPENSSL_RAND_H
  326. CONFIGURE_ARGS+= \
  327. --libdir=/usr/lib/freeradius3 \
  328. --libexecdir=/usr/lib/freeradius3 \
  329. --disable-developer \
  330. --with-threads \
  331. $(if $(CONFIG_FREERADIUS3_OPENSSL),--with,--without)-openssl \
  332. $(if $(CONFIG_FREERADIUS3_OPENSSL),--with-openssl-includes="$(STAGING_DIR)/usr/include",) \
  333. $(if $(CONFIG_FREERADIUS3_OPENSSL),--with-openssl-libraries="$(STAGING_DIR)/usr/lib",) \
  334. $(if $(CONFIG_FREERADIUS3_OPENSSL),--disable-openssl-version-check,) \
  335. --with-talloc-include-dir="$(STAGING_DIR)/usr/include" \
  336. --with-talloc-lib-dir="$(STAGING_DIR)/usr/lib" \
  337. --enable-strict-dependencies \
  338. --with-dictdir=/usr/share/freeradius3 \
  339. --with-raddbdir=/etc/freeradius3 \
  340. --with-radacctdir=/var/db/radacct \
  341. --with-logdir=/var/log \
  342. --without-edir \
  343. --without-snmp \
  344. --without-rlm_cache \
  345. --without-rlm_cache_memcached \
  346. --without-rlm_couchbase \
  347. --without-rlm_counter \
  348. --without-rlm_eap_ikev2 \
  349. --without-rlm_eap_sim \
  350. --without-rlm_eap_tnc \
  351. --without-rlm_example \
  352. --without-rlm_idn \
  353. --without-rlm_ippool \
  354. --without-rlm_krb5 \
  355. --without-rlm_opendirectory \
  356. --without-rlm_pam \
  357. --without-rlm_perl \
  358. --without-rlm_python \
  359. --without-rlm_redis \
  360. --without-rlm_rediswho \
  361. --without-rlm_rest \
  362. --without-rlm_ruby \
  363. --without-rlm_securid \
  364. --without-rlm_smsotp \
  365. --without-rlm_sql \
  366. --without-rlm_sql_db2 \
  367. --without-rlm_sql_firebird \
  368. --without-rlm_sql_freetds \
  369. --without-rlm_sql_iodbc \
  370. --without-rlm_sql_mysql \
  371. --without-rlm_sql_oracle \
  372. --without-rlm_sql_postgresql \
  373. --without-rlm_sql_sqlite \
  374. --without-rlm_sql_unixodbc \
  375. --without-rlm_sqlcounter \
  376. --without-rlm_sqlhpwippool \
  377. --without-rlm_sqlippool \
  378. --without-rlm_unbound \
  379. --without-rlm_yubikey \
  380. PKG_DICTIONARIES:= \
  381. compat \
  382. freeradius freeradius.internal \
  383. rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
  384. rfc4372 rfc4675 rfc4679 rfc5580\
  385. microsoft \
  386. wispr \
  387. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-peap),)
  388. CONFIGURE_ARGS+= \
  389. --with-rlm_eap_peap \
  390. --with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
  391. --with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
  392. CONFIGURE_LIBS+= -lcrypto -lssl
  393. else
  394. CONFIGURE_ARGS+= --without-rlm_eap_peap
  395. endif
  396. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-tls),)
  397. CONFIGURE_ARGS+= \
  398. --with-rlm_eap_tls \
  399. --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
  400. --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
  401. CONFIGURE_LIBS+= -lcrypto -lssl
  402. else
  403. CONFIGURE_ARGS+= --without-rlm_eap_tls
  404. endif
  405. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-ttls),)
  406. CONFIGURE_ARGS+= \
  407. --with-rlm_eap_ttls \
  408. --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
  409. --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
  410. CONFIGURE_LIBS+= -lcrypto -lssl
  411. else
  412. CONFIGURE_ARGS+= --without-rlm_eap_ttls
  413. endif
  414. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-pwd),)
  415. CONFIGURE_ARGS+= \
  416. --with-rlm_eap_pwd \
  417. --with-rlm_eap_pwd-include-dir="$(STAGING_DIR)/usr/include" \
  418. --with-rlm_eap_pwd-lib-dir="$(STAGING_DIR)/usr/lib"
  419. CONFIGURE_LIBS+= -lcrypto -lssl
  420. else
  421. CONFIGURE_ARGS+= --without-rlm_eap_pwd
  422. endif
  423. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-radutmp),)
  424. CONFIGURE_ARGS+= --with-rlm_radutmp
  425. else
  426. CONFIGURE_ARGS+= --without-rlm_radutmp
  427. endif
  428. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-unix),)
  429. CONFIGURE_ARGS+= --with-rlm_unix
  430. else
  431. CONFIGURE_ARGS+= --without-rlm_unix
  432. endif
  433. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-ldap),)
  434. CONFIGURE_ARGS+= --with-rlm_ldap \
  435. --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
  436. --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
  437. else
  438. CONFIGURE_ARGS+= --without-rlm_ldap
  439. endif
  440. ifeq ($(CONFIG_USE_GLIBC),y)
  441. TARGET_CFLAGS+= -DLIBBSD_OVERLAY -I$(STAGING_DIR)/usr/include/bsd \
  442. -D_RPC_NETDB_H
  443. #^^^^^^^^^^^^^ avoid inclusion of librpc's netdb.h
  444. CONFIGURE_LIBS+= -Wl,--push-state,--as-needed -lbsd -Wl,--pop-state
  445. endif
  446. CONFIGURE_VARS+= \
  447. LDFLAGS="$$$$LDFLAGS" \
  448. LIBS="$(CONFIGURE_LIBS)" \
  449. MYSQL_CONFIG="no" \
  450. ac_cv_lib_readline=no \
  451. ax_cv_cc_builtin_choose_expr=yes \
  452. ax_cv_cc_builtin_types_compatible_p=yes ax_cv_cc_builtin_bswap64=yes \
  453. ax_cv_cc_bounded_attribute=no \
  454. ac_cv_lib_collectdclient_lcc_connect=no \
  455. ac_cv_lib_execinfo_backtrace_symbols=no
  456. define Build/Compile
  457. # Compile jlibtool for the host once the configuration is done
  458. (cd $(PKG_BUILD_DIR); \
  459. mkdir -p build/make; \
  460. $(HOSTCC) $(HOST_CFLAGS) scripts/jlibtool.c -o build/make/jlibtool; \
  461. )
  462. $(MAKE) -C $(PKG_BUILD_DIR) \
  463. R="$(PKG_INSTALL_DIR)" \
  464. INSTALLSTRIP="" \
  465. all install
  466. endef
  467. define Package/freeradius3-common/install
  468. $(INSTALL_DIR) $(1)/etc/freeradius3
  469. chmod 771 $(1)/etc/freeradius3
  470. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/dictionary $(1)/etc/freeradius3/ ; \
  471. $(INSTALL_DIR) $(1)/usr/lib/freeradius3
  472. $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius3/libfreeradius-{dhcp,eap,radius,server}.so $(1)/usr/lib/freeradius3
  473. $(INSTALL_DIR) $(1)/usr/share/freeradius3
  474. $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius3/dictionary $(1)/usr/share/freeradius3/
  475. $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius3/dictionary
  476. for f in $(PKG_DICTIONARIES); do \
  477. $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius3/dictionary.$$$${f} $(1)/usr/share/freeradius3/ ; \
  478. $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\)$$$$,\1,g" $(1)/usr/share/freeradius3/dictionary ; \
  479. done
  480. endef
  481. define Package/freeradius3/install
  482. $(INSTALL_DIR) $(1)/etc/freeradius3
  483. $(INSTALL_DIR) $(1)/etc/freeradius3/policy.d
  484. $(INSTALL_DIR) $(1)/etc/freeradius3/sites-available
  485. $(INSTALL_DIR) $(1)/etc/freeradius3/sites-enabled
  486. for f in clients.conf radiusd.conf proxy.conf; do \
  487. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/$$$${f} $(1)/etc/freeradius3/ ; \
  488. done
  489. for f in accounting filter; do \
  490. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/policy.d/$$$${f} $(1)/etc/freeradius3/policy.d/ ; \
  491. done
  492. for f in default; do \
  493. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/sites-available/$$$${f} $(1)/etc/freeradius3/sites-available/ ; \
  494. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/sites-enabled/$$$${f} $(1)/etc/freeradius3/sites-enabled/ ; \
  495. done
  496. $(INSTALL_DIR) $(1)/usr/sbin
  497. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
  498. $(INSTALL_DIR) $(1)/etc/init.d
  499. $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
  500. endef
  501. define Package/freeradius3-democerts/install
  502. $(INSTALL_DIR) $(1)/etc/freeradius3/certs
  503. $(CP) \
  504. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/ca.pem \
  505. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/dh \
  506. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/server.pem \
  507. $(1)/etc/freeradius3/certs/
  508. endef
  509. define Package/freeradius3-utils/install
  510. $(INSTALL_DIR) $(1)/usr/bin
  511. for f in radclient radeapclient radwho; do \
  512. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
  513. done
  514. endef
  515. define BuildPlugin
  516. define Package/$(1)/install
  517. [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius3
  518. for m in $(2); do \
  519. $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius3/$$$$$$$${m}.so $$(1)/usr/lib/freeradius3 ; \
  520. done
  521. # Install configuration files
  522. for f in $(strip $(call Package/$(1)/conffiles)); do \
  523. $(INSTALL_DIR) $$(1)/$$$$$$$${f%/*} ; \
  524. $(CP) $(PKG_INSTALL_DIR)/$$$$$$$${f} $$(1)/$$$$$$$${f}; \
  525. done
  526. endef
  527. $$(eval $$(call BuildPackage,$(1)))
  528. endef
  529. $(eval $(call BuildPackage,freeradius3))
  530. $(eval $(call BuildPackage,freeradius3-common))
  531. $(eval $(call BuildPackage,freeradius3-default))
  532. $(eval $(call BuildPackage,freeradius3-democerts))
  533. $(eval $(call BuildPlugin,freeradius3-mod-always,rlm_always,))
  534. $(eval $(call BuildPlugin,freeradius3-mod-attr-filter,rlm_attr_filter,))
  535. $(eval $(call BuildPlugin,freeradius3-mod-chap,rlm_chap,))
  536. $(eval $(call BuildPlugin,freeradius3-mod-detail,rlm_detail,))
  537. $(eval $(call BuildPlugin,freeradius3-mod-digest,rlm_digest,))
  538. $(eval $(call BuildPlugin,freeradius3-mod-eap-gtc,rlm_eap_gtc,))
  539. $(eval $(call BuildPlugin,freeradius3-mod-eap-leap,rlm_eap_leap,))
  540. $(eval $(call BuildPlugin,freeradius3-mod-eap-md5,rlm_eap_md5,))
  541. $(eval $(call BuildPlugin,freeradius3-mod-eap-mschapv2,rlm_eap_mschapv2,))
  542. $(eval $(call BuildPlugin,freeradius3-mod-eap-peap,rlm_eap_peap,))
  543. $(eval $(call BuildPlugin,freeradius3-mod-eap,rlm_eap,))
  544. $(eval $(call BuildPlugin,freeradius3-mod-eap-tls,rlm_eap_tls,))
  545. $(eval $(call BuildPlugin,freeradius3-mod-eap-ttls,rlm_eap_ttls,))
  546. $(eval $(call BuildPlugin,freeradius3-mod-eap-pwd,rlm_eap_pwd,))
  547. $(eval $(call BuildPlugin,freeradius3-mod-exec,rlm_exec,))
  548. $(eval $(call BuildPlugin,freeradius3-mod-expiration,rlm_expiration,))
  549. $(eval $(call BuildPlugin,freeradius3-mod-expr,rlm_expr,))
  550. $(eval $(call BuildPlugin,freeradius3-mod-files,rlm_files,))
  551. $(eval $(call BuildPlugin,freeradius3-mod-ldap,rlm_ldap,))
  552. $(eval $(call BuildPlugin,freeradius3-mod-logintime,rlm_logintime,))
  553. $(eval $(call BuildPlugin,freeradius3-mod-mschap,rlm_mschap,))
  554. $(eval $(call BuildPlugin,freeradius3-mod-pap,rlm_pap,))
  555. $(eval $(call BuildPlugin,freeradius3-mod-passwd,rlm_passwd,))
  556. $(eval $(call BuildPlugin,freeradius3-mod-preprocess,rlm_preprocess,))
  557. $(eval $(call BuildPlugin,freeradius3-mod-radutmp,rlm_radutmp,))
  558. $(eval $(call BuildPlugin,freeradius3-mod-realm,rlm_realm,))
  559. $(eval $(call BuildPlugin,freeradius3-mod-unix,rlm_unix,))
  560. $(eval $(call BuildPackage,freeradius3-utils))