Makefile 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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 ${TOPDIR}/rules.mk
  4. PKG_NAME:= freeradius-server
  5. PKG_VERSION:= 2.1.7
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= b1f77c5e3116bcb0ac0aa9080a06ebf1
  8. PKG_DESCR:= a flexible RADIUS server
  9. PKG_SECTION:= net
  10. PKG_DEPENDS:= libltdl libopenssl libpthread
  11. PKG_BUILDDEP+= libtool openssl
  12. ifneq ($(ADK_PACKAGE_FREERADIUS_MOD_LDAP),)
  13. PKG_BUILDDEP+= openldap
  14. PKG_DEPENDS_LDAP:= libopenldap
  15. endif
  16. ifneq ($(ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL),)
  17. PKG_BUILDDEP+= mysql
  18. PKG_DEPENDS_MYSQL:= libmysqlclient
  19. endif
  20. ifneq ($(ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL),)
  21. PKG_BUILDDEP+= postgresql
  22. PKG_DEPENDS_PGSQL:= libpq
  23. endif
  24. PKG_URL:= http://www.freeradius.org
  25. PKG_SITES:= ftp://ftp.freeradius.org/pub/radius/ \
  26. http://freeradius.portal-to-web.de/ \
  27. ftp://ftp.uk.freeradius.org/pub/radius/
  28. PKG_DESCR_DEMOCERTS:= Demo certificates to test the server
  29. PKG_DESCR_CHAP:= CHAP authentication module
  30. PKG_DESCR_DETAIL:= Detailed accounting module
  31. PKG_DESCR_DIGEST:= Digest authentication module
  32. PKG_DESCR_FILES:= Module using local files for authorization
  33. PKG_DESCR_LDAP:= LDAP module
  34. PKG_DESCR_MSCHAP:= MS-CHAP and MS-CHAPv2 module
  35. PKG_DESCR_PAP:= PAP authentication module
  36. PKG_DESCR_PREPROCESS:= Request pre-processing module
  37. PKG_DESCR_REALM:= Realms handling module
  38. PKG_DESCR_SQL:= Base SQL module
  39. PKG_DESCR_MYSQL:= MySQL module
  40. PKG_DESCR_PGSQL:= PostgreSQL module
  41. PKG_DESCR_UTILS:= Misc. client utilities
  42. PKG_CONFIGURE_OPTIONS:=
  43. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_LDAP},)
  44. PKG_CONFIGURE_LIBS+= -lcrypto -lssl
  45. PKG_CONFIGURE_OPTIONS+= \
  46. --with-rlm_ldap-include-dir="${STAGING_DIR}/usr/include" \
  47. --with-rlm_ldap-lib-dir="${STAGING_DIR}/usr/lib"
  48. else
  49. PKG_CONFIGURE_OPTIONS+= --without-rlm_ldap
  50. endif
  51. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL},)
  52. PKG_CONFIGURE_LIBS+= -lz
  53. PKG_CONFIGURE_OPTIONS+= \
  54. --with-mysql-include-dir="${STAGING_DIR}/usr/include" \
  55. --with-mysql-lib-dir="${STAGING_DIR}/usr/lib/mysql" \
  56. --without-threads \
  57. --with-rlm_sql
  58. else
  59. PKG_CONFIGURE_OPTIONS+= --without-rlm_sql_mysql
  60. endif
  61. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL},)
  62. PKG_CONFIGURE_OPTIONS+= \
  63. --with-rlm_sql_postgresql-include-dir="${STAGING_DIR}/usr/include" \
  64. --with-rlm_sql_postgresql-lib-dir="${STAGING_DIR}/usr/lib" \
  65. --with-rlm_sql
  66. else
  67. PKG_CONFIGURE_OPTIONS+= --without-rlm_sql_postgresql
  68. endif
  69. include ${TOPDIR}/mk/package.mk
  70. define PKG_mod_template
  71. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  72. ${2}-install:
  73. ${INSTALL_DIR} $${IDIR_${1}}/usr/lib/freeradius
  74. for m in ${2}; do \
  75. ${CP} ${WRKINST}/usr/lib/freeradius/$$$${m}{,-*}.so \
  76. $${IDIR_${1}}/usr/lib/freeradius/ ; \
  77. done
  78. ${INSTALL_DIR} $${IDIR_${1}}/etc/freeradius
  79. for f in ${3}; do \
  80. ${CP} ${WRKINST}/etc/freeradius/$$$${f} \
  81. $${IDIR_${1}}/etc/freeradius/ ; \
  82. done
  83. endef
  84. $(eval $(call PKG_template,FREERADIUS_SERVER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  85. $(eval $(call PKG_template,FREERADIUS_DEMOCERTS,freeradius-democerts,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_DEMOCERTS},${PKG_SECTION}))
  86. $(eval $(call PKG_template,FREERADIUS_MOD_CHAP,freeradius-mod-chap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_CHAP},${PKG_SECTION}))
  87. $(eval $(call PKG_template,FREERADIUS_MOD_DETAIL,freeradius-mod-detail,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_DETAIL},${PKG_SECTION}))
  88. $(eval $(call PKG_template,FREERADIUS_MOD_DIGEST,freeradius-mod-digest,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_DIGEST},${PKG_SECTION}))
  89. $(eval $(call PKG_template,FREERADIUS_MOD_FILES,freeradius-mod-files,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_FILES},${PKG_SECTION}))
  90. $(eval $(call PKG_template,FREERADIUS_MOD_LDAP,freeradius-mod-ldap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_LDAP},${PKG_DESCR_LDAP},${PKG_SECTION}))
  91. $(eval $(call PKG_template,FREERADIUS_MOD_MSCHAP,freeradius-mod-mschap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_MSCHAP},${PKG_SECTION}))
  92. $(eval $(call PKG_template,FREERADIUS_MOD_PAP,freeradius-mod-pap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_PAP},${PKG_SECTION}))
  93. $(eval $(call PKG_template,FREERADIUS_MOD_PREPROCESS,freeradius-mod-preprocess,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_PREPROCESS},${PKG_SECTION}))
  94. $(eval $(call PKG_template,FREERADIUS_MOD_REALM,freeradius-mod-realm,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_REALM},${PKG_SECTION}))
  95. $(eval $(call PKG_template,FREERADIUS_MOD_SQL,freeradius-mod-sql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_SQL},${PKG_SECTION}))
  96. $(eval $(call PKG_template,FREERADIUS_MOD_SQL_MYSQL,freeradius-mod-sql-mysql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_MYSQL},${PKG_DESCR_MYSQL},${PKG_SECTION}))
  97. $(eval $(call PKG_template,FREERADIUS_MOD_SQL_PGSQL,freeradius-mod-sql-pgsql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_PGSQL},${PKG_DESCR_PGSQL},${PKG_SECTION}))
  98. $(eval $(call PKG_template,FREERADIUS_UTILS,freeradius-utils,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_UTILS},${PKG_SECTION}))
  99. $(eval $(call PKG_mod_template,FREERADIUS_MOD_CHAP,rlm_chap,))
  100. $(eval $(call PKG_mod_template,FREERADIUS_MOD_DETAIL,rlm_detail,))
  101. $(eval $(call PKG_mod_template,FREERADIUS_MOD_DIGEST,rlm_digest,))
  102. $(eval $(call PKG_mod_template,FREERADIUS_MOD_FILES,rlm_files,acct_users preproxy_users users))
  103. $(eval $(call PKG_mod_template,FREERADIUS_MOD_MSCHAP,rlm_mschap,))
  104. $(eval $(call PKG_mod_template,FREERADIUS_MOD_LDAP,rlm_ldap,ldap.attrmap))
  105. $(eval $(call PKG_mod_template,FREERADIUS_MOD_PAP,rlm_pap,))
  106. $(eval $(call PKG_mod_template,FREERADIUS_MOD_PREPROCESS,rlm_preprocess,hints huntgroups))
  107. $(eval $(call PKG_mod_template,FREERADIUS_MOD_REALM,rlm_realm,proxy.conf))
  108. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL,rlm_sql,sql.conf))
  109. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_MYSQL,rlm_sql_mysql,))
  110. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_PGSQL,rlm_sql_postgresql,))
  111. CONFIGURE_STYLE:= gnu
  112. CONFIGURE_ENV+= ac_cv_lib_nsl_inet_ntoa=no
  113. CONFIGURE_ARGS+= ${PKG_CONFIGURE_OPTIONS} \
  114. --with-openssl-includes=${STAGING_DIR}/usr/include \
  115. --with-openssl-libraries=${STAGING_DIR}/usr/lib \
  116. --enable-strict-dependencies \
  117. --with-raddbdir=/etc/freeradius \
  118. --without-edir \
  119. --without-snmp \
  120. --with-experimental-modules \
  121. --without-rlm_attr-rewrite \
  122. --without-rlm_checkval \
  123. --without-rlm_counter \
  124. --without-rlm_dbm \
  125. --without-rlm_eap \
  126. --without-rlm_eap2 \
  127. --without-rlm_eap_sim \
  128. --without-rlm_example \
  129. --without-rlm_ippool \
  130. --without-rlm_krb5 \
  131. --without-rlm_otp \
  132. --without-rlm_smsotp \
  133. --without-rlm_pam \
  134. --without-rlm_perl \
  135. --without-rlm_python \
  136. --without-rlm_radutmp \
  137. --without-rlm_ruby \
  138. --without-rlm_smb \
  139. --without-rlm_sqlcounter \
  140. --without-rlm_sql_db2 \
  141. --without-rlm_sql_freetds \
  142. --without-rlm_sql_iodbc \
  143. --without-rlm_sql_oracle \
  144. --without-rlm_sql_sybase \
  145. --without-rlm_sql_unixodbc \
  146. --without-rlm_sql_log \
  147. --without-rlm_unix \
  148. --without-rlm_eap_ikev2 \
  149. --without-rlm_eap_tnc \
  150. --without-rlm_opendirectory \
  151. --without-rlm_sql_firebird \
  152. --without-rlm_sql_sqlite \
  153. --libdir=/usr/lib/freeradius \
  154. --libexecdir=/usr/lib/freeradius
  155. BUILD_STYLE:= auto
  156. INSTALL_STYLE:= auto
  157. FAKE_FLAGS+= R="${WRKINST}" \
  158. INSTALLSTRIP=""
  159. post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  160. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  161. ${CP} ./files/users ${IDIR_FREERADIUS_SERVER}/etc/freeradius/
  162. ${INSTALL_DATA} ./files/radiusd.conf ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  163. ${INSTALL_DATA} ./files/clients.conf ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  164. for f in dictionary; do \
  165. ${CP} ${WRKINST}/etc/freeradius/$${f} \
  166. ${IDIR_FREERADIUS_SERVER}/etc/freeradius/ ; \
  167. done
  168. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius
  169. ${CP} ${WRKINST}/usr/share/freeradius/dictionary \
  170. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/
  171. for f in freeradius freeradius.internal rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 rfc4072 rfc4372 rfc4675 rfc4679 rfc5176; do \
  172. cp ${WRKINST}/usr/share/freeradius/dictionary.$${f} \
  173. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/ ; \
  174. done
  175. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/lib/freeradius
  176. ${CP} ${WRKINST}/usr/lib/freeradius/libfreeradius-radius{,-*}.so \
  177. ${IDIR_FREERADIUS_SERVER}/usr/lib
  178. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/sbin
  179. ${CP} ${WRKINST}/usr/sbin/radiusd \
  180. ${IDIR_FREERADIUS_SERVER}/usr/sbin/
  181. ${INSTALL_DIR} ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius
  182. ${CP} ${WRKINST}/etc/freeradius/certs \
  183. ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/
  184. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/README
  185. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/new*
  186. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/index*
  187. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/serial*
  188. ${INSTALL_DIR} ${IDIR_FREERADIUS_UTILS}/usr/bin
  189. ${INSTALL_BIN} ${WRKINST}/usr/bin/radclient ${IDIR_FREERADIUS_UTILS}/usr/bin
  190. include ${TOPDIR}/mk/pkg-bottom.mk