diff options
Diffstat (limited to 'meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb')
-rw-r--r-- | meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb | 223 |
1 files changed, 223 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb b/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb new file mode 100644 index 000000000..0d39c15f5 --- /dev/null +++ b/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.13.bb | |||
@@ -0,0 +1,223 @@ | |||
1 | DESCRIPTION = "FreeRADIUS is an Internet authentication daemon, which implements the RADIUS \ | ||
2 | protocol, as defined in RFC 2865 (and others). It allows Network Access \ | ||
3 | Servers (NAS boxes) to perform authentication for dial-up users. There are \ | ||
4 | also RADIUS clients available for Web servers, firewalls, Unix logins, and \ | ||
5 | more. Using RADIUS allows authentication and authorization for a network to \ | ||
6 | be centralized, and minimizes the amount of re-configuration which has to be \ | ||
7 | done when adding or deleting new users." | ||
8 | |||
9 | SUMMARY = "High-performance and highly configurable RADIUS server" | ||
10 | HOMEPAGE = "http://www.freeradius.org/" | ||
11 | SECTION = "System/Servers" | ||
12 | LICENSE = "GPLv2 & LGPLv2+" | ||
13 | DEPENDS = "openssl-native openssl libtool libpcap libtalloc" | ||
14 | |||
15 | SRC_URI = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${PV}.tar.bz2 \ | ||
16 | file://freeradius \ | ||
17 | file://volatiles.58_radiusd \ | ||
18 | file://freeradius-enble-user-in-conf.patch \ | ||
19 | file://freeradius-configure.ac-allow-cross-compilation.patch \ | ||
20 | file://freeradius-fix-issues-related-to-m4-include-path.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://radiusd.service \ | ||
29 | file://radiusd-volatiles.conf \ | ||
30 | " | ||
31 | |||
32 | LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a" | ||
33 | SRC_URI[md5sum] = "7f99df26a6ac71b1f7cce5c213e52790" | ||
34 | SRC_URI[sha256sum] = "b3be0d8849878c31af0a5375d20b7b20c9d1c1572e89dc3f22992824cefffb84" | ||
35 | |||
36 | PARALLEL_MAKE = "" | ||
37 | |||
38 | S = "${WORKDIR}/freeradius-server-${PV}" | ||
39 | |||
40 | EXTRA_OECONF = " --enable-strict-dependencies \ | ||
41 | --with-docdir=${docdir}/freeradius-${PV} \ | ||
42 | --with-openssl-includes=${STAGING_INCDIR} \ | ||
43 | --with-openssl-libraries=${STAGING_LIBDIR} \ | ||
44 | --without-rlm_ippool \ | ||
45 | --without-rlm_cache_memcached \ | ||
46 | --without-rlm_counter \ | ||
47 | --without-rlm_couchbase \ | ||
48 | --without-rlm_dbm \ | ||
49 | --without-rlm_eap_tnc \ | ||
50 | --without-rlm_eap_ikev2 \ | ||
51 | --without-rlm_opendirectory \ | ||
52 | --without-rlm_redis \ | ||
53 | --without-rlm_rediswho \ | ||
54 | --without-rlm_sql_db2 \ | ||
55 | --without-rlm_sql_firebird \ | ||
56 | --without-rlm_sql_freetds \ | ||
57 | --without-rlm_sql_iodbc \ | ||
58 | --without-rlm_sql_oracle \ | ||
59 | --without-rlm_sql_sybase \ | ||
60 | --without-rlm_sqlhpwippool \ | ||
61 | --without-dhcp \ | ||
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 | |||
69 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
70 | pcre libcap \ | ||
71 | " | ||
72 | |||
73 | PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5" | ||
74 | PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam" | ||
75 | PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap" | ||
76 | PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap" | ||
77 | PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5" | ||
78 | PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3" | ||
79 | PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc" | ||
80 | PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql" | ||
81 | PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre" | ||
82 | PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl" | ||
83 | PACKAGECONFIG[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" | ||
84 | PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest,curl json-c" | ||
85 | PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby" | ||
86 | |||
87 | inherit useradd autotools-brokensep update-rc.d systemd | ||
88 | |||
89 | # This is not a cpan or python based package, but it needs some definitions | ||
90 | # from cpan-base and python-dir bbclasses for building rlm_perl and rlm_python | ||
91 | # correctly. | ||
92 | inherit cpan-base python-dir | ||
93 | |||
94 | # The modules subdirs also need to be processed by autoreconf. Use autogen.sh | ||
95 | # in order to handle the subdirs correctly. | ||
96 | do_configure () { | ||
97 | ./autogen.sh | ||
98 | |||
99 | # the configure of rlm_perl needs this to get correct | ||
100 | # mod_cflags and mod_ldflags | ||
101 | if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then | ||
102 | export PERL5LIB="${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" | ||
103 | fi | ||
104 | |||
105 | oe_runconf | ||
106 | |||
107 | # we don't need dhcpclient | ||
108 | sed -i -e 's/dhcpclient.mk//' ${S}/src/modules/proto_dhcp/all.mk | ||
109 | } | ||
110 | |||
111 | INITSCRIPT_NAME = "radiusd" | ||
112 | |||
113 | SYSTEMD_SERVICE_${PN} = "radiusd.service" | ||
114 | |||
115 | USERADD_PACKAGES = "${PN}" | ||
116 | USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd" | ||
117 | |||
118 | do_install() { | ||
119 | rm -rf ${D} | ||
120 | mkdir -p ${D}/${sysconfdir}/logrotate.d | ||
121 | mkdir -p ${D}/${sysconfdir}/pam.d | ||
122 | mkdir -p ${D}/${sysconfdir}/init.d | ||
123 | mkdir -p ${D}/${localstatedir}/lib/radiusd | ||
124 | mkdir -p ${D}${sysconfdir}/default/volatiles | ||
125 | |||
126 | export LD_LIBRARY_PATH=${D}/${libdir} | ||
127 | oe_runmake install R=${D} INSTALLSTRIP="" | ||
128 | |||
129 | # remove unsupported config files | ||
130 | rm -f ${D}/${sysconfdir}/raddb/experimental.conf | ||
131 | |||
132 | # remove scripts that required Perl(DBI) | ||
133 | rm -rf ${D}/${bindir}/radsqlrelay | ||
134 | |||
135 | cp -f ${WORKDIR}/freeradius ${D}/etc/init.d/radiusd | ||
136 | rm -f ${D}/${sbindir}/rc.radiusd | ||
137 | chmod +x ${D}/${sysconfdir}/init.d/radiusd | ||
138 | rm -rf ${D}/${localstatedir}/run/ | ||
139 | install -m 0644 ${WORKDIR}/volatiles.58_radiusd ${D}${sysconfdir}/default/volatiles/58_radiusd | ||
140 | |||
141 | chown -R radiusd:radiusd ${D}/${sysconfdir}/raddb/ | ||
142 | chown -R radiusd:radiusd ${D}/${localstatedir}/lib/radiusd | ||
143 | |||
144 | # For systemd | ||
145 | install -d ${D}${systemd_unitdir}/system | ||
146 | install -m 0644 ${WORKDIR}/radiusd.service ${D}${systemd_unitdir}/system | ||
147 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
148 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
149 | -e 's,@STATEDIR@,${localstatedir},g' \ | ||
150 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
151 | ${D}${systemd_unitdir}/system/radiusd.service | ||
152 | |||
153 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
154 | install -d ${D}${sysconfdir}/tmpfiles.d/ | ||
155 | install -m 0644 ${WORKDIR}/radiusd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
156 | fi | ||
157 | } | ||
158 | |||
159 | # This is only needed when we install/update on a running target. | ||
160 | # | ||
161 | pkg_postinst_${PN} () { | ||
162 | if [ -z "$D" ]; then | ||
163 | if command -v systemd-tmpfiles >/dev/null; then | ||
164 | # create /var/log/radius, /var/run/radiusd | ||
165 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/radiusd-volatiles.conf | ||
166 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
167 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
168 | fi | ||
169 | |||
170 | # Fix ownership for /etc/raddb/*, /var/lib/radiusd | ||
171 | chown -R radiusd:radiusd ${sysconfdir}/raddb | ||
172 | chown -R radiusd:radiusd ${localstatedir}/lib/radiusd | ||
173 | fi | ||
174 | } | ||
175 | |||
176 | # We really need the symlink :( | ||
177 | INSANE_SKIP_${PN} = "dev-so" | ||
178 | INSANE_SKIP_${PN}-krb5 = "dev-so" | ||
179 | INSANE_SKIP_${PN}-ldap = "dev-so" | ||
180 | INSANE_SKIP_${PN}-mysql = "dev-so" | ||
181 | INSANE_SKIP_${PN}-perl = "dev-so" | ||
182 | INSANE_SKIP_${PN}-postgresql = "dev-so" | ||
183 | INSANE_SKIP_${PN}-python = "dev-so" | ||
184 | INSANE_SKIP_${PN}-unixodbc = "dev-so" | ||
185 | |||
186 | PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \ | ||
187 | ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc" | ||
188 | |||
189 | FILES_${PN}-utils = "${bindir}/*" | ||
190 | |||
191 | FILES_${PN}-ldap = "${libdir}/rlm_ldap.so* \ | ||
192 | ${sysconfdir}/raddb/mods-available/ldap \ | ||
193 | " | ||
194 | |||
195 | FILES_${PN}-krb5 = "${libdir}/rlm_krb5.so* \ | ||
196 | ${sysconfdir}/raddb/mods-available/krb5 \ | ||
197 | " | ||
198 | |||
199 | FILES_${PN}-perl = "${libdir}/rlm_perl.so* \ | ||
200 | ${sysconfdir}/raddb/mods-config/perl \ | ||
201 | ${sysconfdir}/raddb/mods-available/perl \ | ||
202 | " | ||
203 | |||
204 | FILES_${PN}-python = "${libdir}/rlm_python.so* \ | ||
205 | ${sysconfdir}/raddb/mods-config/python \ | ||
206 | ${sysconfdir}/raddb/mods-available/python \ | ||
207 | " | ||
208 | |||
209 | FILES_${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \ | ||
210 | ${sysconfdir}/raddb/mods-config/sql/*/mysql \ | ||
211 | ${sysconfdir}/raddb/mods-available/sql \ | ||
212 | " | ||
213 | |||
214 | FILES_${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \ | ||
215 | ${sysconfdir}/raddb/mods-config/sql/*/postgresql \ | ||
216 | " | ||
217 | |||
218 | FILES_${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*" | ||
219 | |||
220 | FILES_${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*" | ||
221 | |||
222 | RDEPENDS_${PN} += "perl" | ||
223 | RDEPENDS_${PN}-utils = "${PN}" | ||