blob: ded1a67fff011e35324ed759e2f2742efabd6a1d [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001DESCRIPTION = "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 = "GPLv2 & LGPLv2+"
13LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
14DEPENDS = "openssl-native openssl libidn libtool libpcap libtalloc"
15
Brad Bishopc1d34332019-09-09 14:56:00 -040016SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.0.x; \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017 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 Bishop1a4b7ee2018-12-16 17:11:34 -080021 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 Bishop1a4b7ee2018-12-16 17:11:34 -080031"
Brad Bishopc1d34332019-09-09 14:56:00 -040032
33SRCREV = "ab4c767099f263a7cd4109bcdca80ee74210a769"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034
35PARALLEL_MAKE = ""
36
Brad Bishopc1d34332019-09-09 14:56:00 -040037S = "${WORKDIR}/git"
38
39LDFLAGS_append_powerpc = " -latomic"
40LDFLAGS_append_mipsarch = " -latomic"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041
42EXTRA_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 Bishopc1d34332019-09-09 14:56:00 -040063 --without-rlm_securid \
64 --without-rlm_unbound \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080065 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
72PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
73 pcre libcap \
Brad Bishop19323692019-04-05 15:28:33 -040074 openssl rlm-eap-fast rlm-eap-pwd \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080075"
76
77PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5"
78PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam"
79PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
80PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap"
81PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5"
82PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3"
83PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc"
84PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql"
85PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre"
86PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl"
87PACKAGECONFIG[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"
88PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest,curl json-c"
89PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby"
Brad Bishop19323692019-04-05 15:28:33 -040090PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl"
91PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast"
92PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080093
94inherit 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.
99inherit 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.
103do_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
118INITSCRIPT_NAME = "radiusd"
119
120SYSTEMD_SERVICE_${PN} = "radiusd.service"
121
122USERADD_PACKAGES = "${PN}"
123USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd"
124
125do_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#
168pkg_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 :(
184INSANE_SKIP_${PN} = "dev-so"
185INSANE_SKIP_${PN}-krb5 = "dev-so"
186INSANE_SKIP_${PN}-ldap = "dev-so"
187INSANE_SKIP_${PN}-mysql = "dev-so"
188INSANE_SKIP_${PN}-perl = "dev-so"
189INSANE_SKIP_${PN}-postgresql = "dev-so"
190INSANE_SKIP_${PN}-python = "dev-so"
191INSANE_SKIP_${PN}-unixodbc = "dev-so"
192
193PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \
194 ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc"
195
196FILES_${PN}-utils = "${bindir}/*"
197
198FILES_${PN}-ldap = "${libdir}/rlm_ldap.so* \
199 ${sysconfdir}/raddb/mods-available/ldap \
200"
201
202FILES_${PN}-krb5 = "${libdir}/rlm_krb5.so* \
203 ${sysconfdir}/raddb/mods-available/krb5 \
204"
205
206FILES_${PN}-perl = "${libdir}/rlm_perl.so* \
207 ${sysconfdir}/raddb/mods-config/perl \
208 ${sysconfdir}/raddb/mods-available/perl \
209"
210
211FILES_${PN}-python = "${libdir}/rlm_python.so* \
212 ${sysconfdir}/raddb/mods-config/python \
213 ${sysconfdir}/raddb/mods-available/python \
214"
215
216FILES_${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \
217 ${sysconfdir}/raddb/mods-config/sql/*/mysql \
218 ${sysconfdir}/raddb/mods-available/sql \
219"
220
221FILES_${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \
222 ${sysconfdir}/raddb/mods-config/sql/*/postgresql \
223"
224
225FILES_${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*"
226
227FILES_${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*"
228
229RDEPENDS_${PN} += "perl"
Brad Bishop90ca7472019-08-20 09:15:15 -0400230RDEPENDS_${PN}-utils = "${PN} perl"