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