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.

793 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_21
  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:=b2014372948a92f86cfe2cf43c58ef47921c03af05666eb9d6416bdc6eeaedc2
  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-pwd \
  67. +freeradius3-mod-eap-tls \
  68. +freeradius3-mod-eap-ttls \
  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-always
  88. $(call Package/freeradius3/Default)
  89. DEPENDS:=freeradius3
  90. TITLE:=Always module
  91. endef
  92. define Package/freeradius3-mod-always/conffiles
  93. /etc/freeradius3/mods-available/always
  94. /etc/freeradius3/mods-enabled/always
  95. endef
  96. define Package/freeradius3-mod-attr-filter
  97. $(call Package/freeradius3/Default)
  98. DEPENDS:=freeradius3
  99. TITLE:=ATTR filter module
  100. endef
  101. define Package/freeradius3-mod-attr-filter/conffiles
  102. /etc/freeradius3/mods-available/attr_filter
  103. /etc/freeradius3/mods-enabled/attr_filter
  104. /etc/freeradius3/mods-config/attr_filter/access_challenge
  105. /etc/freeradius3/mods-config/attr_filter/access_reject
  106. /etc/freeradius3/mods-config/attr_filter/accounting_response
  107. /etc/freeradius3/mods-config/attr_filter/post-proxy
  108. /etc/freeradius3/mods-config/attr_filter/pre-proxy
  109. endef
  110. define Package/freeradius3-mod-attr-rewrite
  111. $(call Package/freeradius3/Default)
  112. DEPENDS:=freeradius3
  113. TITLE:=ATTR rewrite module
  114. endef
  115. define Package/freeradius3-mod-chap
  116. $(call Package/freeradius3/Default)
  117. DEPENDS:=freeradius3
  118. TITLE:=CHAP module
  119. endef
  120. define Package/freeradius3-mod-chap/conffiles
  121. /etc/freeradius3/mods-available/chap
  122. /etc/freeradius3/mods-enabled/chap
  123. endef
  124. define Package/freeradius3-mod-detail
  125. $(call Package/freeradius3/Default)
  126. DEPENDS:=freeradius3
  127. TITLE:=Detailed accounting module
  128. endef
  129. define Package/freeradius3-mod-detail/conffiles
  130. /etc/freeradius3/mods-available/detail
  131. /etc/freeradius3/mods-enabled/detail
  132. endef
  133. define Package/freeradius3-mod-digest
  134. $(call Package/freeradius3/Default)
  135. DEPENDS:=freeradius3
  136. TITLE:=HTTP Digest Authentication
  137. endef
  138. define Package/freeradius3-mod-digest/conffiles
  139. /etc/freeradius3/mods-available/digest
  140. /etc/freeradius3/mods-enabled/digest
  141. endef
  142. define Package/freeradius3-mod-eap
  143. $(call Package/freeradius3/Default)
  144. DEPENDS:=freeradius3
  145. TITLE:=Base EAP module
  146. endef
  147. define Package/freeradius3-mod-eap/conffiles
  148. /etc/freeradius3/mods-available/eap
  149. /etc/freeradius3/mods-enabled/eap
  150. /etc/freeradius3/policy.d/eap
  151. /etc/freeradius3/sites-enabled/inner-tunnel
  152. /etc/freeradius3/sites-available/inner-tunnel
  153. endef
  154. define Package/freeradius3-mod-eap-gtc
  155. $(call Package/freeradius3/Default)
  156. DEPENDS:=freeradius3-mod-eap
  157. TITLE:=EAP/GTC module
  158. endef
  159. define Package/freeradius3-mod-eap-leap
  160. $(call Package/freeradius3/Default)
  161. DEPENDS:=freeradius3-mod-eap
  162. TITLE:=EAP/LEAP module
  163. endef
  164. define Package/freeradius3-mod-eap-md5
  165. $(call Package/freeradius3/Default)
  166. DEPENDS:=freeradius3-mod-eap
  167. TITLE:=EAP/MD5 module
  168. endef
  169. define Package/freeradius3-mod-eap-mschapv2
  170. $(call Package/freeradius3/Default)
  171. DEPENDS:=freeradius3-mod-eap +freeradius3-mod-mschap
  172. TITLE:=EAP/MS-CHAPv2 module
  173. endef
  174. define Package/freeradius3-mod-eap-peap
  175. $(call Package/freeradius3/Default)
  176. DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
  177. TITLE:=EAP/PEAP module
  178. endef
  179. define Package/freeradius3-mod-eap-pwd
  180. $(call Package/freeradius3/Default)
  181. DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
  182. TITLE:=EAP/PWD module
  183. endef
  184. define Package/freeradius3-mod-eap-tls
  185. $(call Package/freeradius3/Default)
  186. DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
  187. TITLE:=EAP/TLS module
  188. endef
  189. define Package/freeradius3-mod-eap-ttls
  190. $(call Package/freeradius3/Default)
  191. DEPENDS:=freeradius3-mod-eap-tls
  192. TITLE:=EAP/TTLS module
  193. endef
  194. define Package/freeradius3-mod-exec
  195. $(call Package/freeradius3/Default)
  196. DEPENDS:=freeradius3
  197. TITLE:=EXEC module
  198. endef
  199. define Package/freeradius3-mod-exec/conffiles
  200. /etc/freeradius3/mods-available/exec
  201. /etc/freeradius3/mods-enabled/exec
  202. endef
  203. define Package/freeradius3-mod-expiration
  204. $(call Package/freeradius3/Default)
  205. DEPENDS:=freeradius3
  206. TITLE:=Expiration module
  207. endef
  208. define Package/freeradius3-mod-expiration/conffiles
  209. /etc/freeradius3/mods-available/expiration
  210. /etc/freeradius3/mods-enabled/expiration
  211. endef
  212. define Package/freeradius3-mod-expr
  213. $(call Package/freeradius3/Default)
  214. DEPENDS:=freeradius3
  215. TITLE:=EXPR module
  216. endef
  217. define Package/freeradius3-mod-expr/conffiles
  218. /etc/freeradius3/mods-available/expr
  219. /etc/freeradius3/mods-enabled/expr
  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-ldap
  234. $(call Package/freeradius3/Default)
  235. DEPENDS:=freeradius3 +libopenldap @FREERADIUS3_OPENSSL
  236. TITLE:=LDAP Authentication
  237. endef
  238. define Package/freeradius3-mod-ldap/conffiles
  239. /etc/freeradius3/mods-available/ldap
  240. endef
  241. define Package/freeradius3-mod-logintime
  242. $(call Package/freeradius3/Default)
  243. DEPENDS:=freeradius3
  244. TITLE:=Logintime module
  245. endef
  246. define Package/freeradius3-mod-logintime/conffiles
  247. /etc/freeradius3/mods-available/logintime
  248. /etc/freeradius3/mods-enabled/logintime
  249. endef
  250. define Package/freeradius3-mod-mschap
  251. $(call Package/freeradius3/Default)
  252. DEPENDS:=freeradius3
  253. TITLE:=MS-CHAP and MS-CHAPv2 module
  254. endef
  255. define Package/freeradius3-mod-mschap/conffiles
  256. /etc/freeradius3/mods-available/mschap
  257. /etc/freeradius3/mods-enabled/mschap
  258. endef
  259. define Package/freeradius3-mod-pap
  260. $(call Package/freeradius3/Default)
  261. DEPENDS:=freeradius3
  262. TITLE:=PAP module
  263. endef
  264. define Package/freeradius3-mod-pap/conffiles
  265. /etc/freeradius3/mods-available/pap
  266. /etc/freeradius3/mods-enabled/pap
  267. endef
  268. define Package/freeradius3-mod-passwd
  269. $(call Package/freeradius3/Default)
  270. DEPENDS:=freeradius3
  271. TITLE:=Rlm passwd module
  272. endef
  273. define Package/freeradius3-mod-passwd/conffiles
  274. /etc/freeradius3/mods-available/passwd
  275. /etc/freeradius3/mods-enabled/passwd
  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-radutmp
  297. $(call Package/freeradius3/Default)
  298. DEPENDS:=freeradius3
  299. TITLE:=Radius UTMP module
  300. endef
  301. define Package/freeradius3-mod-radutmp/conffiles
  302. /etc/freeradius3/mods-available/radutmp
  303. /etc/freeradius3/mods-enabled/radutmp
  304. /etc/freeradius3/mods-available/sradutmp
  305. /etc/freeradius3/mods-enabled/sradutmp
  306. endef
  307. define Package/freeradius3-mod-realm
  308. $(call Package/freeradius3/Default)
  309. DEPENDS:=freeradius3
  310. TITLE:=Realms handling module
  311. endef
  312. define Package/freeradius3-mod-realm/conffiles
  313. /etc/freeradius3/mods-available/realm
  314. /etc/freeradius3/mods-enabled/realm
  315. endef
  316. define Package/freeradius3-mod-rest
  317. $(call Package/freeradius3/Default)
  318. DEPENDS:=freeradius3 +libcurl +libjson-c
  319. TITLE:=Radius REST module
  320. endef
  321. define Package/freeradius3-mod-rest/conffiles
  322. /etc/freeradius3/mods-available/rest
  323. endef
  324. define Package/freeradius3-mod-sql
  325. $(call Package/freeradius3/Default)
  326. DEPENDS:=freeradius3
  327. TITLE:=Radius generic SQL front-end
  328. endef
  329. define Package/freeradius3-mod-sql/conffiles
  330. /etc/freeradius3/mods-available/sql
  331. endef
  332. define Package/freeradius3-mod-sql-mysql
  333. $(call Package/freeradius3/Default)
  334. DEPENDS:=freeradius3-mod-sql +libmysqlclient
  335. TITLE:=Radius MySQL back-end drivers
  336. endef
  337. define Package/freeradius3-mod-sql-mysql/conffiles
  338. /etc/freeradius3/mods-config/sql/main/mysql
  339. endef
  340. define Package/freeradius3-mod-sql-null
  341. $(call Package/freeradius3/Default)
  342. DEPENDS:=freeradius3-mod-sql
  343. TITLE:=Radius Dummy SQL back-end drivers
  344. endef
  345. define Package/freeradius3-mod-sql-postgresql
  346. $(call Package/freeradius3/Default)
  347. DEPENDS:=freeradius3-mod-sql +libpq
  348. TITLE:=Radius PostgreSQL back-end drivers
  349. endef
  350. define Package/freeradius3-mod-sql-postgresql/conffiles
  351. /etc/freeradius3/mods-config/sql/main/postgresql
  352. endef
  353. define Package/freeradius3-mod-sql-sqlite
  354. $(call Package/freeradius3/Default)
  355. DEPENDS:=freeradius3-mod-sql +libsqlite3
  356. TITLE:=Radius SQLite back-end drivers
  357. endef
  358. define Package/freeradius3-mod-sql-sqlite/conffiles
  359. /etc/freeradius3/mods-config/sql/main/sqlite
  360. endef
  361. define Package/freeradius3-mod-sqlcounter
  362. $(call Package/freeradius3/Default)
  363. DEPENDS:=+freeradius3-mod-sql
  364. TITLE:=Packet counter using accounting records written into an SQL database
  365. endef
  366. define Package/freeradius3-mod-sqlcounter/conffiles
  367. /etc/freeradius3/mods-config/sql/counter
  368. /etc/freeradius3/mods-available/sqlcounter
  369. endef
  370. define Package/freeradius3-mod-sqlippool
  371. $(call Package/freeradius3/Default)
  372. DEPENDS:=+freeradius3-mod-sql
  373. TITLE:=Radius SQL Based IP Pool module
  374. endef
  375. define Package/freeradius3-mod-sqlippool/conffiles
  376. /etc/freeradius3/mods-config/sql/ippool
  377. /etc/freeradius3/mods-config/sql/ippool-dhcp
  378. /etc/freeradius3/mods-available/dhcp_sqlippool
  379. /etc/freeradius3/mods-available/sqlippool
  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_python \
  434. --without-rlm_redis \
  435. --without-rlm_rediswho \
  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-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-eap-tls),)
  474. CONFIGURE_ARGS+= \
  475. --with-rlm_eap_tls \
  476. --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
  477. --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
  478. CONFIGURE_LIBS+= -lcrypto -lssl
  479. else
  480. CONFIGURE_ARGS+= --without-rlm_eap_tls
  481. endif
  482. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-eap-ttls),)
  483. CONFIGURE_ARGS+= \
  484. --with-rlm_eap_ttls \
  485. --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
  486. --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
  487. CONFIGURE_LIBS+= -lcrypto -lssl
  488. else
  489. CONFIGURE_ARGS+= --without-rlm_eap_ttls
  490. endif
  491. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-ldap),)
  492. CONFIGURE_ARGS+= --with-rlm_ldap \
  493. --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
  494. --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
  495. else
  496. CONFIGURE_ARGS+= --without-rlm_ldap
  497. endif
  498. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-python3),)
  499. CFLAGS+= -fPIC
  500. CONFIGURE_ARGS+= \
  501. --with-modules="rlm_python3" \
  502. --with-rlm-python3-config-bin="$(STAGING_DIR)/host/bin/python$(PYTHON3_VERSION)-config"
  503. else
  504. CONFIGURE_ARGS+= --without-rlm_python3
  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-rest),)
  512. CONFIGURE_ARGS+= --with-rlm_rest
  513. else
  514. CONFIGURE_ARGS+= --without-rlm_rest
  515. endif
  516. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql),)
  517. CONFIGURE_ARGS+= --with-rlm_sql
  518. else
  519. CONFIGURE_ARGS+= --without-rlm_sql
  520. endif
  521. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql-mysql),)
  522. CONFIGURE_ARGS+= \
  523. --with-rlm_sql_mysql \
  524. --with-mysql-include-dir="$(STAGING_DIR)/usr/include/mysql"
  525. else
  526. CONFIGURE_ARGS+= --without-rlm_sql_mysql
  527. endif
  528. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql-postgresql),)
  529. CONFIGURE_ARGS+= --with-rlm_sql_postgresql
  530. else
  531. CONFIGURE_ARGS+= --without-rlm_sql_postgresql
  532. endif
  533. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sql-sqlite),)
  534. CONFIGURE_ARGS+= --with-rlm_sql_sqlite
  535. else
  536. CONFIGURE_ARGS+= --without-rlm_sql_sqlite
  537. endif
  538. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sqlcounter),)
  539. CONFIGURE_ARGS+= --with-rlm_sqlcounter
  540. else
  541. CONFIGURE_ARGS+= --without-rlm_sqlcounter
  542. endif
  543. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-sqlippool),)
  544. CONFIGURE_ARGS+= --with-rlm_sqlippool
  545. else
  546. CONFIGURE_ARGS+= --without-rlm_sqlippool
  547. endif
  548. ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-unix),)
  549. CONFIGURE_ARGS+= --with-rlm_unix
  550. else
  551. CONFIGURE_ARGS+= --without-rlm_unix
  552. endif
  553. ifeq ($(CONFIG_USE_GLIBC),y)
  554. TARGET_CFLAGS+= -DLIBBSD_OVERLAY -I$(STAGING_DIR)/usr/include/bsd \
  555. -D_RPC_NETDB_H
  556. #^^^^^^^^^^^^^ avoid inclusion of librpc's netdb.h
  557. CONFIGURE_LIBS+= -Wl,--push-state,--as-needed -lbsd -Wl,--pop-state
  558. endif
  559. CONFIGURE_VARS+= \
  560. LDFLAGS="$$$$LDFLAGS" \
  561. LIBS="$(CONFIGURE_LIBS)" \
  562. MYSQL_CONFIG="no" \
  563. ac_cv_lib_readline=no \
  564. ax_cv_cc_builtin_choose_expr=yes \
  565. ax_cv_cc_builtin_types_compatible_p=yes ax_cv_cc_builtin_bswap64=yes \
  566. ax_cv_cc_bounded_attribute=no \
  567. ac_cv_lib_collectdclient_lcc_connect=no \
  568. ac_cv_lib_execinfo_backtrace_symbols=no
  569. define Build/Compile
  570. # Compile jlibtool for the host once the configuration is done
  571. (cd $(PKG_BUILD_DIR); \
  572. mkdir -p build/make; \
  573. $(HOSTCC) $(HOST_CFLAGS) scripts/jlibtool.c -o build/make/jlibtool; \
  574. )
  575. $(MAKE) -C $(PKG_BUILD_DIR) \
  576. R="$(PKG_INSTALL_DIR)" \
  577. INSTALLSTRIP="" \
  578. all install
  579. endef
  580. define Package/freeradius3-common/install
  581. $(INSTALL_DIR) $(1)/etc/freeradius3
  582. chmod 771 $(1)/etc/freeradius3
  583. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/dictionary $(1)/etc/freeradius3/ ; \
  584. $(INSTALL_DIR) $(1)/usr/lib/freeradius3
  585. $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius3/libfreeradius-{dhcp,eap,radius,server}.so $(1)/usr/lib/freeradius3
  586. $(INSTALL_DIR) $(1)/usr/share/freeradius3
  587. $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius3/dictionary $(1)/usr/share/freeradius3/
  588. $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius3/dictionary
  589. for f in $(PKG_DICTIONARIES); do \
  590. $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius3/dictionary.$$$${f} $(1)/usr/share/freeradius3/ ; \
  591. $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\)$$$$,\1,g" $(1)/usr/share/freeradius3/dictionary ; \
  592. done
  593. endef
  594. define Package/freeradius3/install
  595. $(INSTALL_DIR) $(1)/etc/freeradius3
  596. $(INSTALL_DIR) $(1)/etc/freeradius3/policy.d
  597. $(INSTALL_DIR) $(1)/etc/freeradius3/sites-available
  598. $(INSTALL_DIR) $(1)/etc/freeradius3/sites-enabled
  599. for f in clients.conf radiusd.conf proxy.conf; do \
  600. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/$$$${f} $(1)/etc/freeradius3/ ; \
  601. done
  602. for f in accounting filter; do \
  603. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/policy.d/$$$${f} $(1)/etc/freeradius3/policy.d/ ; \
  604. done
  605. for f in default; do \
  606. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/sites-available/$$$${f} $(1)/etc/freeradius3/sites-available/ ; \
  607. $(CP) $(PKG_INSTALL_DIR)/etc/freeradius3/sites-enabled/$$$${f} $(1)/etc/freeradius3/sites-enabled/ ; \
  608. done
  609. $(INSTALL_DIR) $(1)/usr/sbin
  610. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
  611. $(INSTALL_DIR) $(1)/etc/init.d
  612. $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
  613. endef
  614. define Package/freeradius3-democerts/install
  615. $(INSTALL_DIR) $(1)/etc/freeradius3/certs
  616. $(CP) \
  617. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/ca.pem \
  618. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/dh \
  619. $(PKG_INSTALL_DIR)/etc/freeradius3/certs/server.pem \
  620. $(1)/etc/freeradius3/certs/
  621. endef
  622. define Package/freeradius3-utils/install
  623. $(INSTALL_DIR) $(1)/usr/bin
  624. for f in radclient radeapclient radwho; do \
  625. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
  626. done
  627. endef
  628. define BuildPlugin
  629. define Package/$(1)/install
  630. [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius3
  631. for m in $(2); do \
  632. $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius3/$$$$$$$${m}.so $$(1)/usr/lib/freeradius3 ; \
  633. done
  634. # Install configuration files
  635. for f in $(strip $(call Package/$(1)/conffiles)); do \
  636. $(INSTALL_DIR) $$(1)/$$$$$$$${f%/*} ; \
  637. $(CP) $(PKG_INSTALL_DIR)/$$$$$$$${f} $$(1)/$$$$$$$${f}; \
  638. done
  639. endef
  640. $$(eval $$(call BuildPackage,$(1)))
  641. endef
  642. $(eval $(call BuildPackage,freeradius3))
  643. $(eval $(call BuildPackage,freeradius3-common))
  644. $(eval $(call BuildPackage,freeradius3-default))
  645. $(eval $(call BuildPackage,freeradius3-democerts))
  646. $(eval $(call BuildPlugin,freeradius3-mod-always,rlm_always,))
  647. $(eval $(call BuildPlugin,freeradius3-mod-attr-filter,rlm_attr_filter,))
  648. $(eval $(call BuildPlugin,freeradius3-mod-chap,rlm_chap,))
  649. $(eval $(call BuildPlugin,freeradius3-mod-detail,rlm_detail,))
  650. $(eval $(call BuildPlugin,freeradius3-mod-digest,rlm_digest,))
  651. $(eval $(call BuildPlugin,freeradius3-mod-eap,rlm_eap,))
  652. $(eval $(call BuildPlugin,freeradius3-mod-eap-gtc,rlm_eap_gtc,))
  653. $(eval $(call BuildPlugin,freeradius3-mod-eap-leap,rlm_eap_leap,))
  654. $(eval $(call BuildPlugin,freeradius3-mod-eap-md5,rlm_eap_md5,))
  655. $(eval $(call BuildPlugin,freeradius3-mod-eap-mschapv2,rlm_eap_mschapv2,))
  656. $(eval $(call BuildPlugin,freeradius3-mod-eap-peap,rlm_eap_peap,))
  657. $(eval $(call BuildPlugin,freeradius3-mod-eap-pwd,rlm_eap_pwd,))
  658. $(eval $(call BuildPlugin,freeradius3-mod-eap-tls,rlm_eap_tls,))
  659. $(eval $(call BuildPlugin,freeradius3-mod-eap-ttls,rlm_eap_ttls,))
  660. $(eval $(call BuildPlugin,freeradius3-mod-exec,rlm_exec,))
  661. $(eval $(call BuildPlugin,freeradius3-mod-expiration,rlm_expiration,))
  662. $(eval $(call BuildPlugin,freeradius3-mod-expr,rlm_expr,))
  663. $(eval $(call BuildPlugin,freeradius3-mod-files,rlm_files,))
  664. $(eval $(call BuildPlugin,freeradius3-mod-ldap,rlm_ldap,))
  665. $(eval $(call BuildPlugin,freeradius3-mod-logintime,rlm_logintime,))
  666. $(eval $(call BuildPlugin,freeradius3-mod-mschap,rlm_mschap,))
  667. $(eval $(call BuildPlugin,freeradius3-mod-pap,rlm_pap,))
  668. $(eval $(call BuildPlugin,freeradius3-mod-passwd,rlm_passwd,))
  669. $(eval $(call BuildPlugin,freeradius3-mod-preprocess,rlm_preprocess,))
  670. $(eval $(call BuildPlugin,freeradius3-mod-python3,rlm_python3,))
  671. $(eval $(call BuildPlugin,freeradius3-mod-radutmp,rlm_radutmp,))
  672. $(eval $(call BuildPlugin,freeradius3-mod-realm,rlm_realm,))
  673. $(eval $(call BuildPlugin,freeradius3-mod-rest,rlm_rest,))
  674. $(eval $(call BuildPlugin,freeradius3-mod-sql,rlm_sql,))
  675. $(eval $(call BuildPlugin,freeradius3-mod-sql-mysql,rlm_sql_mysql,))
  676. $(eval $(call BuildPlugin,freeradius3-mod-sql-null,rlm_sql_null,))
  677. $(eval $(call BuildPlugin,freeradius3-mod-sql-postgresql,rlm_sql_postgresql,))
  678. $(eval $(call BuildPlugin,freeradius3-mod-sql-sqlite,rlm_sql_sqlite,))
  679. $(eval $(call BuildPlugin,freeradius3-mod-sqlcounter,rlm_sqlcounter,))
  680. $(eval $(call BuildPlugin,freeradius3-mod-sqlippool,rlm_sqlippool,))
  681. $(eval $(call BuildPlugin,freeradius3-mod-unix,rlm_unix,))
  682. $(eval $(call BuildPackage,freeradius3-utils))