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