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