1
0

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