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.

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