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