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.

781 lines
23 KiB

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