Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dialup/freeradius/
Date: Sat, 26 Nov 2016 22:29:03
Message-Id: 1480199237.97704b400b78d96459c6d001640050ce1e9fa724.mattst88@gentoo
1 commit: 97704b400b78d96459c6d001640050ce1e9fa724
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 23 17:51:08 2016 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 26 22:27:17 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97704b40
7
8 net-dialup/freeradius: Add 3.0.12-r1.
9
10 The following commits will fix a few bugs, so to make those changes more
11 obvious copy the ebuild separately.
12
13 net-dialup/freeradius/freeradius-3.0.12-r1.ebuild | 216 ++++++++++++++++++++++
14 1 file changed, 216 insertions(+)
15
16 diff --git a/net-dialup/freeradius/freeradius-3.0.12-r1.ebuild b/net-dialup/freeradius/freeradius-3.0.12-r1.ebuild
17 new file mode 100644
18 index 00000000..0b7f671
19 --- /dev/null
20 +++ b/net-dialup/freeradius/freeradius-3.0.12-r1.ebuild
21 @@ -0,0 +1,216 @@
22 +# Copyright 1999-2016 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI=6
27 +
28 +PYTHON_COMPAT=( python2_7 )
29 +inherit autotools eutils pam python-any-r1 user
30 +
31 +#PATCHSET=4
32 +
33 +MY_P="${PN}-server-${PV}"
34 +
35 +DESCRIPTION="Highly configurable free RADIUS server"
36 +SRC_URI="
37 + ftp://ftp.freeradius.org/pub/radius/${MY_P}.tar.gz
38 + ftp://ftp.freeradius.org/pub/radius/old/${MY_P}.tar.gz
39 +"
40 +HOMEPAGE="http://www.freeradius.org/"
41 +
42 +KEYWORDS=""
43 +LICENSE="GPL-2"
44 +SLOT="0"
45 +
46 +IUSE="
47 + debug firebird iodbc kerberos ldap mysql odbc oracle pam pcap
48 + postgres python readline sqlite ssl
49 +"
50 +RESTRICT="test firebird? ( bindist )"
51 +
52 +RDEPEND="!net-dialup/cistronradius
53 + !net-dialup/gnuradius
54 + sys-devel/libtool
55 + dev-lang/perl:=
56 + sys-libs/gdbm
57 + sys-libs/talloc
58 + python? ( ${PYTHON_DEPS} )
59 + readline? ( sys-libs/readline:0= )
60 + pcap? ( net-libs/libpcap )
61 + mysql? ( virtual/mysql )
62 + postgres? ( dev-db/postgresql:= )
63 + firebird? ( dev-db/firebird )
64 + pam? ( virtual/pam )
65 + ssl? ( dev-libs/openssl:0= )
66 + ldap? ( net-nds/openldap )
67 + kerberos? ( virtual/krb5 )
68 + sqlite? ( dev-db/sqlite:3 )
69 + odbc? ( dev-db/unixODBC )
70 + iodbc? ( dev-db/libiodbc )
71 + oracle? ( dev-db/oracle-instantclient-basic )"
72 +DEPEND="${RDEPEND}"
73 +
74 +S="${WORKDIR}/${MY_P}"
75 +
76 +pkg_setup() {
77 + enewgroup radius
78 + enewuser radius -1 -1 /var/log/radius radius
79 +
80 + python-any-r1_pkg_setup
81 + export PYTHONBIN="${EPYTHON}"
82 +}
83 +
84 +src_prepare() {
85 + # most of the configuration options do not appear as ./configure
86 + # switches. Instead it identifies the directories that are available
87 + # and run through them. These might check for the presence of
88 + # various libraries, in which case they are not built. To avoid
89 + # automagic dependencies, we just remove all the modules that we're
90 + # not interested in using.
91 +
92 + use ssl || { rm -r src/modules/rlm_eap/types/rlm_eap_{tls,ttls,peap} || die ; }
93 + use ldap || { rm -r src/modules/rlm_ldap || die ; }
94 + use kerberos || { rm -r src/modules/rlm_krb5 || die ; }
95 + use pam || { rm -r src/modules/rlm_pam || die ; }
96 + use python || { rm -r src/modules/rlm_python || die ; }
97 + # Do not install ruby rlm module, bug #483108
98 + rm -r src/modules/rlm_ruby || die
99 +
100 + # these are all things we don't have in portage/I don't want to deal
101 + # with myself
102 + rm -r src/modules/rlm_eap/types/rlm_eap_tnc || die # requires TNCS library
103 + rm -r src/modules/rlm_eap/types/rlm_eap_ikev2 || die # requires libeap-ikev2
104 + rm -r src/modules/rlm_opendirectory || die # requires some membership.h
105 + rm -r src/modules/rlm_redis{,who} || die # requires redis
106 + rm -r src/modules/rlm_sql/drivers/rlm_sql_{db2,freetds} || die
107 +
108 + # sql drivers that are not part of experimental are loaded from a
109 + # file, so we have to remove them from the file itself when we
110 + # remove them.
111 + usesqldriver() {
112 + local flag=$1
113 + local driver=rlm_sql_${2:-${flag}}
114 +
115 + if ! use ${flag}; then
116 + rm -r src/modules/rlm_sql/drivers/${driver} || die
117 + sed -i -e /${driver}/d src/modules/rlm_sql/stable || die
118 + fi
119 + }
120 +
121 + sed -i \
122 + -e 's:/var/run/radiusd:/run/radiusd:g' \
123 + -e '/^run_dir/s:${localstatedir}::g' \
124 + raddb/radiusd.conf.in || die
125 +
126 + # verbosity
127 + # build shared libraries using jlibtool --shared
128 + sed -i \
129 + -e '/$(LIBTOOL)/s|--quiet ||g' \
130 + -e 's:--mode=\(compile\|link\):& --shared:g' \
131 + Make.inc.in || die
132 +
133 + sed -i \
134 + -e 's|--silent ||g' \
135 + -e 's:--mode=\(compile\|link\):& --shared:g' \
136 + scripts/libtool.mk || die
137 +
138 + # crude measure to stop jlibtool from running ranlib and ar
139 + sed -i \
140 + -e '/LIBRARIAN/s|".*"|"true"|g' \
141 + -e '/RANLIB/s|".*"|"true"|g' \
142 + scripts/jlibtool.c || die
143 +
144 + usesqldriver mysql
145 + usesqldriver postgres postgresql
146 + usesqldriver firebird
147 + usesqldriver iodbc
148 + usesqldriver odbc unixodbc
149 + usesqldriver oracle
150 + usesqldriver sqlite
151 +
152 + default
153 +
154 + eautoreconf
155 +}
156 +
157 +src_configure() {
158 + # fix bug #77613
159 + if has_version app-crypt/heimdal; then
160 + myconf+=( --enable-heimdal-krb5 )
161 + fi
162 +
163 + use readline || export ac_cv_lib_readline=no
164 + use pcap || export ac_cv_lib_pcap_pcap_open_live=no
165 +
166 + # do not try to enable static with static-libs; upstream is a
167 + # massacre of libtool best practices so you also have to make sure
168 + # to --enable-shared explicitly.
169 + econf \
170 + --enable-shared \
171 + --disable-static \
172 + --disable-ltdl-install \
173 + --with-system-libtool \
174 + --with-system-libltdl \
175 + --with-ascend-binary \
176 + --with-udpfromto \
177 + --with-dhcp \
178 + --with-iodbc-include-dir=/usr/include/iodbc \
179 + --with-experimental-modules \
180 + --with-docdir=/usr/share/doc/${PF} \
181 + --with-logdir=/var/log/radius \
182 + $(use_enable debug developer) \
183 + $(use_with ldap edir) \
184 + $(use_with ssl openssl) \
185 + ${myconf[@]}
186 +}
187 +
188 +src_compile() {
189 + # verbose, do not generate certificates
190 + emake \
191 + Q='' ECHO=true \
192 + LOCAL_CERT_PRODUCTS=''
193 +}
194 +
195 +src_install() {
196 + dodir /etc
197 + diropts -m0750 -o root -g radius
198 + dodir /etc/raddb
199 + diropts -m0750 -o radius -g radius
200 + dodir /var/log/radius
201 + keepdir /var/log/radius/radacct
202 + diropts
203 +
204 + # verbose, do not install certificates
205 + emake -j1 \
206 + Q='' ECHO=true \
207 + LOCAL_CERT_PRODUCTS='' \
208 + R="${D}" \
209 + install
210 +
211 + fowners -R root:radius /etc/raddb
212 +
213 + pamd_mimic_system radiusd auth account password session
214 +
215 + dodoc CREDITS
216 +
217 + rm "${D}/usr/sbin/rc.radiusd" || die
218 +
219 + newinitd "${FILESDIR}/radius.init-r3" radiusd
220 + newconfd "${FILESDIR}/radius.conf-r3" radiusd
221 +
222 + prune_libtool_files
223 +}
224 +
225 +pkg_config() {
226 + if use ssl; then
227 + cd "${ROOT}"/etc/raddb/certs
228 + ./bootstrap
229 + fi
230 +}
231 +
232 +pkg_preinst() {
233 + if ! has_version ${CATEGORY}/${PN} && use ssl; then
234 + elog "You have to run \`emerge --config =${CATEGORY}/${PF}\` to be able"
235 + elog "to start the radiusd service."
236 + fi
237 +}