blob: 31e6978d6f0ace8e19f207ae65e4059c54edfcb0 [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 \
Brad Bishop6a62e0e2019-10-21 08:11:42 -040029 file://0001-su-to-radiusd-user-group-when-rotating-logs.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080030 file://radiusd.service \
31 file://radiusd-volatiles.conf \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032"
Brad Bishopc1d34332019-09-09 14:56:00 -040033
34SRCREV = "ab4c767099f263a7cd4109bcdca80ee74210a769"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035
36PARALLEL_MAKE = ""
37
Brad Bishopc1d34332019-09-09 14:56:00 -040038S = "${WORKDIR}/git"
39
40LDFLAGS_append_powerpc = " -latomic"
41LDFLAGS_append_mipsarch = " -latomic"
Brad Bishop63ae8782019-10-09 09:56:13 -040042LDFLAGS_append_armv5 = " -latomic"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080043
44EXTRA_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 Bishopc1d34332019-09-09 14:56:00 -040065 --without-rlm_securid \
66 --without-rlm_unbound \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080067 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
74PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
75 pcre libcap \
Brad Bishop19323692019-04-05 15:28:33 -040076 openssl rlm-eap-fast rlm-eap-pwd \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080077"
78
79PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5"
80PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam"
81PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
82PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap"
83PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5"
84PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3"
85PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc"
86PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql"
87PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre"
88PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl"
89PACKAGECONFIG[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"
90PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest,curl json-c"
91PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby"
Brad Bishop19323692019-04-05 15:28:33 -040092PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl"
93PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast"
94PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080095
96inherit 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.
101inherit 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.
105do_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
120INITSCRIPT_NAME = "radiusd"
121
122SYSTEMD_SERVICE_${PN} = "radiusd.service"
123
124USERADD_PACKAGES = "${PN}"
125USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd"
126
127do_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#
170pkg_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 :(
186INSANE_SKIP_${PN} = "dev-so"
187INSANE_SKIP_${PN}-krb5 = "dev-so"
188INSANE_SKIP_${PN}-ldap = "dev-so"
189INSANE_SKIP_${PN}-mysql = "dev-so"
190INSANE_SKIP_${PN}-perl = "dev-so"
191INSANE_SKIP_${PN}-postgresql = "dev-so"
192INSANE_SKIP_${PN}-python = "dev-so"
193INSANE_SKIP_${PN}-unixodbc = "dev-so"
194
195PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \
196 ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc"
197
198FILES_${PN}-utils = "${bindir}/*"
199
200FILES_${PN}-ldap = "${libdir}/rlm_ldap.so* \
201 ${sysconfdir}/raddb/mods-available/ldap \
202"
203
204FILES_${PN}-krb5 = "${libdir}/rlm_krb5.so* \
205 ${sysconfdir}/raddb/mods-available/krb5 \
206"
207
208FILES_${PN}-perl = "${libdir}/rlm_perl.so* \
209 ${sysconfdir}/raddb/mods-config/perl \
210 ${sysconfdir}/raddb/mods-available/perl \
211"
212
213FILES_${PN}-python = "${libdir}/rlm_python.so* \
214 ${sysconfdir}/raddb/mods-config/python \
215 ${sysconfdir}/raddb/mods-available/python \
216"
217
218FILES_${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \
219 ${sysconfdir}/raddb/mods-config/sql/*/mysql \
220 ${sysconfdir}/raddb/mods-available/sql \
221"
222
223FILES_${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \
224 ${sysconfdir}/raddb/mods-config/sql/*/postgresql \
225"
226
227FILES_${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*"
228
229FILES_${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*"
230
231RDEPENDS_${PN} += "perl"
Brad Bishop90ca7472019-08-20 09:15:15 -0400232RDEPENDS_${PN}-utils = "${PN} perl"
Brad Bishop868407c2019-11-04 13:24:47 -0500233
234CLEANBROKEN = "1"