1DESCRIPTION = "FreeRADIUS is an Internet authentication daemon, which implements the RADIUS \ 2protocol, as defined in RFC 2865 (and others). It allows Network Access \ 3Servers (NAS boxes) to perform authentication for dial-up users. There are \ 4also RADIUS clients available for Web servers, firewalls, Unix logins, and \ 5more. Using RADIUS allows authentication and authorization for a network to \ 6be centralized, and minimizes the amount of re-configuration which has to be \ 7done when adding or deleting new users." 8 9SUMMARY = "High-performance and highly configurable RADIUS server" 10HOMEPAGE = "http://www.freeradius.org/" 11SECTION = "System/Servers" 12LICENSE = "GPL-2.0-only & LGPL-2.0-or-later" 13LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a" 14DEPENDS = "openssl-native openssl libidn libtool libpcap libtalloc" 15 16SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.2.x;lfs=0;;protocol=https \ 17 file://freeradius \ 18 file://volatiles.58_radiusd \ 19 file://radiusd.service \ 20 file://radiusd-volatiles.conf \ 21 file://0001-Add-autogen.sh.patch \ 22 file://0002-Enable-and-change-user-and-group-of-freeradius-serve.patch \ 23 file://0003-configure.ac-allow-cross-compilation.patch \ 24 file://0004-Fix-libtool-detection.patch \ 25 file://0005-configure.ac-add-option-for-libcap.patch \ 26 file://0006-Avoid-searching-host-dirs.patch \ 27 file://0007-rlm_python-add-PY_INC_DIR-in-search-dir.patch \ 28 file://0008-libtool-do-not-use-jlibtool.patch \ 29 file://0009-Fix-quoting-for-BUILD_WITH.patch \ 30 file://0010-fix-error-for-expansion-of-macro-in-thread.h.patch \ 31 file://0011-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch \ 32 file://0012-raddb-certs-Makefile-fix-the-existed-certificate-err.patch \ 33 file://0013-raddb-certs-Makefile-fix-the-occasional-verification.patch \ 34 file://0014-Workaround-error-with-autoconf-2.7.patch \ 35 file://0015-bootstrap-check-commands-of-openssl-exist.patch \ 36 file://0016-version.c-don-t-print-build-flags.patch \ 37 file://0017-Add-acinclude.m4-to-include-required-macros.patch \ 38" 39 40raddbdir = "${sysconfdir}/${MLPREFIX}raddb" 41 42SRCREV = "a7acce80f5ba2271d9aeb737a4a91a5bf8317f31" 43 44UPSTREAM_CHECK_GITTAGREGEX = "release_(?P<pver>\d+(\_\d+)+)" 45 46CVE_STATUS[CVE-2002-0318] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions." 47CVE_STATUS[CVE-2011-4966] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions." 48 49PARALLEL_MAKE = "" 50 51S = "${WORKDIR}/git" 52 53LDFLAGS:append:powerpc = " -latomic" 54LDFLAGS:append:mipsarch = " -latomic" 55LDFLAGS:append:armv5 = " -latomic" 56 57EXTRA_OECONF = " --enable-strict-dependencies \ 58 --with-docdir=${docdir}/freeradius-${PV} \ 59 --with-openssl-includes=${STAGING_INCDIR} \ 60 --with-openssl-libraries=${STAGING_LIBDIR} \ 61 --with-raddbdir=${raddbdir} \ 62 --without-rlm_ippool \ 63 --without-rlm_cache_memcached \ 64 --without-rlm_counter \ 65 --without-rlm_couchbase \ 66 --without-rlm_dbm \ 67 --without-rlm_eap_tnc \ 68 --without-rlm_eap_ikev2 \ 69 --without-rlm_opendirectory \ 70 --without-rlm_redis \ 71 --without-rlm_rediswho \ 72 --without-rlm_cache_redis \ 73 --without-rlm_sql_db2 \ 74 --without-rlm_sql_firebird \ 75 --without-rlm_sql_freetds \ 76 --without-rlm_sql_iodbc \ 77 --without-rlm_sql_oracle \ 78 --without-rlm_sql_sybase \ 79 --without-rlm_sql_mongo \ 80 --without-rlm_sqlhpwippool \ 81 --without-rlm_securid \ 82 --without-rlm_unbound \ 83 --without-rlm_python \ 84 ac_cv_path_PERL=${bindir}/perl \ 85 ax_cv_cc_builtin_choose_expr=no \ 86 ax_cv_cc_builtin_types_compatible_p=no \ 87 ax_cv_cc_builtin_bswap64=no \ 88 ax_cv_cc_bounded_attribute=no \ 89" 90 91PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ 92 pcre libcap \ 93 openssl rlm-eap-fast rlm-eap-pwd \ 94" 95 96PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5" 97PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam" 98PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap" 99PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap" 100PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5" 101PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3" 102PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc" 103PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql" 104PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre" 105PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl" 106PACKAGECONFIG[python3] = "--with-rlm_python3 --with-rlm-python3-bin=${STAGING_BINDIR_NATIVE}/python3-native/python3 --with-rlm-python3-include-dir=${STAGING_INCDIR}/${PYTHON_DIR},--without-rlm_python3,python3-native python3" 107PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest --without-rlm_json,curl json-c" 108PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby" 109PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl" 110PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast" 111PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd" 112 113inherit useradd autotools-brokensep update-rc.d systemd multilib_script multilib_header 114 115MULTILIB_SCRIPTS = "${PN}:${sbindir}/checkrad" 116 117# This is not a cpan or python based package, but it needs some definitions 118# from cpan-base and python3-dir bbclasses for building rlm_perl and rlm_python 119# correctly. 120inherit cpan-base python3-dir 121 122# The modules subdirs also need to be processed by autoreconf. Use autogen.sh 123# in order to handle the subdirs correctly. 124do_configure() { 125 ./autogen.sh 126 127 # the configure of rlm_perl needs this to get correct 128 # mod_cflags and mod_ldflags 129 if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then 130 export PERL5LIB="${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" 131 fi 132 133 oe_runconf 134 135 # we don't need dhcpclient 136 sed -i -e 's/dhcpclient.mk//' ${S}/src/modules/proto_dhcp/all.mk 137} 138 139INITSCRIPT_NAME = "radiusd" 140 141SYSTEMD_SERVICE:${PN} = "radiusd.service" 142 143USERADD_PACKAGES = "${PN}" 144USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd" 145 146do_install() { 147 rm -rf ${D} 148 install -d ${D}/${sysconfdir}/logrotate.d 149 install -d ${D}/${sysconfdir}/pam.d 150 install -d ${D}/${localstatedir}/lib/radiusd 151 152 export LD_LIBRARY_PATH=${D}/${libdir} 153 oe_runmake install R=${D} INSTALLSTRIP="" 154 155 # remove unsupported config files 156 rm -f ${D}/${raddbdir}/experimental.conf 157 158 # remove scripts that required Perl(DBI) 159 rm -rf ${D}/${bindir}/radsqlrelay 160 161 rm -f ${D}/${sbindir}/rc.radiusd 162 rm -rf ${D}/${localstatedir}/run/ 163 rm -rf ${D}/${localstatedir}/log/ 164 165 chown -R radiusd:radiusd ${D}/${raddbdir} 166 chown -R radiusd:radiusd ${D}/${localstatedir}/lib/radiusd 167 168 # For sysvinit 169 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 170 install -d ${D}${sysconfdir}/init.d 171 install -d ${D}${sysconfdir}/default/volatiles 172 install -m 0755 ${UNPACKDIR}/freeradius ${D}/etc/init.d/radiusd 173 install -m 0644 ${UNPACKDIR}/volatiles.58_radiusd ${D}${sysconfdir}/default/volatiles/58_radiusd 174 fi 175 176 # For systemd 177 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 178 install -d ${D}${systemd_unitdir}/system 179 install -m 0644 ${UNPACKDIR}/radiusd.service ${D}${systemd_unitdir}/system 180 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ 181 -e 's,@SBINDIR@,${sbindir},g' \ 182 -e 's,@STATEDIR@,${localstatedir},g' \ 183 -e 's,@SYSCONFDIR@,${sysconfdir},g' \ 184 ${D}${systemd_unitdir}/system/radiusd.service 185 186 install -d ${D}${sysconfdir}/tmpfiles.d/ 187 install -m 0644 ${UNPACKDIR}/radiusd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/radiusd.conf 188 fi 189 190 oe_multilib_header freeradius/autoconf.h 191 oe_multilib_header freeradius/missing.h 192 oe_multilib_header freeradius/radpaths.h 193} 194 195# This is only needed when we install/update on a running target. 196# 197pkg_postinst:${PN} () { 198 if [ -z "$D" ]; then 199 if command -v systemd-tmpfiles >/dev/null; then 200 # create /var/log/radius, /var/run/radiusd 201 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/radiusd.conf 202 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then 203 ${sysconfdir}/init.d/populate-volatile.sh update 204 fi 205 206 # Fix ownership for /etc/raddb/*, /var/lib/radiusd 207 chown -R radiusd:radiusd ${raddbdir} 208 chown -R radiusd:radiusd ${localstatedir}/lib/radiusd 209 210 # for radiusd.service with multilib 211 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 212 install -d ${sysconfdir}/sysconfig 213 echo "MLPREFIX=${MLPREFIX}" > ${sysconfdir}/sysconfig/radiusd 214 fi 215 else 216 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 217 install -d $D${sysconfdir}/sysconfig 218 echo "MLPREFIX=${MLPREFIX}" > $D${sysconfdir}/sysconfig/radiusd 219 fi 220 fi 221} 222 223pkg_postrm:${PN} () { 224 # only try to remove ${sysconfdir}/sysconfig/radiusd for systemd 225 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'false', 'true', d)}; then 226 exit 0 227 fi 228 229 if [ -d ${sysconfdir}/raddb ]; then 230 exit 0 231 fi 232 for variant in ${MULTILIB_GLOBAL_VARIANTS}; do 233 if [ -d ${sysconfdir}/${variant}-raddb ]; then 234 exit 0 235 fi 236 done 237 238 rm -f ${sysconfdir}/sysconfig/radiusd 239 rmdir --ignore-fail-on-non-empty ${sysconfdir}/sysconfig 240} 241 242# We really need the symlink :( 243INSANE_SKIP:${PN} = "dev-so" 244INSANE_SKIP:${PN}-krb5 = "dev-so" 245INSANE_SKIP:${PN}-ldap = "dev-so" 246INSANE_SKIP:${PN}-mysql = "dev-so" 247INSANE_SKIP:${PN}-perl = "dev-so" 248INSANE_SKIP:${PN}-postgresql = "dev-so" 249INSANE_SKIP:${PN}-python = "dev-so" 250INSANE_SKIP:${PN}-unixodbc = "dev-so" 251 252PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \ 253 ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc" 254 255FILES:${PN}-utils = "${bindir}/*" 256 257FILES:${PN}-ldap = "${libdir}/rlm_ldap.so* \ 258 ${raddbdir}/mods-available/ldap \ 259" 260 261FILES:${PN}-krb5 = "${libdir}/rlm_krb5.so* \ 262 ${raddbdir}/mods-available/krb5 \ 263" 264 265FILES:${PN}-perl = "${libdir}/rlm_perl.so* \ 266 ${raddbdir}/mods-config/perl \ 267 ${raddbdir}/mods-available/perl \ 268" 269 270FILES:${PN}-python = "${libdir}/rlm_python3.so* \ 271 ${raddbdir}/mods-config/python3 \ 272 ${raddbdir}/mods-available/python3 \ 273" 274 275FILES:${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \ 276 ${raddbdir}/mods-config/sql/*/mysql \ 277 ${raddbdir}/mods-available/sql \ 278" 279 280FILES:${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \ 281 ${raddbdir}/mods-config/sql/*/postgresql \ 282" 283 284FILES:${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*" 285 286FILES:${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*" 287 288RDEPENDS:${PN} += "perl" 289RDEPENDS:${PN}-utils = "${PN} perl" 290RDEPENDS:${PN}-krb5 = "${PN}" 291RDEPENDS:${PN}-ldap = "${PN}" 292RDEPENDS:${PN}-mysql = "${PN}" 293RDEPENDS:${PN}-perl = "${PN}" 294RDEPENDS:${PN}-postgresql = "${PN}" 295RDEPENDS:${PN}-python = "${PN}" 296RDEPENDS:${PN}-unixodbc = "${PN}" 297 298CLEANBROKEN = "1" 299