Makefile 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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.8
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= aa2ae711387af144df7c351b28b8789c
  8. PKG_DESCR:= a flexible RADIUS server
  9. PKG_SECTION:= ppp
  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. PKG_HOST_DEPENDS:= !cygwin
  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_OPTS:=
  43. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_LDAP},)
  44. PKG_CONFIGURE_LIBS+= -lcrypto -lssl
  45. PKG_CONFIGURE_OPTS+= --with-rlm_ldap-include-dir="${STAGING_DIR}/usr/include" \
  46. --with-rlm_ldap-lib-dir="${STAGING_DIR}/usr/lib"
  47. else
  48. PKG_CONFIGURE_OPTS+= --without-rlm_ldap
  49. endif
  50. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL},)
  51. PKG_CONFIGURE_LIBS+= -lz
  52. PKG_CONFIGURE_OPTS+= --with-mysql-include-dir="${STAGING_DIR}/usr/include" \
  53. --with-mysql-lib-dir="${STAGING_DIR}/usr/lib/mysql" \
  54. --without-threads \
  55. --with-rlm_sql
  56. else
  57. PKG_CONFIGURE_OPTS+= --without-rlm_sql_mysql
  58. endif
  59. ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL},)
  60. PKG_CONFIGURE_OPTS+= --with-rlm_sql_postgresql-include-dir="${STAGING_DIR}/usr/include" \
  61. --with-rlm_sql_postgresql-lib-dir="${STAGING_DIR}/usr/lib" \
  62. --with-rlm_sql
  63. else
  64. PKG_CONFIGURE_OPTS+= --without-rlm_sql_postgresql
  65. endif
  66. include ${TOPDIR}/mk/package.mk
  67. define PKG_mod_template
  68. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  69. ${2}-install:
  70. ${INSTALL_DIR} $${IDIR_${1}}/usr/lib/freeradius
  71. for m in ${2}; do \
  72. ${CP} ${WRKINST}/usr/lib/freeradius/$$$${m}{,-*}.so \
  73. $${IDIR_${1}}/usr/lib/freeradius/ ; \
  74. done
  75. ${INSTALL_DIR} $${IDIR_${1}}/etc/freeradius
  76. for f in ${3}; do \
  77. ${CP} ${WRKINST}/etc/freeradius/$$$${f} \
  78. $${IDIR_${1}}/etc/freeradius/ ; \
  79. done
  80. endef
  81. $(eval $(call PKG_template,FREERADIUS_SERVER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  82. $(eval $(call PKG_template,FREERADIUS_DEMOCERTS,freeradius-democerts,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_DEMOCERTS},${PKG_SECTION}))
  83. $(eval $(call PKG_template,FREERADIUS_MOD_CHAP,freeradius-mod-chap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_CHAP},${PKG_SECTION}))
  84. $(eval $(call PKG_template,FREERADIUS_MOD_DETAIL,freeradius-mod-detail,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_DETAIL},${PKG_SECTION}))
  85. $(eval $(call PKG_template,FREERADIUS_MOD_DIGEST,freeradius-mod-digest,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_DIGEST},${PKG_SECTION}))
  86. $(eval $(call PKG_template,FREERADIUS_MOD_FILES,freeradius-mod-files,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_FILES},${PKG_SECTION}))
  87. $(eval $(call PKG_template,FREERADIUS_MOD_LDAP,freeradius-mod-ldap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_LDAP},${PKG_DESCR_LDAP},${PKG_SECTION}))
  88. $(eval $(call PKG_template,FREERADIUS_MOD_MSCHAP,freeradius-mod-mschap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_MSCHAP},${PKG_SECTION}))
  89. $(eval $(call PKG_template,FREERADIUS_MOD_PAP,freeradius-mod-pap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_PAP},${PKG_SECTION}))
  90. $(eval $(call PKG_template,FREERADIUS_MOD_PREPROCESS,freeradius-mod-preprocess,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_PREPROCESS},${PKG_SECTION}))
  91. $(eval $(call PKG_template,FREERADIUS_MOD_REALM,freeradius-mod-realm,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_REALM},${PKG_SECTION}))
  92. $(eval $(call PKG_template,FREERADIUS_MOD_SQL,freeradius-mod-sql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_SQL},${PKG_SECTION}))
  93. $(eval $(call PKG_template,FREERADIUS_MOD_SQL_MYSQL,freeradius-mod-sql-mysql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_MYSQL},${PKG_DESCR_MYSQL},${PKG_SECTION}))
  94. $(eval $(call PKG_template,FREERADIUS_MOD_SQL_PGSQL,freeradius-mod-sql-pgsql,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_PGSQL},${PKG_DESCR_PGSQL},${PKG_SECTION}))
  95. $(eval $(call PKG_template,FREERADIUS_UTILS,freeradius-utils,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_UTILS},${PKG_SECTION}))
  96. $(eval $(call PKG_mod_template,FREERADIUS_MOD_CHAP,rlm_chap,))
  97. $(eval $(call PKG_mod_template,FREERADIUS_MOD_DETAIL,rlm_detail,))
  98. $(eval $(call PKG_mod_template,FREERADIUS_MOD_DIGEST,rlm_digest,))
  99. $(eval $(call PKG_mod_template,FREERADIUS_MOD_FILES,rlm_files,acct_users preproxy_users users))
  100. $(eval $(call PKG_mod_template,FREERADIUS_MOD_MSCHAP,rlm_mschap,))
  101. $(eval $(call PKG_mod_template,FREERADIUS_MOD_LDAP,rlm_ldap,ldap.attrmap))
  102. $(eval $(call PKG_mod_template,FREERADIUS_MOD_PAP,rlm_pap,))
  103. $(eval $(call PKG_mod_template,FREERADIUS_MOD_PREPROCESS,rlm_preprocess,hints huntgroups))
  104. $(eval $(call PKG_mod_template,FREERADIUS_MOD_REALM,rlm_realm,proxy.conf))
  105. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL,rlm_sql,sql.conf))
  106. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_MYSQL,rlm_sql_mysql,))
  107. $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_PGSQL,rlm_sql_postgresql,))
  108. CONFIGURE_ARGS+= ${PKG_CONFIGURE_OPTS} \
  109. --with-openssl-includes=${STAGING_DIR}/usr/include \
  110. --with-openssl-libraries=${STAGING_DIR}/usr/lib \
  111. --with-system-libltld \
  112. --enable-strict-dependencies \
  113. --with-raddbdir=/etc/freeradius \
  114. --without-edir \
  115. --without-snmp \
  116. --without-experimental-modules \
  117. --without-rlm_attr-rewrite \
  118. --without-rlm_checkval \
  119. --without-rlm_counter \
  120. --without-rlm_dbm \
  121. --without-rlm_eap \
  122. --without-rlm_eap2 \
  123. --without-rlm_eap_sim \
  124. --without-rlm_example \
  125. --without-rlm_ippool \
  126. --without-rlm_krb5 \
  127. --without-rlm_otp \
  128. --without-rlm_smsotp \
  129. --without-rlm_pam \
  130. --without-rlm_perl \
  131. --without-rlm_python \
  132. --without-rlm_radutmp \
  133. --without-rlm_ruby \
  134. --without-rlm_smb \
  135. --without-rlm_sqlcounter \
  136. --without-rlm_sql_db2 \
  137. --without-rlm_sql_freetds \
  138. --without-rlm_sql_iodbc \
  139. --without-rlm_sql_oracle \
  140. --without-rlm_sql_sybase \
  141. --without-rlm_sql_unixodbc \
  142. --without-rlm_sql_log \
  143. --without-rlm_unix \
  144. --without-rlm_eap_ikev2 \
  145. --without-rlm_eap_tnc \
  146. --without-rlm_opendirectory \
  147. --without-rlm_sql_firebird \
  148. --without-rlm_sql_sqlite \
  149. --libdir=/usr/lib/freeradius \
  150. --libexecdir=/usr/lib/freeradius
  151. FAKE_FLAGS+= R="${WRKINST}" \
  152. INSTALLSTRIP=""
  153. post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  154. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  155. ${CP} ./files/users ${IDIR_FREERADIUS_SERVER}/etc/freeradius/
  156. ${INSTALL_DATA} ./files/radiusd.conf \
  157. ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  158. ${INSTALL_DATA} ./files/clients.conf \
  159. ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  160. for f in dictionary; do \
  161. ${CP} ${WRKINST}/etc/freeradius/$${f} \
  162. ${IDIR_FREERADIUS_SERVER}/etc/freeradius/ ; \
  163. done
  164. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius
  165. ${CP} ${WRKINST}/usr/share/freeradius/dictionary \
  166. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/
  167. for f in freeradius freeradius.internal rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 rfc4072 rfc4372 rfc4675 rfc4679 rfc5176; do \
  168. cp ${WRKINST}/usr/share/freeradius/dictionary.$${f} \
  169. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/ ; \
  170. done
  171. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/lib/freeradius
  172. ${CP} ${WRKINST}/usr/lib/freeradius/libfreeradius-radius{,-*}.so \
  173. ${IDIR_FREERADIUS_SERVER}/usr/lib
  174. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/sbin
  175. ${CP} ${WRKINST}/usr/sbin/radiusd \
  176. ${IDIR_FREERADIUS_SERVER}/usr/sbin/
  177. ${INSTALL_DIR} ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius
  178. ${CP} ${WRKINST}/etc/freeradius/certs \
  179. ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/
  180. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/README
  181. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/new*
  182. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/index*
  183. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/serial*
  184. ${INSTALL_DIR} ${IDIR_FREERADIUS_UTILS}/usr/bin
  185. ${INSTALL_BIN} ${WRKINST}/usr/bin/radclient \
  186. ${IDIR_FREERADIUS_UTILS}/usr/bin
  187. include ${TOPDIR}/mk/pkg-bottom.mk