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