Makefile 10 KB

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