Makefile 9.0 KB

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