Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | DESCRIPTION = "FreeRADIUS is an Internet authentication daemon, which implements the RADIUS \ |
| 2 | protocol, as defined in RFC 2865 (and others). It allows Network Access \ |
| 3 | Servers (NAS boxes) to perform authentication for dial-up users. There are \ |
| 4 | also RADIUS clients available for Web servers, firewalls, Unix logins, and \ |
| 5 | more. Using RADIUS allows authentication and authorization for a network to \ |
| 6 | be centralized, and minimizes the amount of re-configuration which has to be \ |
| 7 | done when adding or deleting new users." |
| 8 | |
| 9 | SUMMARY = "High-performance and highly configurable RADIUS server" |
| 10 | HOMEPAGE = "http://www.freeradius.org/" |
| 11 | SECTION = "System/Servers" |
| 12 | LICENSE = "GPLv2 & LGPLv2+" |
| 13 | LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a" |
| 14 | DEPENDS = "openssl-native openssl libidn libtool libpcap libtalloc" |
| 15 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 16 | SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.0.x;lfs=0;;protocol=https \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | file://freeradius \ |
| 18 | file://volatiles.58_radiusd \ |
| 19 | file://freeradius-enble-user-in-conf.patch \ |
| 20 | file://freeradius-configure.ac-allow-cross-compilation.patch \ |
| 21 | file://freeradius-libtool-detection.patch \ |
| 22 | file://freeradius-configure.ac-add-option-for-libcap.patch \ |
| 23 | file://freeradius-avoid-searching-host-dirs.patch \ |
| 24 | file://freeradius-rlm_python-add-PY_INC_DIR.patch \ |
| 25 | file://freeradius-libtool-do-not-use-jlibtool.patch \ |
| 26 | file://freeradius-fix-quoting-for-BUILT_WITH.patch \ |
| 27 | file://freeradius-fix-error-for-expansion-of-macro.patch \ |
| 28 | file://0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch \ |
Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 29 | file://0001-raddb-certs-Makefile-fix-the-existed-certificate-err.patch \ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 30 | file://0001-raddb-certs-Makefile-fix-the-occasional-verification.patch \ |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 31 | file://0001-workaround-error-with-autoconf-2.7.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | file://radiusd.service \ |
| 33 | file://radiusd-volatiles.conf \ |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 34 | file://check-openssl-cmds-in-script-bootstrap.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | " |
| 36 | |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 37 | SRCREV = "af428abda249b2279ba0582180985a9f6f4a144a" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 38 | |
| 39 | PARALLEL_MAKE = "" |
| 40 | |
| 41 | S = "${WORKDIR}/git" |
| 42 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | LDFLAGS:append:powerpc = " -latomic" |
| 44 | LDFLAGS:append:mipsarch = " -latomic" |
| 45 | LDFLAGS:append:armv5 = " -latomic" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 46 | |
| 47 | EXTRA_OECONF = " --enable-strict-dependencies \ |
| 48 | --with-docdir=${docdir}/freeradius-${PV} \ |
| 49 | --with-openssl-includes=${STAGING_INCDIR} \ |
| 50 | --with-openssl-libraries=${STAGING_LIBDIR} \ |
| 51 | --without-rlm_ippool \ |
| 52 | --without-rlm_cache_memcached \ |
| 53 | --without-rlm_counter \ |
| 54 | --without-rlm_couchbase \ |
| 55 | --without-rlm_dbm \ |
| 56 | --without-rlm_eap_tnc \ |
| 57 | --without-rlm_eap_ikev2 \ |
| 58 | --without-rlm_opendirectory \ |
| 59 | --without-rlm_redis \ |
| 60 | --without-rlm_rediswho \ |
| 61 | --without-rlm_sql_db2 \ |
| 62 | --without-rlm_sql_firebird \ |
| 63 | --without-rlm_sql_freetds \ |
| 64 | --without-rlm_sql_iodbc \ |
| 65 | --without-rlm_sql_oracle \ |
| 66 | --without-rlm_sql_sybase \ |
| 67 | --without-rlm_sql_mongo \ |
| 68 | --without-rlm_sqlhpwippool \ |
| 69 | --without-rlm_securid \ |
| 70 | --without-rlm_unbound \ |
| 71 | --without-rlm_python \ |
| 72 | ac_cv_path_PERL=${bindir}/perl \ |
| 73 | ax_cv_cc_builtin_choose_expr=no \ |
| 74 | ax_cv_cc_builtin_types_compatible_p=no \ |
| 75 | ax_cv_cc_builtin_bswap64=no \ |
| 76 | ax_cv_cc_bounded_attribute=no \ |
| 77 | " |
| 78 | |
| 79 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ |
| 80 | pcre libcap \ |
| 81 | openssl rlm-eap-fast rlm-eap-pwd \ |
| 82 | " |
| 83 | |
| 84 | PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5" |
| 85 | PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam" |
| 86 | PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap" |
| 87 | PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap" |
| 88 | PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5" |
| 89 | PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3" |
| 90 | PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc" |
| 91 | PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql" |
| 92 | PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre" |
| 93 | PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl" |
| 94 | PACKAGECONFIG[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" |
| 95 | PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest,curl json-c" |
| 96 | PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby" |
| 97 | PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl" |
| 98 | PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast" |
| 99 | PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd" |
| 100 | |
| 101 | inherit useradd autotools-brokensep update-rc.d systemd |
| 102 | |
| 103 | # This is not a cpan or python based package, but it needs some definitions |
| 104 | # from cpan-base and python3-dir bbclasses for building rlm_perl and rlm_python |
| 105 | # correctly. |
| 106 | inherit cpan-base python3-dir |
| 107 | |
| 108 | # The modules subdirs also need to be processed by autoreconf. Use autogen.sh |
| 109 | # in order to handle the subdirs correctly. |
| 110 | do_configure () { |
| 111 | ./autogen.sh |
| 112 | |
| 113 | # the configure of rlm_perl needs this to get correct |
| 114 | # mod_cflags and mod_ldflags |
| 115 | if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then |
| 116 | export PERL5LIB="${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" |
| 117 | fi |
| 118 | |
| 119 | oe_runconf |
| 120 | |
| 121 | # we don't need dhcpclient |
| 122 | sed -i -e 's/dhcpclient.mk//' ${S}/src/modules/proto_dhcp/all.mk |
| 123 | } |
| 124 | |
| 125 | INITSCRIPT_NAME = "radiusd" |
| 126 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 127 | SYSTEMD_SERVICE:${PN} = "radiusd.service" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 128 | |
| 129 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 130 | USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 131 | |
| 132 | do_install() { |
| 133 | rm -rf ${D} |
| 134 | mkdir -p ${D}/${sysconfdir}/logrotate.d |
| 135 | mkdir -p ${D}/${sysconfdir}/pam.d |
| 136 | mkdir -p ${D}/${sysconfdir}/init.d |
| 137 | mkdir -p ${D}/${localstatedir}/lib/radiusd |
| 138 | mkdir -p ${D}${sysconfdir}/default/volatiles |
| 139 | |
| 140 | export LD_LIBRARY_PATH=${D}/${libdir} |
| 141 | oe_runmake install R=${D} INSTALLSTRIP="" |
| 142 | |
| 143 | # remove unsupported config files |
| 144 | rm -f ${D}/${sysconfdir}/raddb/experimental.conf |
| 145 | |
| 146 | # remove scripts that required Perl(DBI) |
| 147 | rm -rf ${D}/${bindir}/radsqlrelay |
| 148 | |
| 149 | cp -f ${WORKDIR}/freeradius ${D}/etc/init.d/radiusd |
| 150 | rm -f ${D}/${sbindir}/rc.radiusd |
| 151 | chmod +x ${D}/${sysconfdir}/init.d/radiusd |
| 152 | rm -rf ${D}/${localstatedir}/run/ |
| 153 | rm -rf ${D}/${localstatedir}/log/ |
| 154 | install -m 0644 ${WORKDIR}/volatiles.58_radiusd ${D}${sysconfdir}/default/volatiles/58_radiusd |
| 155 | |
| 156 | chown -R radiusd:radiusd ${D}/${sysconfdir}/raddb/ |
| 157 | chown -R radiusd:radiusd ${D}/${localstatedir}/lib/radiusd |
| 158 | |
| 159 | # For systemd |
| 160 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 161 | install -d ${D}${systemd_unitdir}/system |
| 162 | install -m 0644 ${WORKDIR}/radiusd.service ${D}${systemd_unitdir}/system |
| 163 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 164 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 165 | -e 's,@STATEDIR@,${localstatedir},g' \ |
| 166 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 167 | ${D}${systemd_unitdir}/system/radiusd.service |
| 168 | |
| 169 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 170 | install -m 0644 ${WORKDIR}/radiusd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/radiusd.conf |
| 171 | fi |
| 172 | } |
| 173 | |
| 174 | # This is only needed when we install/update on a running target. |
| 175 | # |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 176 | pkg_postinst:${PN} () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 177 | if [ -z "$D" ]; then |
| 178 | if command -v systemd-tmpfiles >/dev/null; then |
| 179 | # create /var/log/radius, /var/run/radiusd |
| 180 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/radiusd.conf |
| 181 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 182 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 183 | fi |
| 184 | |
| 185 | # Fix ownership for /etc/raddb/*, /var/lib/radiusd |
| 186 | chown -R radiusd:radiusd ${sysconfdir}/raddb |
| 187 | chown -R radiusd:radiusd ${localstatedir}/lib/radiusd |
| 188 | fi |
| 189 | } |
| 190 | |
| 191 | # We really need the symlink :( |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 192 | INSANE_SKIP:${PN} = "dev-so" |
| 193 | INSANE_SKIP:${PN}-krb5 = "dev-so" |
| 194 | INSANE_SKIP:${PN}-ldap = "dev-so" |
| 195 | INSANE_SKIP:${PN}-mysql = "dev-so" |
| 196 | INSANE_SKIP:${PN}-perl = "dev-so" |
| 197 | INSANE_SKIP:${PN}-postgresql = "dev-so" |
| 198 | INSANE_SKIP:${PN}-python = "dev-so" |
| 199 | INSANE_SKIP:${PN}-unixodbc = "dev-so" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 200 | |
| 201 | PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \ |
| 202 | ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc" |
| 203 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 204 | FILES:${PN}-utils = "${bindir}/*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 205 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 206 | FILES:${PN}-ldap = "${libdir}/rlm_ldap.so* \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 207 | ${sysconfdir}/raddb/mods-available/ldap \ |
| 208 | " |
| 209 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 210 | FILES:${PN}-krb5 = "${libdir}/rlm_krb5.so* \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 211 | ${sysconfdir}/raddb/mods-available/krb5 \ |
| 212 | " |
| 213 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 214 | FILES:${PN}-perl = "${libdir}/rlm_perl.so* \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 215 | ${sysconfdir}/raddb/mods-config/perl \ |
| 216 | ${sysconfdir}/raddb/mods-available/perl \ |
| 217 | " |
| 218 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 219 | FILES:${PN}-python = "${libdir}/rlm_python3.so* \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 220 | ${sysconfdir}/raddb/mods-config/python3 \ |
| 221 | ${sysconfdir}/raddb/mods-available/python3 \ |
| 222 | " |
| 223 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 224 | FILES:${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 225 | ${sysconfdir}/raddb/mods-config/sql/*/mysql \ |
| 226 | ${sysconfdir}/raddb/mods-available/sql \ |
| 227 | " |
| 228 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 229 | FILES:${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 230 | ${sysconfdir}/raddb/mods-config/sql/*/postgresql \ |
| 231 | " |
| 232 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 233 | FILES:${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 234 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 235 | FILES:${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 236 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 237 | RDEPENDS:${PN} += "perl" |
| 238 | RDEPENDS:${PN}-utils = "${PN} perl" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 239 | |
| 240 | CLEANBROKEN = "1" |