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.

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