Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [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 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 16 | SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.0.x; \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [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 \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 \ |
Brad Bishop | 6a62e0e | 2019-10-21 08:11:42 -0400 | [diff] [blame] | 29 | file://0001-su-to-radiusd-user-group-when-rotating-logs.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 30 | file://radiusd.service \ |
| 31 | file://radiusd-volatiles.conf \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | " |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 33 | |
| 34 | SRCREV = "ab4c767099f263a7cd4109bcdca80ee74210a769" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | |
| 36 | PARALLEL_MAKE = "" |
| 37 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 38 | S = "${WORKDIR}/git" |
| 39 | |
| 40 | LDFLAGS_append_powerpc = " -latomic" |
| 41 | LDFLAGS_append_mipsarch = " -latomic" |
Brad Bishop | 63ae878 | 2019-10-09 09:56:13 -0400 | [diff] [blame] | 42 | LDFLAGS_append_armv5 = " -latomic" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 43 | |
| 44 | EXTRA_OECONF = " --enable-strict-dependencies \ |
| 45 | --with-docdir=${docdir}/freeradius-${PV} \ |
| 46 | --with-openssl-includes=${STAGING_INCDIR} \ |
| 47 | --with-openssl-libraries=${STAGING_LIBDIR} \ |
| 48 | --without-rlm_ippool \ |
| 49 | --without-rlm_cache_memcached \ |
| 50 | --without-rlm_counter \ |
| 51 | --without-rlm_couchbase \ |
| 52 | --without-rlm_dbm \ |
| 53 | --without-rlm_eap_tnc \ |
| 54 | --without-rlm_eap_ikev2 \ |
| 55 | --without-rlm_opendirectory \ |
| 56 | --without-rlm_redis \ |
| 57 | --without-rlm_rediswho \ |
| 58 | --without-rlm_sql_db2 \ |
| 59 | --without-rlm_sql_firebird \ |
| 60 | --without-rlm_sql_freetds \ |
| 61 | --without-rlm_sql_iodbc \ |
| 62 | --without-rlm_sql_oracle \ |
| 63 | --without-rlm_sql_sybase \ |
| 64 | --without-rlm_sqlhpwippool \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 65 | --without-rlm_securid \ |
| 66 | --without-rlm_unbound \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 67 | ac_cv_path_PERL=${bindir}/perl \ |
| 68 | ax_cv_cc_builtin_choose_expr=no \ |
| 69 | ax_cv_cc_builtin_types_compatible_p=no \ |
| 70 | ax_cv_cc_builtin_bswap64=no \ |
| 71 | ax_cv_cc_bounded_attribute=no \ |
| 72 | " |
| 73 | |
| 74 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ |
| 75 | pcre libcap \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 76 | openssl rlm-eap-fast rlm-eap-pwd \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 77 | " |
| 78 | |
| 79 | PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5" |
| 80 | PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam" |
| 81 | PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap" |
| 82 | PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap" |
| 83 | PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5" |
| 84 | PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3" |
| 85 | PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc" |
| 86 | PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql" |
| 87 | PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre" |
| 88 | PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl" |
| 89 | PACKAGECONFIG[python] = "--with-rlm_python --with-rlm-python-bin=${STAGING_BINDIR_NATIVE}/python-native/python --with-rlm-python-include-dir=${STAGING_INCDIR}/${PYTHON_DIR},--without-rlm_python,python-native python" |
| 90 | PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest,curl json-c" |
| 91 | PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 92 | PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl" |
| 93 | PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast" |
| 94 | PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 95 | |
| 96 | inherit useradd autotools-brokensep update-rc.d systemd |
| 97 | |
| 98 | # This is not a cpan or python based package, but it needs some definitions |
| 99 | # from cpan-base and python-dir bbclasses for building rlm_perl and rlm_python |
| 100 | # correctly. |
| 101 | inherit cpan-base python-dir |
| 102 | |
| 103 | # The modules subdirs also need to be processed by autoreconf. Use autogen.sh |
| 104 | # in order to handle the subdirs correctly. |
| 105 | do_configure () { |
| 106 | ./autogen.sh |
| 107 | |
| 108 | # the configure of rlm_perl needs this to get correct |
| 109 | # mod_cflags and mod_ldflags |
| 110 | if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then |
| 111 | export PERL5LIB="${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" |
| 112 | fi |
| 113 | |
| 114 | oe_runconf |
| 115 | |
| 116 | # we don't need dhcpclient |
| 117 | sed -i -e 's/dhcpclient.mk//' ${S}/src/modules/proto_dhcp/all.mk |
| 118 | } |
| 119 | |
| 120 | INITSCRIPT_NAME = "radiusd" |
| 121 | |
| 122 | SYSTEMD_SERVICE_${PN} = "radiusd.service" |
| 123 | |
| 124 | USERADD_PACKAGES = "${PN}" |
| 125 | USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd" |
| 126 | |
| 127 | do_install() { |
| 128 | rm -rf ${D} |
| 129 | mkdir -p ${D}/${sysconfdir}/logrotate.d |
| 130 | mkdir -p ${D}/${sysconfdir}/pam.d |
| 131 | mkdir -p ${D}/${sysconfdir}/init.d |
| 132 | mkdir -p ${D}/${localstatedir}/lib/radiusd |
| 133 | mkdir -p ${D}${sysconfdir}/default/volatiles |
| 134 | |
| 135 | export LD_LIBRARY_PATH=${D}/${libdir} |
| 136 | oe_runmake install R=${D} INSTALLSTRIP="" |
| 137 | |
| 138 | # remove unsupported config files |
| 139 | rm -f ${D}/${sysconfdir}/raddb/experimental.conf |
| 140 | |
| 141 | # remove scripts that required Perl(DBI) |
| 142 | rm -rf ${D}/${bindir}/radsqlrelay |
| 143 | |
| 144 | cp -f ${WORKDIR}/freeradius ${D}/etc/init.d/radiusd |
| 145 | rm -f ${D}/${sbindir}/rc.radiusd |
| 146 | chmod +x ${D}/${sysconfdir}/init.d/radiusd |
| 147 | rm -rf ${D}/${localstatedir}/run/ |
| 148 | install -m 0644 ${WORKDIR}/volatiles.58_radiusd ${D}${sysconfdir}/default/volatiles/58_radiusd |
| 149 | |
| 150 | chown -R radiusd:radiusd ${D}/${sysconfdir}/raddb/ |
| 151 | chown -R radiusd:radiusd ${D}/${localstatedir}/lib/radiusd |
| 152 | |
| 153 | # For systemd |
| 154 | install -d ${D}${systemd_unitdir}/system |
| 155 | install -m 0644 ${WORKDIR}/radiusd.service ${D}${systemd_unitdir}/system |
| 156 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 157 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 158 | -e 's,@STATEDIR@,${localstatedir},g' \ |
| 159 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 160 | ${D}${systemd_unitdir}/system/radiusd.service |
| 161 | |
| 162 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 163 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 164 | install -m 0644 ${WORKDIR}/radiusd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 165 | fi |
| 166 | } |
| 167 | |
| 168 | # This is only needed when we install/update on a running target. |
| 169 | # |
| 170 | pkg_postinst_${PN} () { |
| 171 | if [ -z "$D" ]; then |
| 172 | if command -v systemd-tmpfiles >/dev/null; then |
| 173 | # create /var/log/radius, /var/run/radiusd |
| 174 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/radiusd-volatiles.conf |
| 175 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 176 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 177 | fi |
| 178 | |
| 179 | # Fix ownership for /etc/raddb/*, /var/lib/radiusd |
| 180 | chown -R radiusd:radiusd ${sysconfdir}/raddb |
| 181 | chown -R radiusd:radiusd ${localstatedir}/lib/radiusd |
| 182 | fi |
| 183 | } |
| 184 | |
| 185 | # We really need the symlink :( |
| 186 | INSANE_SKIP_${PN} = "dev-so" |
| 187 | INSANE_SKIP_${PN}-krb5 = "dev-so" |
| 188 | INSANE_SKIP_${PN}-ldap = "dev-so" |
| 189 | INSANE_SKIP_${PN}-mysql = "dev-so" |
| 190 | INSANE_SKIP_${PN}-perl = "dev-so" |
| 191 | INSANE_SKIP_${PN}-postgresql = "dev-so" |
| 192 | INSANE_SKIP_${PN}-python = "dev-so" |
| 193 | INSANE_SKIP_${PN}-unixodbc = "dev-so" |
| 194 | |
| 195 | PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \ |
| 196 | ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc" |
| 197 | |
| 198 | FILES_${PN}-utils = "${bindir}/*" |
| 199 | |
| 200 | FILES_${PN}-ldap = "${libdir}/rlm_ldap.so* \ |
| 201 | ${sysconfdir}/raddb/mods-available/ldap \ |
| 202 | " |
| 203 | |
| 204 | FILES_${PN}-krb5 = "${libdir}/rlm_krb5.so* \ |
| 205 | ${sysconfdir}/raddb/mods-available/krb5 \ |
| 206 | " |
| 207 | |
| 208 | FILES_${PN}-perl = "${libdir}/rlm_perl.so* \ |
| 209 | ${sysconfdir}/raddb/mods-config/perl \ |
| 210 | ${sysconfdir}/raddb/mods-available/perl \ |
| 211 | " |
| 212 | |
| 213 | FILES_${PN}-python = "${libdir}/rlm_python.so* \ |
| 214 | ${sysconfdir}/raddb/mods-config/python \ |
| 215 | ${sysconfdir}/raddb/mods-available/python \ |
| 216 | " |
| 217 | |
| 218 | FILES_${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \ |
| 219 | ${sysconfdir}/raddb/mods-config/sql/*/mysql \ |
| 220 | ${sysconfdir}/raddb/mods-available/sql \ |
| 221 | " |
| 222 | |
| 223 | FILES_${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \ |
| 224 | ${sysconfdir}/raddb/mods-config/sql/*/postgresql \ |
| 225 | " |
| 226 | |
| 227 | FILES_${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*" |
| 228 | |
| 229 | FILES_${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*" |
| 230 | |
| 231 | RDEPENDS_${PN} += "perl" |
Brad Bishop | 90ca747 | 2019-08-20 09:15:15 -0400 | [diff] [blame] | 232 | RDEPENDS_${PN}-utils = "${PN} perl" |
Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame^] | 233 | |
| 234 | CLEANBROKEN = "1" |