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.

753 lines
22 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_19
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/FreeRADIUS/freeradius-server/archive
  13. PKG_HASH:=34c50ac47a683b13eae1a02f2d0263c0bd51a83f01b99c02c5fe25df07a1ee77
  14. PKG_MAINTAINER:=
  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:=https://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 +libpcre +libreadline +libtalloc +libatomic
  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. define Package/freeradius3-mod-sql
  295. $(call Package/freeradius3/Default)
  296. DEPENDS:=freeradius3
  297. TITLE:=Radius generic SQL front-end
  298. endef
  299. define Package/freeradius3-mod-sql/conffiles
  300. /etc/freeradius3/mods-available/sql
  301. endef
  302. define Package/freeradius3-mod-sql-mysql
  303. $(call Package/freeradius3/Default)
  304. DEPENDS:=freeradius3-mod-sql +libmysqlclient
  305. TITLE:=Radius MySQL back-end drivers
  306. endef
  307. define Package/freeradius3-mod-sql-mysql/conffiles
  308. /etc/freeradius3/mods-config/sql/main/mysql
  309. endef
  310. define Package/freeradius3-mod-sql-null
  311. $(call Package/freeradius3/Default)
  312. DEPENDS:=freeradius3-mod-sql
  313. TITLE:=Radius Dummy SQL back-end drivers
  314. endef
  315. define Package/freeradius3-mod-sql-postgresql
  316. $(call Package/freeradius3/Default)
  317. DEPENDS:=freeradius3-mod-sql +libpq
  318. TITLE:=Radius PostgreSQL back-end drivers
  319. endef
  320. define Package/freeradius3-mod-sql-postgresql/conffiles
  321. /etc/freeradius3/mods-config/sql/main/postgresql
  322. endef
  323. define Package/freeradius3-mod-sql-sqlite
  324. $(call Package/freeradius3/Default)
  325. DEPENDS:=freeradius3-mod-sql +libsqlite3
  326. TITLE:=Radius SQLite back-end drivers
  327. endef
  328. define Package/freeradius3-mod-sql-sqlite/conffiles
  329. /etc/freeradius3/mods-config/sql/main/sqlite
  330. endef
  331. define Package/freeradius3-mod-sqlcounter
  332. $(call Package/freeradius3/Default)
  333. DEPENDS:=+freeradius3-mod-sql
  334. TITLE:=Packet counter using accounting records written into an SQL database
  335. endef
  336. define Package/freeradius3-mod-sqlcounter/conffiles
  337. /etc/freeradius3/mods-config/sql/counter
  338. /etc/freeradius3/mods-available/sqlcounter
  339. endef
  340. define Package/freeradius3-mod-sqlippool
  341. $(call Package/freeradius3/Default)
  342. DEPENDS:=+freeradius3-mod-sql
  343. TITLE:=Radius SQL Based IP Pool module
  344. endef
  345. define Package/freeradius3-mod-sqlippool/conffiles
  346. /etc/freeradius3/mods-config/sql/ippool
  347. /etc/freeradius3/mods-config/sql/ippool-dhcp
  348. /etc/freeradius3/mods-available/dhcp_sqlippool
  349. /etc/freeradius3/mods-available/sqlippool
  350. endef
  351. define Package/freeradius3-mod-radutmp
  352. $(call Package/freeradius3/Default)
  353. DEPENDS:=freeradius3
  354. TITLE:=Radius UTMP module
  355. endef
  356. define Package/freeradius3-mod-radutmp/conffiles
  357. /etc/freeradius3/mods-available/radutmp
  358. /etc/freeradius3/mods-enabled/radutmp
  359. /etc/freeradius3/mods-available/sradutmp
  360. /etc/freeradius3/mods-enabled/sradutmp
  361. endef
  362. define Package/freeradius3-mod-unix
  363. $(call Package/freeradius3/Default)
  364. DEPENDS:=freeradius3
  365. TITLE:=System Authentication
  366. endef
  367. define Package/freeradius3-mod-unix/conffiles
  368. /etc/freeradius3/mods-available/unix
  369. /etc/freeradius3/mods-enabled/unix
  370. endef
  371. define Package/freeradius3-utils
  372. $(call Package/freeradius3/Default)
  373. DEPENDS:=+freeradius3-common
  374. TITLE:=Misc. client utilities
  375. endef
  376. # This is a workaround for a bug in configure.ac, that does not check
  377. # for the openss/rand.h header. Setting the macro is safe for openwrt,
  378. # and faster than rebuilding configure.
  379. # This has been fixed upstream in the 3.0.x branch, and should not be
  380. # needed in a future release.
  381. EXTRA_CFLAGS+= -DHAVE_OPENSSL_RAND_H
  382. CONFIGURE_ARGS+= \
  383. --libdir=/usr/lib/freeradius3 \
  384. --libexecdir=/usr/lib/freeradius3 \
  385. --disable-developer \
  386. --with-threads \
  387. $(if $(CONFIG_FREERADIUS3_OPENSSL),--with,--without)-openssl \
  388. $(if $(CONFIG_FREERADIUS3_OPENSSL),--with-openssl-includes="$(STAGING_DIR)/usr/include",) \
  389. $(if $(CONFIG_FREERADIUS3_OPENSSL),--with-openssl-libraries="$(STAGING_DIR)/usr/lib",) \
  390. $(if $(CONFIG_FREERADIUS3_OPENSSL),--disable-openssl-version-check,) \
  391. --with-talloc-include-dir="$(STAGING_DIR)/usr/include" \
  392. --with-talloc-lib-dir="$(STAGING_DIR)/usr/lib" \
  393. --enable-strict-dependencies \
  394. --with-dictdir=/usr/share/freeradius3 \
  395. --with-raddbdir=/etc/freeradius3 \
  396. --with-radacctdir=/var/db/radacct \
  397. --with-logdir=/var/log \
  398. --without-edir \
  399. --without-snmp \
  400. --without-rlm_cache \
  401. --without-rlm_cache_memcached \
  402. --without-rlm_couchbase \
  403. --without-rlm_counter \
  404. --without-rlm_eap_ikev2 \
  405. --without-rlm_eap_sim \
  406. --without-rlm_eap_tnc \
  407. --without-rlm_example \
  408. --without-rlm_idn \
  409. --without-rlm_ippool \
  410. --without-rlm_krb5 \
  411. --without-rlm_opendirectory \
  412. --without-rlm_pam \
  413. --without-rlm_perl \
  414. --without-rlm_python \
  415. --without-rlm_redis \
  416. --without-rlm_rediswho \
  417. --without-rlm_rest \
  418. --without-rlm_ruby \
  419. --without-rlm_securid \
  420. --without-rlm_smsotp \
  421. --without-rlm_sql_db2 \
  422. --without-rlm_sql_firebird \
  423. --without-rlm_sql_freetds \
  424. --without-rlm_sql_iodbc \
  425. --without-rlm_sql_oracle \
  426. --without-rlm_sql_unixodbc \
  427. --without-rlm_unbound \
  428. --without-rlm_yubikey \
  429. CONFIGURE_LIBS+= -latomic
  430. PKG_DICTIONARIES:= \
  431. compat \
  432. freeradius freeradius.internal \
  433. rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
  434. rfc4372 rfc4675 rfc4679 rfc5580\
  435. microsoft \
  436. wispr \
  437. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-peap),)
  438. CONFIGURE_ARGS+= \
  439. --with-rlm_eap_peap \
  440. --with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
  441. --with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
  442. CONFIGURE_LIBS+= -lcrypto -lssl
  443. else
  444. CONFIGURE_ARGS+= --without-rlm_eap_peap
  445. endif
  446. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-tls),)
  447. CONFIGURE_ARGS+= \
  448. --with-rlm_eap_tls \
  449. --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
  450. --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
  451. CONFIGURE_LIBS+= -lcrypto -lssl
  452. else
  453. CONFIGURE_ARGS+= --without-rlm_eap_tls
  454. endif
  455. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-ttls),)
  456. CONFIGURE_ARGS+= \
  457. --with-rlm_eap_ttls \
  458. --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
  459. --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
  460. CONFIGURE_LIBS+= -lcrypto -lssl
  461. else
  462. CONFIGURE_ARGS+= --without-rlm_eap_ttls
  463. endif
  464. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-pwd),)
  465. CONFIGURE_ARGS+= \
  466. --with-rlm_eap_pwd \
  467. --with-rlm_eap_pwd-include-dir="$(STAGING_DIR)/usr/include" \
  468. --with-rlm_eap_pwd-lib-dir="$(STAGING_DIR)/usr/lib"
  469. CONFIGURE_LIBS+= -lcrypto -lssl
  470. else
  471. CONFIGURE_ARGS+= --without-rlm_eap_pwd
  472. endif
  473. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql),)
  474. CONFIGURE_ARGS+= --with-rlm_sql
  475. else
  476. CONFIGURE_ARGS+= --without-rlm_sql
  477. endif
  478. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql-mysql),)
  479. CONFIGURE_ARGS+= \
  480. --with-rlm_sql_mysql \
  481. --with-mysql-include-dir="$(STAGING_DIR)/usr/include/mysql"
  482. else
  483. CONFIGURE_ARGS+= --without-rlm_sql_mysql
  484. endif
  485. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql-postgresql),)
  486. CONFIGURE_ARGS+= --with-rlm_sql_postgresql
  487. else
  488. CONFIGURE_ARGS+= --without-rlm_sql_postgresql
  489. endif
  490. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql-sqlite),)
  491. CONFIGURE_ARGS+= --with-rlm_sql_sqlite
  492. else
  493. CONFIGURE_ARGS+= --without-rlm_sql_sqlite
  494. endif
  495. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sqlcounter),)
  496. CONFIGURE_ARGS+= --with-rlm_sqlcounter
  497. else
  498. CONFIGURE_ARGS+= --without-rlm_sqlcounter
  499. endif
  500. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sqlippool),)
  501. CONFIGURE_ARGS+= --with-rlm_sqlippool
  502. else
  503. CONFIGURE_ARGS+= --without-rlm_sqlippool
  504. endif
  505. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-radutmp),)
  506. CONFIGURE_ARGS+= --with-rlm_radutmp
  507. else
  508. CONFIGURE_ARGS+= --without-rlm_radutmp
  509. endif
  510. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-unix),)
  511. CONFIGURE_ARGS+= --with-rlm_unix
  512. else
  513. CONFIGURE_ARGS+= --without-rlm_unix
  514. endif
  515. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-ldap),)
  516. CONFIGURE_ARGS+= --with-rlm_ldap \
  517. --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
  518. --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
  519. else
  520. CONFIGURE_ARGS+= --without-rlm_ldap
  521. endif
  522. ifeq ($(CONFIG_USE_GLIBC),y)
  523. TARGET_CFLAGS+= -DLIBBSD_OVERLAY -I$(STAGING_DIR)/usr/include/bsd \
  524. -D_RPC_NETDB_H
  525. #^^^^^^^^^^^^^ avoid inclusion of librpc's netdb.h
  526. CONFIGURE_LIBS+= -Wl,--push-state,--as-needed -lbsd -Wl,--pop-state
  527. endif
  528. CONFIGURE_VARS+= \
  529. LDFLAGS="$$$$LDFLAGS" \
  530. LIBS="$(CONFIGURE_LIBS)" \
  531. MYSQL_CONFIG="no" \
  532. ac_cv_lib_readline=no \
  533. ax_cv_cc_builtin_choose_expr=yes \
  534. ax_cv_cc_builtin_types_compatible_p=yes ax_cv_cc_builtin_bswap64=yes \
  535. ax_cv_cc_bounded_attribute=no \
  536. ac_cv_lib_collectdclient_lcc_connect=no \
  537. ac_cv_lib_execinfo_backtrace_symbols=no
  538. define Build/Compile
  539. # Compile jlibtool for the host once the configuration is done
  540. (cd $(PKG_BUILD_DIR); \
  541. mkdir -p build/make; \
  542. $(HOSTCC) $(HOST_CFLAGS) scripts/jlibtool.c -o build/make/jlibtool; \
  543. )
  544. $(MAKE) -C $(PKG_BUILD_DIR) \
  545. R="$(PKG_INSTALL_DIR)" \
  546. INSTALLSTRIP="" \
  547. all install
  548. endef
  549. define Package/freeradius3-common/install
  550. $(INSTALL_DIR) $(1)/etc/freeradius3
  551. chmod 771 $(1)/etc/freeradius3
  552. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/dictionary $(1)/etc/freeradius3/ ; \
  553. $(INSTALL_DIR) $(1)/usr/lib/freeradius3
  554. $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius3/libfreeradius-{dhcp,eap,radius,server}.so $(1)/usr/lib/freeradius3
  555. $(INSTALL_DIR) $(1)/usr/share/freeradius3
  556. $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius3/dictionary $(1)/usr/share/freeradius3/
  557. $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius3/dictionary
  558. for f in $(PKG_DICTIONARIES); do \
  559. $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius3/dictionary.$$$${f} $(1)/usr/share/freeradius3/ ; \
  560. $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\)$$$$,\1,g" $(1)/usr/share/freeradius3/dictionary ; \
  561. done
  562. endef
  563. define Package/freeradius3/install
  564. $(INSTALL_DIR) $(1)/etc/freeradius3
  565. $(INSTALL_DIR) $(1)/etc/freeradius3/policy.d
  566. $(INSTALL_DIR) $(1)/etc/freeradius3/sites-available
  567. $(INSTALL_DIR) $(1)/etc/freeradius3/sites-enabled
  568. for f in clients.conf radiusd.conf proxy.conf; do \
  569. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/$$$${f} $(1)/etc/freeradius3/ ; \
  570. done
  571. for f in accounting filter; do \
  572. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/policy.d/$$$${f} $(1)/etc/freeradius3/policy.d/ ; \
  573. done
  574. for f in default; do \
  575. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/sites-available/$$$${f} $(1)/etc/freeradius3/sites-available/ ; \
  576. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/sites-enabled/$$$${f} $(1)/etc/freeradius3/sites-enabled/ ; \
  577. done
  578. $(INSTALL_DIR) $(1)/usr/sbin
  579. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
  580. $(INSTALL_DIR) $(1)/etc/init.d
  581. $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
  582. endef
  583. define Package/freeradius3-democerts/install
  584. $(INSTALL_DIR) $(1)/etc/freeradius3/certs
  585. $(CP) \
  586. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/ca.pem \
  587. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/dh \
  588. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/server.pem \
  589. $(1)/etc/freeradius3/certs/
  590. endef
  591. define Package/freeradius3-utils/install
  592. $(INSTALL_DIR) $(1)/usr/bin
  593. for f in radclient radeapclient radwho; do \
  594. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
  595. done
  596. endef
  597. define BuildPlugin
  598. define Package/$(1)/install
  599. [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius3
  600. for m in $(2); do \
  601. $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius3/$$$$$$$${m}.so $$(1)/usr/lib/freeradius3 ; \
  602. done
  603. # Install configuration files
  604. for f in $(strip $(call Package/$(1)/conffiles)); do \
  605. $(INSTALL_DIR) $$(1)/$$$$$$$${f%/*} ; \
  606. $(CP) $(PKG_INSTALL_DIR)/$$$$$$$${f} $$(1)/$$$$$$$${f}; \
  607. done
  608. endef
  609. $$(eval $$(call BuildPackage,$(1)))
  610. endef
  611. $(eval $(call BuildPackage,freeradius3))
  612. $(eval $(call BuildPackage,freeradius3-common))
  613. $(eval $(call BuildPackage,freeradius3-default))
  614. $(eval $(call BuildPackage,freeradius3-democerts))
  615. $(eval $(call BuildPlugin,freeradius3-mod-always,rlm_always,))
  616. $(eval $(call BuildPlugin,freeradius3-mod-attr-filter,rlm_attr_filter,))
  617. $(eval $(call BuildPlugin,freeradius3-mod-chap,rlm_chap,))
  618. $(eval $(call BuildPlugin,freeradius3-mod-detail,rlm_detail,))
  619. $(eval $(call BuildPlugin,freeradius3-mod-digest,rlm_digest,))
  620. $(eval $(call BuildPlugin,freeradius3-mod-eap-gtc,rlm_eap_gtc,))
  621. $(eval $(call BuildPlugin,freeradius3-mod-eap-leap,rlm_eap_leap,))
  622. $(eval $(call BuildPlugin,freeradius3-mod-eap-md5,rlm_eap_md5,))
  623. $(eval $(call BuildPlugin,freeradius3-mod-eap-mschapv2,rlm_eap_mschapv2,))
  624. $(eval $(call BuildPlugin,freeradius3-mod-eap-peap,rlm_eap_peap,))
  625. $(eval $(call BuildPlugin,freeradius3-mod-eap,rlm_eap,))
  626. $(eval $(call BuildPlugin,freeradius3-mod-eap-tls,rlm_eap_tls,))
  627. $(eval $(call BuildPlugin,freeradius3-mod-eap-ttls,rlm_eap_ttls,))
  628. $(eval $(call BuildPlugin,freeradius3-mod-eap-pwd,rlm_eap_pwd,))
  629. $(eval $(call BuildPlugin,freeradius3-mod-exec,rlm_exec,))
  630. $(eval $(call BuildPlugin,freeradius3-mod-expiration,rlm_expiration,))
  631. $(eval $(call BuildPlugin,freeradius3-mod-expr,rlm_expr,))
  632. $(eval $(call BuildPlugin,freeradius3-mod-files,rlm_files,))
  633. $(eval $(call BuildPlugin,freeradius3-mod-ldap,rlm_ldap,))
  634. $(eval $(call BuildPlugin,freeradius3-mod-logintime,rlm_logintime,))
  635. $(eval $(call BuildPlugin,freeradius3-mod-mschap,rlm_mschap,))
  636. $(eval $(call BuildPlugin,freeradius3-mod-pap,rlm_pap,))
  637. $(eval $(call BuildPlugin,freeradius3-mod-passwd,rlm_passwd,))
  638. $(eval $(call BuildPlugin,freeradius3-mod-preprocess,rlm_preprocess,))
  639. $(eval $(call BuildPlugin,freeradius3-mod-radutmp,rlm_radutmp,))
  640. $(eval $(call BuildPlugin,freeradius3-mod-realm,rlm_realm,))
  641. $(eval $(call BuildPlugin,freeradius3-mod-sql,rlm_sql,))
  642. $(eval $(call BuildPlugin,freeradius3-mod-sql-mysql,rlm_sql_mysql,))
  643. $(eval $(call BuildPlugin,freeradius3-mod-sql-null,rlm_sql_null,))
  644. $(eval $(call BuildPlugin,freeradius3-mod-sql-postgresql,rlm_sql_postgresql,))
  645. $(eval $(call BuildPlugin,freeradius3-mod-sql-sqlite,rlm_sql_sqlite,))
  646. $(eval $(call BuildPlugin,freeradius3-mod-sqlcounter,rlm_sqlcounter,))
  647. $(eval $(call BuildPlugin,freeradius3-mod-sqlippool,rlm_sqlippool,))
  648. $(eval $(call BuildPlugin,freeradius3-mod-unix,rlm_unix,))
  649. $(eval $(call BuildPackage,freeradius3-utils))