Makefile 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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_DEPENDS:= libltdl libopenssl libpthread
  11. PKG_BUILDDEP:= libtool openssl
  12. PKG_URL:= http://www.freeradius.org/
  13. PKG_SITES:= ftp://ftp.freeradius.org/pub/radius/
  14. PKG_MULTI:= 1
  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. PKG_HOST_DEPENDS:= !cygwin
  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,ldap.attrmap))
  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,sql.conf))
  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. CONFIGURE_ARGS+= ${PKG_CONFIGURE_OPTS} \
  108. --with-openssl-includes=${STAGING_TARGET_DIR}/usr/include \
  109. --with-openssl-libraries=${STAGING_TARGET_DIR}/usr/lib \
  110. --with-system-libltld \
  111. --enable-strict-dependencies \
  112. --with-raddbdir=/etc/freeradius \
  113. --without-edir \
  114. --without-snmp \
  115. --without-experimental-modules \
  116. --without-rlm_attr-rewrite \
  117. --without-rlm_checkval \
  118. --without-rlm_counter \
  119. --without-rlm_dbm \
  120. --without-rlm_eap \
  121. --without-rlm_eap2 \
  122. --without-rlm_eap_sim \
  123. --without-rlm_example \
  124. --without-rlm_ippool \
  125. --without-rlm_krb5 \
  126. --without-rlm_otp \
  127. --without-rlm_smsotp \
  128. --without-rlm_pam \
  129. --without-rlm_perl \
  130. --without-rlm_python \
  131. --without-rlm_radutmp \
  132. --without-rlm_ruby \
  133. --without-rlm_smb \
  134. --without-rlm_sqlcounter \
  135. --without-rlm_sql_db2 \
  136. --without-rlm_sql_freetds \
  137. --without-rlm_sql_iodbc \
  138. --without-rlm_sql_oracle \
  139. --without-rlm_sql_sybase \
  140. --without-rlm_sql_unixodbc \
  141. --without-rlm_sql_log \
  142. --without-rlm_unix \
  143. --without-rlm_eap_ikev2 \
  144. --without-rlm_eap_tnc \
  145. --without-rlm_opendirectory \
  146. --without-rlm_sql_firebird \
  147. --without-rlm_sql_sqlite \
  148. --libdir=/usr/lib/freeradius \
  149. --libexecdir=/usr/lib/freeradius
  150. FAKE_FLAGS+= R="${WRKINST}" \
  151. INSTALLSTRIP=""
  152. post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  153. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  154. ${CP} ./files/users ${IDIR_FREERADIUS_SERVER}/etc/freeradius/
  155. ${INSTALL_DATA} ./files/radiusd.conf \
  156. ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  157. ${INSTALL_DATA} ./files/clients.conf \
  158. ${IDIR_FREERADIUS_SERVER}/etc/freeradius
  159. for f in dictionary; do \
  160. ${CP} ${WRKINST}/etc/freeradius/$${f} \
  161. ${IDIR_FREERADIUS_SERVER}/etc/freeradius/ ; \
  162. done
  163. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius
  164. ${CP} ${WRKINST}/usr/share/freeradius/dictionary \
  165. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/
  166. for f in freeradius freeradius.internal rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 rfc4072 rfc4372 rfc4675 rfc4679 rfc5176; do \
  167. cp ${WRKINST}/usr/share/freeradius/dictionary.$${f} \
  168. ${IDIR_FREERADIUS_SERVER}/usr/share/freeradius/ ; \
  169. done
  170. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/lib/freeradius
  171. ${CP} ${WRKINST}/usr/lib/freeradius/libfreeradius-radius{,-*}.so \
  172. ${IDIR_FREERADIUS_SERVER}/usr/lib
  173. ${INSTALL_DIR} ${IDIR_FREERADIUS_SERVER}/usr/sbin
  174. ${CP} ${WRKINST}/usr/sbin/radiusd \
  175. ${IDIR_FREERADIUS_SERVER}/usr/sbin/
  176. ${INSTALL_DIR} ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius
  177. ${CP} ${WRKINST}/etc/freeradius/certs \
  178. ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/
  179. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/README
  180. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/new*
  181. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/index*
  182. rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/serial*
  183. ${INSTALL_DIR} ${IDIR_FREERADIUS_UTILS}/usr/bin
  184. ${INSTALL_BIN} ${WRKINST}/usr/bin/radclient \
  185. ${IDIR_FREERADIUS_UTILS}/usr/bin
  186. include ${TOPDIR}/mk/pkg-bottom.mk