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