Makefile 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include ${ADK_TOPDIR}/rules.mk
  4. PKG_NAME:= freeradius-server
  5. PKG_VERSION:= 3.0.8
  6. PKG_RELEASE:= 1
  7. PKG_HASH:= c27252d7a86ba252904612d9b1f90e846f3ef1f4afee6a748f5287b730e87e3a
  8. PKG_DESCR:= flexible radius server
  9. PKG_SECTION:= net/radius
  10. PKG_DEPENDS:= libltdl libpthread libpcre libtalloc
  11. PKG_BUILDDEP:= libtool pcre talloc
  12. PKG_URL:= http://www.freeradius.org/
  13. PKG_SITES:= ftp://ftp.freeradius.org/pub/radius/
  14. PKG_CHOICES_FREERADIUS_SERVER:= WITH_LIBRESSL WITH_OPENSSL
  15. PKGCD_WITH_LIBRESSL:= use libressl for crypto
  16. PKGCB_WITH_LIBRESSL:= libressl
  17. PKGCS_WITH_LIBRESSL:= libressl
  18. PKGCD_WITH_OPENSSL:= use openssl for crypto
  19. PKGCB_WITH_OPENSSL:= openssl
  20. PKGCS_WITH_OPENSSL:= libopenssl
  21. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
  22. PKG_SUBPKGS:= FREERADIUS_SERVER FREERADIUS_DEMOCERTS FREERADIUS_MOD_CHAP FREERADIUS_MOD_DETAIL
  23. PKG_SUBPKGS+= FREERADIUS_MOD_DIGEST FREERADIUS_MOD_FILES FREERADIUS_MOD_LDAP FREERADIUS_MOD_MSCHAP
  24. PKG_SUBPKGS+= FREERADIUS_MOD_PAP FREERADIUS_MOD_PREPROCESS FREERADIUS_MOD_REALM FREERADIUS_MOD_SQL
  25. PKG_SUBPKGS+= FREERADIUS_MOD_SQL_MYSQL FREERADIUS_MOD_SQL_PGSQL FREERADIUS_UTILS
  26. # sub package build dependencies
  27. PKGSB_FREERADIUS_MOD_LDAP:= openldap
  28. PKGSB_FREERADIUS_MOD_SQL_MYSQL:= mysql
  29. PKGSB_FREERADIUS_MOD_SQL_PGSQL:= postgresql
  30. PKGSS_FREERADIUS_MOD_LDAP:= libopenldap
  31. PKGSS_FREERADIUS_MOD_SQL_MYSQL:= libmysqlclient
  32. PKGSS_FREERADIUS_MOD_SQL_PGSQL:= libpq
  33. PKGSD_FREERADIUS_DEMOCERTS:= Demo certificates to test the server
  34. PKGSN_FREERADIUS_DEMOCERTS:= freeradius-server
  35. PKGSD_FREERADIUS_MOD_CHAP:= CHAP authentication module
  36. PKGSN_FREERADIUS_MOD_CHAP:= freeradius-server
  37. PKGSD_FREERADIUS_MOD_DETAIL:= Detailed accounting module
  38. PKGSN_FREERADIUS_MOD_DETAIL:= freeradius-server
  39. PKGSD_FREERADIUS_MOD_DIGEST:= Digest authentication module
  40. PKGSN_FREERADIUS_MOD_DIGEST:= freeradius-server
  41. PKGSD_FREERADIUS_MOD_FILES:= Module using local files for authorization
  42. PKGSN_FREERADIUS_MOD_FILES:= freeradius-server
  43. PKGSD_FREERADIUS_MOD_LDAP:= LDAP module
  44. PKGSN_FREERADIUS_MOD_LDAP:= freeradius-server
  45. PKGSD_FREERADIUS_MOD_MSCHAP:= MS-CHAP and MS-CHAPv2 module
  46. PKGSN_FREERADIUS_MOD_MSCHAP:= freeradius-server
  47. PKGSD_FREERADIUS_MOD_PAP:= PAP authentication module
  48. PKGSN_FREERADIUS_MOD_PAP:= freeradius-server
  49. PKGSD_FREERADIUS_MOD_PREPROCESS:= Request pre-processing module
  50. PKGSN_FREERADIUS_MOD_PREPROCESS:= freeradius-server
  51. PKGSD_FREERADIUS_MOD_REALM:= Realms handling module
  52. PKGSN_FREERADIUS_MOD_REALM:= freeradius-server
  53. PKGSD_FREERADIUS_MOD_SQL:= Base SQL module
  54. PKGSN_FREERADIUS_MOD_SQL:= freeradius-server
  55. PKGSD_FREERADIUS_MOD_SQL_MYSQL:= MySQL module
  56. PKGSN_FREERADIUS_MOD_SQL_MYSQL:= freeradius-server
  57. PKGSD_FREERADIUS_MOD_SQL_PGSQL:= PostgreSQL module
  58. PKGSN_FREERADIUS_MOD_SQL_PGSQL:= freeradius-server
  59. PKGSD_FREERADIUS_UTILS:= Misc. client utilities
  60. PKGSN_FREERADIUS_UTILS:= freeradius-server
  61. PKG_CONFIGURE_OPTS:=
  62. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_LDAP},)
  63. PKG_CONFIGURE_LIBS+= -lcrypto -lssl
  64. PKG_CONFIGURE_OPTS+= --with-rlm_ldap-include-dir="${STAGING_TARGET_DIR}/usr/include" \
  65. --with-rlm_ldap-lib-dir="${STAGING_TARGET_DIR}/usr/lib"
  66. else
  67. PKG_CONFIGURE_OPTS+= --without-rlm_ldap
  68. endif
  69. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL},)
  70. PKG_CONFIGURE_LIBS+= -lz
  71. PKG_CONFIGURE_OPTS+= --with-mysql-include-dir="${STAGING_TARGET_DIR}/usr/include" \
  72. --with-mysql-lib-dir="${STAGING_TARGET_DIR}/usr/lib/mysql" \
  73. --without-threads \
  74. --with-rlm_sql
  75. else
  76. PKG_CONFIGURE_OPTS+= --without-rlm_sql_mysql
  77. endif
  78. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL},)
  79. PKG_CONFIGURE_OPTS+= --with-rlm_sql_postgresql-include-dir="${STAGING_TARGET_DIR}/usr/include" \
  80. --with-rlm_sql_postgresql-lib-dir="${STAGING_TARGET_DIR}/usr/lib" \
  81. --with-rlm_sql
  82. else
  83. PKG_CONFIGURE_OPTS+= --without-rlm_sql_postgresql
  84. endif
  85. include ${ADK_TOPDIR}/mk/package.mk
  86. define PKG_mod_template
  87. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  88. ${2}-install:
  89. ${INSTALL_DIR} $${IDIR_${1}}/usr/lib/freeradius
  90. for m in ${2}; do \
  91. ${CP} ${WRKINST}/usr/lib/freeradius/$$$${m}.so \
  92. $${IDIR_${1}}/usr/lib/freeradius/ ; \
  93. done
  94. ${INSTALL_DIR} $${IDIR_${1}}/etc/freeradius
  95. for f in ${3}; do \
  96. ${CP} ${WRKINST}/etc/freeradius/$$$${f} \
  97. $${IDIR_${1}}/etc/freeradius/ ; \
  98. done
  99. endef
  100. $(eval $(call PKG_template,FREERADIUS_SERVER,freeradius-server,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  101. $(eval $(call PKG_template,FREERADIUS_DEMOCERTS,freeradius-democerts,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_DEMOCERTS},${PKG_SECTION}))
  102. $(eval $(call PKG_template,FREERADIUS_MOD_CHAP,freeradius-mod-chap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_CHAP},${PKG_SECTION}))
  103. $(eval $(call PKG_template,FREERADIUS_MOD_DETAIL,freeradius-mod-detail,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_DETAIL},${PKG_SECTION}))
  104. $(eval $(call PKG_template,FREERADIUS_MOD_DIGEST,freeradius-mod-digest,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_DIGEST},${PKG_SECTION}))
  105. $(eval $(call PKG_template,FREERADIUS_MOD_FILES,freeradius-mod-files,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_FILES},${PKG_SECTION}))
  106. $(eval $(call PKG_template,FREERADIUS_MOD_LDAP,freeradius-mod-ldap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_LDAP},${PKGSD_FREERADIUS_MOD_LDAP},${PKG_SECTION}))
  107. $(eval $(call PKG_template,FREERADIUS_MOD_MSCHAP,freeradius-mod-mschap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_MSCHAP},${PKG_SECTION}))
  108. $(eval $(call PKG_template,FREERADIUS_MOD_PAP,freeradius-mod-pap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_PAP},${PKG_SECTION}))
  109. $(eval $(call PKG_template,FREERADIUS_MOD_PREPROCESS,freeradius-mod-preprocess,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_PREPROCESS},${PKG_SECTION}))
  110. $(eval $(call PKG_template,FREERADIUS_MOD_REALM,freeradius-mod-realm,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_REALM},${PKG_SECTION}))
  111. $(eval $(call PKG_template,FREERADIUS_MOD_SQL,freeradius-mod-sql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_MOD_SQL},${PKG_SECTION}))
  112. $(eval $(call PKG_template,FREERADIUS_MOD_SQL_MYSQL,freeradius-mod-sql-mysql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_MYSQL},${PKGSD_FREERADIUS_MOD_SQL_MYSQL},${PKG_SECTION}))
  113. $(eval $(call PKG_template,FREERADIUS_MOD_SQL_PGSQL,freeradius-mod-sql-pgsql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_PGSQL},${PKGSD_FREERADIUS_MOD_SQL_PGSQL},${PKG_SECTION}))
  114. $(eval $(call PKG_template,FREERADIUS_UTILS,freeradius-utils,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FREERADIUS_UTILS},${PKG_SECTION}))
  115. $(eval $(call PKG_mod_template,FREERADIUS_MOD_CHAP,rlm_chap,))
  116. $(eval $(call PKG_mod_template,FREERADIUS_MOD_DETAIL,rlm_detail,))
  117. $(eval $(call PKG_mod_template,FREERADIUS_MOD_DIGEST,rlm_digest,))
  118. $(eval $(call PKG_mod_template,FREERADIUS_MOD_FILES,rlm_files,acct_users preproxy_users users))
  119. $(eval $(call PKG_mod_template,FREERADIUS_MOD_MSCHAP,rlm_mschap,))
  120. $(eval $(call PKG_mod_template,FREERADIUS_MOD_LDAP,rlm_ldap,))
  121. $(eval $(call PKG_mod_template,FREERADIUS_MOD_PAP,rlm_pap,))
  122. $(eval $(call PKG_mod_template,FREERADIUS_MOD_PREPROCESS,rlm_preprocess,hints huntgroups))
  123. $(eval $(call PKG_mod_template,FREERADIUS_MOD_REALM,rlm_realm,proxy.conf))
  124. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL,rlm_sql,))
  125. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_MYSQL,rlm_sql_mysql,))
  126. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_PGSQL,rlm_sql_postgresql,))
  127. TARGET_LDFLAGS+= -lm
  128. AUTOTOOL_STYLE:= autoreconf
  129. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  130. CONFIGURE_ARGS+= ${PKG_CONFIGURE_OPTS} \
  131. --libdir=/usr/lib/freeradius \
  132. --libexecdir=/usr/lib/freeradius \
  133. --disable-openssl-version-check \
  134. --with-execinfo-include-dir=/dev/null \
  135. --with-openssl-includes=${STAGING_TARGET_DIR}/usr/include \
  136. --with-openssl-libraries=${STAGING_TARGET_DIR}/usr/lib \
  137. --with-system-libltld \
  138. --enable-strict-dependencies \
  139. --with-raddbdir=/etc/freeradius \
  140. --without-edir \
  141. --without-snmp \
  142. --without-experimental-modules \
  143. --without-rlm_attr-rewrite \
  144. --without-rlm_checkval \
  145. --without-rlm_counter \
  146. --without-rlm_dbm \
  147. --without-rlm_eap \
  148. --without-rlm_eap2 \
  149. --without-rlm_eap_sim \
  150. --without-rlm_example \
  151. --without-rlm_ippool \
  152. --without-rlm_krb5 \
  153. --without-rlm_otp \
  154. --without-rlm_smsotp \
  155. --without-rlm_pam \
  156. --without-rlm_perl \
  157. --without-rlm_python \
  158. --without-rlm_radutmp \
  159. --without-rlm_rest \
  160. --without-rlm_ruby \
  161. --without-rlm_smb \
  162. --without-rlm_sqlcounter \
  163. --without-rlm_sql_db2 \
  164. --without-rlm_sql_freetds \
  165. --without-rlm_sql_iodbc \
  166. --without-rlm_sql_oracle \
  167. --without-rlm_sql_sybase \
  168. --without-rlm_sql_unixodbc \
  169. --without-rlm_sql_log \
  170. --without-rlm_unix \
  171. --without-rlm_eap_ikev2 \
  172. --without-rlm_eap_tnc \
  173. --without-rlm_cache_memcached \
  174. --without-rlm_opendirectory \
  175. --without-rlm_sql_firebird \
  176. --without-rlm_sql_sqlite
  177. CONFIGURE_ENV+= ax_cv_cc_builtin_choose_expr=yes \
  178. ax_cv_cc_builtin_types_compatible_p=yes \
  179. ax_cv_cc_builtin_bswap64=yes \
  180. ax_cv_cc_bounded_attribute=yes
  181. FAKE_FLAGS+= R="${WRKINST}" \
  182. INSTALLSTRIP=""
  183. freeradius-server-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  184. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  185. ${CP} ./files/users ${IDIR_FREERADIUS_SERVER}/etc/freeradius/
  186. ${INSTALL_DATA} ./files/radiusd.conf \
  187. ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  188. ${INSTALL_DATA} ./files/clients.conf \
  189. ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  190. for f in dictionary; do \
  191. ${CP} ${WRKINST}/etc/freeradius/$${f} \
  192. ${IDIR_FREERADIUS_SERVER}/etc/freeradius/ ; \
  193. done
  194. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius
  195. ${CP} ${WRKINST}/usr/share/freeradius/dictionary \
  196. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/
  197. for f in freeradius freeradius.internal rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 rfc4072 rfc4372 rfc4675 rfc4679 rfc5176; do \
  198. cp ${WRKINST}/usr/share/freeradius/dictionary.$${f} \
  199. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/ ; \
  200. done
  201. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/lib/freeradius
  202. ${CP} ${WRKINST}/usr/lib/freeradius/libfreeradius-radius.so \
  203. ${IDIR_FREERADIUS_SERVER}/usr/lib
  204. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/sbin
  205. ${CP} ${WRKINST}/usr/sbin/radiusd \
  206. ${IDIR_FREERADIUS_SERVER}/usr/sbin/
  207. ${INSTALL_DIR} ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius
  208. ${CP} ${WRKINST}/etc/freeradius/certs \
  209. ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/
  210. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/README
  211. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/new*
  212. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/index*
  213. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/serial*
  214. ${INSTALL_DIR} ${IDIR_FREERADIUS_UTILS}/usr/bin
  215. ${INSTALL_BIN} ${WRKINST}/usr/bin/radclient \
  216. ${IDIR_FREERADIUS_UTILS}/usr/bin
  217. include ${ADK_TOPDIR}/mk/pkg-bottom.mk