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