Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dialup/freeradius/
Date: Mon, 27 Feb 2023 09:03:58
Message-Id: 1677488631.a624ea84bec7bafb42e92db83f493ddf96c35324.juippis@gentoo
1 commit: a624ea84bec7bafb42e92db83f493ddf96c35324
2 Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 27 09:03:34 2023 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 27 09:03:51 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a624ea84
7
8 net-dialup/freeradius: add 3.2.2
9
10 Bug: https://bugs.gentoo.org/891265
11 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
12
13 net-dialup/freeradius/Manifest | 1 +
14 net-dialup/freeradius/freeradius-3.2.2.ebuild | 309 ++++++++++++++++++++++++++
15 2 files changed, 310 insertions(+)
16
17 diff --git a/net-dialup/freeradius/Manifest b/net-dialup/freeradius/Manifest
18 index 43e60f45684a..ef9b716256c7 100644
19 --- a/net-dialup/freeradius/Manifest
20 +++ b/net-dialup/freeradius/Manifest
21 @@ -2,3 +2,4 @@ DIST freeradius-3.0.25.tar.gz 5300245 BLAKE2B bf8908aa7bfabb9e15fa841457f176a4f2
22 DIST freeradius-3.0.26.tar.gz 5300930 BLAKE2B e8922182f69ff201af331a03ef109072d24fb169c14179c5e71910ed3f767526afd7efe6000fd8a3881fa2ddb0487ebd12f8fdf6845136fdc15fdcb8a83fdf39 SHA512 83825ce1dd3d2e005c11d10ebadd2b37884130c158d3ea43595fa52478e3d194725b15dc73633758b0b1e916e00ea9358d254c38c2b721c475c9a4235aa1a5a3
23 DIST freeradius-server-3.2.0.tar.bz2 3399380 BLAKE2B 103cb1faf7efd78520dd613da51671ff37b870fcd356d7d11454d655cf460bcb4132cd91b99be70557242907dd5e4d741b6a776de81c37a24ab9d04a4fe5866b SHA512 e7aa7bfc5a6968cdb860bb565ebd45bc1b3f78a665a9888a8b8dacaa1c5256755468aed33bdffe39465f8678c1fb9d6f47f0dbcf0178dfdcb38d99e3bc4b747d
24 DIST freeradius-server-3.2.1.tar.bz2 3399164 BLAKE2B d0e69d468736d2a5dd85b32bb8b1fa44f2e56725ae525a3895df1b926f5ce525c70af08c2b76b62a9479d00d02c3e4915586fb1e5c7d42955c6b9e5cdeda8f6e SHA512 0f9e98cbf0eff4c5af54731ec34a8c9070252eaf2f91ca0c87caae939f6356fa91a6e1ed98ba66dbf1c1bafecdfcf38603fb4f65a5955e88974f49a5b7885f7a
25 +DIST freeradius-server-3.2.2.tar.bz2 3418998 BLAKE2B 584d1ff79cf3a75c79f5b24f9e47d7c8d8caee0d706eb47bb387300172f0699f904804d963aab8c252a21fe67f7885a47659b8cd9db5292a6d4db087d72e8e38 SHA512 91dc574560a1f75cafa8bc78c0676f0e3dae7154ecbb395e0e1f6738f78d8bcfe1bff122364452798fd0434c4056fd946799b8f29a1141398bf0542a37870689
26
27 diff --git a/net-dialup/freeradius/freeradius-3.2.2.ebuild b/net-dialup/freeradius/freeradius-3.2.2.ebuild
28 new file mode 100644
29 index 000000000000..3861bc2421d5
30 --- /dev/null
31 +++ b/net-dialup/freeradius/freeradius-3.2.2.ebuild
32 @@ -0,0 +1,309 @@
33 +# Copyright 1999-2023 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +PYTHON_COMPAT=( python3_{9..11} )
39 +AUTOTOOLS_DEPEND=">=sys-devel/autoconf-2.69"
40 +inherit autotools pam python-single-r1 systemd
41 +
42 +MY_PN=${PN}-server
43 +MY_P=${MY_PN}-${PV}
44 +MY_PV=$(ver_rs 1- "_")
45 +
46 +DESCRIPTION="Highly configurable free RADIUS server"
47 +HOMEPAGE="https://freeradius.org/"
48 +SRC_URI="https://github.com/FreeRADIUS/freeradius-server/releases/download/release_${MY_PV}/${MY_P}.tar.bz2"
49 +S="${WORKDIR}"/${MY_P}
50 +
51 +LICENSE="GPL-2"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
54 +
55 +IUSE="
56 + debug firebird iodbc kerberos ldap memcached mysql mongodb odbc oracle pam
57 + postgres python readline redis samba sqlite ssl systemd
58 +"
59 +
60 +RESTRICT="firebird? ( bindist )"
61 +
62 +# NOTE: Temporary freeradius doesn't support linking with mariadb client
63 +# libs also if code is compliant, will be available in the next release.
64 +# (http://lists.freeradius.org/pipermail/freeradius-devel/2018-October/013228.html)a
65 +
66 +# TODO: rlm_mschap works with both samba library or without. I need to avoid
67 +# linking of samba library if -samba is used.
68 +
69 +# TODO: unconditional json-c for now as automagic dep despite efforts to stop it
70 +# ditto libpcap. Can restore USE=rest, USE=pcap if/when fixed.
71 +
72 +RDEPEND="acct-group/radius
73 + acct-user/radius
74 + !net-dialup/cistronradius
75 + dev-libs/libltdl
76 + dev-libs/libpcre
77 + dev-libs/json-c:=
78 + dev-lang/perl:=
79 + net-libs/libpcap
80 + net-misc/curl
81 + sys-libs/gdbm:=
82 + sys-libs/libcap
83 + sys-libs/talloc
84 + virtual/libcrypt:=
85 + firebird? ( dev-db/firebird )
86 + iodbc? ( dev-db/libiodbc )
87 + kerberos? ( virtual/krb5 )
88 + ldap? ( net-nds/openldap:= )
89 + memcached? ( dev-libs/libmemcached )
90 + mysql? ( dev-db/mysql-connector-c:= )
91 + mongodb? ( >=dev-libs/mongo-c-driver-1.13.0-r1 )
92 + odbc? ( dev-db/unixODBC )
93 + oracle? ( dev-db/oracle-instantclient[sdk] )
94 + pam? ( sys-libs/pam )
95 + postgres? ( dev-db/postgresql:= )
96 + python? ( ${PYTHON_DEPS} )
97 + readline? ( sys-libs/readline:= )
98 + redis? ( dev-libs/hiredis:= )
99 + samba? ( net-fs/samba )
100 + sqlite? ( dev-db/sqlite:3 )
101 + ssl? ( >=dev-libs/openssl-1.0.2:=[-bindist(-)] )
102 + systemd? ( sys-apps/systemd:= )"
103 +DEPEND="${RDEPEND}"
104 +
105 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
106 +
107 +# bug #721040
108 +QA_SONAME="usr/lib.*/libfreeradius-.*.so"
109 +
110 +PATCHES=(
111 + "${FILESDIR}"/${PN}-3.0.20-systemd-service.patch
112 +)
113 +
114 +pkg_setup() {
115 + if use python ; then
116 + python-single-r1_pkg_setup
117 + export PYTHONBIN="${EPYTHON}"
118 + fi
119 +}
120 +
121 +src_prepare() {
122 + default
123 +
124 + # Most of the configuration options do not appear as ./configure
125 + # switches. Instead it identifies the directories that are available
126 + # and run through them. These might check for the presence of
127 + # various libraries, in which case they are not built. To avoid
128 + # automagic dependencies, we just remove all the modules that we're
129 + # not interested in using.
130 + # TODO: shift more of these into configure args below as things
131 + # are a bit better now.
132 + use ssl || { rm -r src/modules/rlm_eap/types/rlm_eap_{tls,ttls,peap} || die ; }
133 + use ldap || { rm -r src/modules/rlm_ldap || die ; }
134 + use kerberos || { rm -r src/modules/rlm_krb5 || die ; }
135 + use memcached || { rm -r src/modules/rlm_cache/drivers/rlm_cache_memcached || die ; }
136 + use pam || { rm -r src/modules/rlm_pam || die ; }
137 +
138 + # Drop support for python2
139 + rm -r src/modules/rlm_python || die
140 +
141 + use python || { rm -r src/modules/rlm_python3 || die ; }
142 + #use rest || { rm -r src/modules/rlm_rest || die ; }
143 + # Do not install ruby rlm module, bug #483108
144 + rm -r src/modules/rlm_ruby || die
145 +
146 + # These are all things we don't have in portage/I don't want to deal
147 + # with myself.
148 + #
149 + # Requires TNCS library
150 + rm -r src/modules/rlm_eap/types/rlm_eap_tnc || die
151 + # Requires libeap-ikev2
152 + rm -r src/modules/rlm_eap/types/rlm_eap_ikev2 || die
153 + # Requires some membership.h
154 + rm -r src/modules/rlm_opendirectory || die
155 + # ?
156 + rm -r src/modules/rlm_sql/drivers/rlm_sql_{db2,freetds} || die
157 +
158 + # SQL drivers that are not part of experimental are loaded from a
159 + # file, so we have to remove them from the file itself when we
160 + # remove them.
161 + usesqldriver() {
162 + local flag=$1
163 + local driver=rlm_sql_${2:-${flag}}
164 +
165 + if ! use ${flag} ; then
166 + rm -r src/modules/rlm_sql/drivers/${driver} || die
167 + sed -i -e /${driver}/d src/modules/rlm_sql/stable || die
168 + fi
169 + }
170 +
171 + sed -i \
172 + -e 's:^#\tuser = :\tuser = :g' \
173 + -e 's:^#\tgroup = :\tgroup = :g' \
174 + -e 's:/var/run/radiusd:/run/radiusd:g' \
175 + -e '/^run_dir/s:${localstatedir}::g' \
176 + raddb/radiusd.conf.in || die
177 +
178 + # - Verbosity
179 + # - B uild shared libraries using jlibtool -shared
180 + sed -i \
181 + -e 's|--silent ||g' \
182 + -e 's:--mode=\(compile\|link\):& -shared:g' \
183 + scripts/libtool.mk || die
184 +
185 + # Crude measure to stop jlibtool from running ranlib and ar
186 + sed -i \
187 + -e '/LIBRARIAN/s|".*"|"true"|g' \
188 + -e '/RANLIB/s|".*"|"true"|g' \
189 + scripts/jlibtool.c || die
190 +
191 + usesqldriver mysql
192 + usesqldriver postgres postgresql
193 + usesqldriver firebird
194 + usesqldriver iodbc
195 + usesqldriver odbc unixodbc
196 + usesqldriver oracle
197 + usesqldriver sqlite
198 + usesqldriver mongodb mongo
199 +
200 + eautoreconf
201 +}
202 +
203 +src_configure() {
204 + # Do not try to enable static with static-libs; upstream is a
205 + # massacre of libtool best practices so you also have to make sure
206 + # to --enable-shared explicitly.
207 + local myeconfargs=(
208 + # Revisit confcache when not needing to use ac_cv anymore
209 + # for automagic deps.
210 + #--cache-file="${S}"/config.cache
211 +
212 + --enable-shared
213 + --disable-ltdl-install
214 + --disable-silent-rules
215 + --with-system-libtool
216 + --with-system-libltdl
217 +
218 + --enable-strict-dependencies
219 + --without-rlm_couchbase
220 + --without-rlm_securid
221 + --without-rlm_unbound
222 + --without-rlm_idn
223 + #--without-rlm_json
224 + #$(use_with rest libfreeradius-json)
225 +
226 + # Our OpenSSL should be patched. Avoid false-positive failures.
227 + --disable-openssl-version-check
228 + --with-ascend-binary
229 + --with-udpfromto
230 + --with-dhcp
231 + --with-pcre
232 + --with-iodbc-include-dir=/usr/include/iodbc
233 + --with-experimental-modules
234 + --with-docdir=/usr/share/doc/${PF}
235 + --with-logdir=/var/log/radius
236 +
237 + $(use_enable debug developer)
238 + $(use_with ldap edir)
239 + $(use_with redis rlm_cache_redis)
240 + $(use_with redis rlm_redis)
241 + $(use_with redis rlm_rediswho)
242 + $(use_with ssl openssl)
243 + $(use_with systemd systemd)
244 + )
245 +
246 + # bug #77613
247 + if has_version app-crypt/heimdal ; then
248 + myeconfargs+=( --enable-heimdal-krb5 )
249 + fi
250 +
251 + if use python ; then
252 + myeconfargs+=(
253 + --with-rlm-python3-bin=${EPYTHON}
254 + --with-rlm-python3-config-bin=${EPYTHON}-config
255 + )
256 + fi
257 +
258 + if ! use readline ; then
259 + export ac_cv_lib_readline=no
260 + fi
261 +
262 + #if ! use pcap ; then
263 + # export ac_cv_lib_pcap_pcap_open_live=no
264 + # export ac_cv_header_pcap_h=no
265 + #fi
266 +
267 + econf "${myeconfargs[@]}"
268 +}
269 +
270 +src_compile() {
271 + # Verbose, do not generate certificates
272 + emake \
273 + Q='' ECHO=true \
274 + LOCAL_CERT_PRODUCTS=''
275 +}
276 +
277 +src_install() {
278 + dodir /etc
279 +
280 + diropts -m0750 -o root -g radius
281 + dodir /etc/raddb
282 +
283 + diropts -m0750 -o radius -g radius
284 + dodir /var/log/radius
285 +
286 + keepdir /var/log/radius/radacct
287 + diropts
288 +
289 + # - Verbose, do not install certificates
290 + # - Parallel install fails (bug #509498)
291 + emake -j1 \
292 + Q='' ECHO=true \
293 + LOCAL_CERT_PRODUCTS='' \
294 + R="${D}" \
295 + install
296 +
297 + if use pam ; then
298 + pamd_mimic_system radiusd auth account password session
299 + fi
300 +
301 + # bug #711756
302 + fowners -R radius:radius /etc/raddb
303 + fowners -R radius:radius /var/log/radius
304 +
305 + dodoc CREDITS
306 +
307 + rm "${ED}"/usr/sbin/rc.radiusd || die
308 +
309 + newinitd "${FILESDIR}"/radius.init-r4 radiusd
310 + newconfd "${FILESDIR}"/radius.conf-r6 radiusd
311 +
312 + if ! use systemd ; then
313 + # If systemd builtin is not enabled we need use Type=Simple
314 + # as systemd .service
315 + sed -i -e 's:^Type=.*::g' \
316 + -e 's:^WatchdogSec=.*::g' -e 's:^NotifyAccess=all.*::g' \
317 + "${S}"/debian/freeradius.service
318 + fi
319 +
320 + systemd_dounit "${S}"/debian/freeradius.service
321 +
322 + find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
323 +}
324 +
325 +pkg_config() {
326 + if use ssl ; then
327 + cd "${ROOT}"/etc/raddb/certs || die
328 +
329 + ./bootstrap || die "Error while running ./bootstrap script."
330 + chown root:radius "${ROOT}"/etc/raddb/certs || die
331 + chown root:radius "${ROOT}"/etc/raddb/certs/ca.pem || die
332 + chown root:radius "${ROOT}"/etc/raddb/certs/server.{key,crt,pem} || die
333 + fi
334 +}
335 +
336 +pkg_preinst() {
337 + if ! has_version ${CATEGORY}/${PN} && use ssl ; then
338 + elog "You have to run \`emerge --config =${CATEGORY}/${PF}\` to be able"
339 + elog "to start the radiusd service."
340 + fi
341 +}