Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: app-crypt/mit-krb5/, app-crypt/mit-krb5/files/
Date: Sun, 23 Feb 2014 13:09:42
Message-Id: 1393161065.42468a83fbda2c6a62080f44f522666a16eb2c16.blueness@gentoo
1 commit: 42468a83fbda2c6a62080f44f522666a16eb2c16
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 23 13:11:05 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 23 13:11:05 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=42468a83
7
8 app-crypt/mit-krb5: add missing netdb.h
9
10 Package-Manager: portage-2.2.7
11 RepoMan-Options: --force
12 Manifest-Sign-Key: 0xF52D4BBA
13
14 ---
15 app-crypt/mit-krb5/files/kpropd.xinetd | 11 ++
16 .../files/mit-krb5-1.11.4-add-netdb_h.patch | 11 ++
17 .../files/mit-krb5-1.11_uninitialized.patch | 78 +++++++++++++
18 .../files/mit-krb5-1.12_uninitialized.patch | 55 +++++++++
19 .../mit-krb5/files/mit-krb5-config_LDFLAGS.patch | 12 ++
20 .../files/mit-krb5_krb5-config_LDFLAGS.patch | 12 ++
21 app-crypt/mit-krb5/files/mit-krb5kadmind.initd-r1 | 25 ++++
22 app-crypt/mit-krb5/files/mit-krb5kdc.initd-r1 | 24 ++++
23 app-crypt/mit-krb5/files/mit-krb5kpropd.initd-r1 | 24 ++++
24 app-crypt/mit-krb5/metadata.xml | 16 +++
25 app-crypt/mit-krb5/mit-krb5-1.11.4-r99.ebuild | 128 +++++++++++++++++++++
26 app-crypt/mit-krb5/mit-krb5-1.12.1-r99.ebuild | 128 +++++++++++++++++++++
27 12 files changed, 524 insertions(+)
28
29 diff --git a/app-crypt/mit-krb5/files/kpropd.xinetd b/app-crypt/mit-krb5/files/kpropd.xinetd
30 new file mode 100644
31 index 0000000..af542fc
32 --- /dev/null
33 +++ b/app-crypt/mit-krb5/files/kpropd.xinetd
34 @@ -0,0 +1,11 @@
35 +service tell
36 +{
37 + disable = yes
38 + socket_type = stream
39 + user = root
40 + wait = no
41 + server = /usr/sbin/kpropd
42 + only_from = 0.0.0.0
43 + log_on_success = PID HOST EXIT DURATION
44 + log_on_failure = HOST
45 +}
46
47 diff --git a/app-crypt/mit-krb5/files/mit-krb5-1.11.4-add-netdb_h.patch b/app-crypt/mit-krb5/files/mit-krb5-1.11.4-add-netdb_h.patch
48 new file mode 100644
49 index 0000000..150bdc2
50 --- /dev/null
51 +++ b/app-crypt/mit-krb5/files/mit-krb5-1.11.4-add-netdb_h.patch
52 @@ -0,0 +1,11 @@
53 +diff -Naur krb5-1.11.4.orig/src/lib/rpc/bindresvport.c krb5-1.11.4/src/lib/rpc/bindresvport.c
54 +--- krb5-1.11.4.orig/src/lib/rpc/bindresvport.c 2013-11-05 00:55:08.000000000 +0000
55 ++++ krb5-1.11.4/src/lib/rpc/bindresvport.c 2014-02-23 13:02:01.036502508 +0000
56 +@@ -38,6 +38,7 @@
57 + #include <sys/errno.h>
58 + #include <sys/socket.h>
59 + #include <netinet/in.h>
60 ++#include <netdb.h>
61 + #include <gssrpc/rpc.h>
62 + #include <errno.h>
63 +
64
65 diff --git a/app-crypt/mit-krb5/files/mit-krb5-1.11_uninitialized.patch b/app-crypt/mit-krb5/files/mit-krb5-1.11_uninitialized.patch
66 new file mode 100644
67 index 0000000..16f07d7
68 --- /dev/null
69 +++ b/app-crypt/mit-krb5/files/mit-krb5-1.11_uninitialized.patch
70 @@ -0,0 +1,78 @@
71 +--- a/src/slave/kprop.c
72 ++++ b/src/slave/kprop.c
73 +@@ -91,7 +91,7 @@ main(argc, argv)
74 + int argc;
75 + char **argv;
76 + {
77 +- int fd, database_fd, database_size;
78 ++ int fd = -1, database_fd, database_size;
79 + krb5_error_code retval;
80 + krb5_context context;
81 + krb5_creds *my_creds;
82 +--- a/src/kadmin/ktutil/ktutil_funcs.c
83 ++++ b/src/kadmin/ktutil/ktutil_funcs.c
84 +@@ -64,7 +64,7 @@
85 + krb5_kt_list *list;
86 + int idx;
87 + {
88 +- krb5_kt_list lp, prev;
89 ++ krb5_kt_list lp, prev = NULL;
90 + int i;
91 +
92 + for (lp = *list, i = 1; lp; prev = lp, lp = lp->next, i++) {
93 +--- a/src/lib/kadm5/alt_prof.c
94 ++++ b/src/lib/kadm5/alt_prof.c
95 +@@ -164,7 +164,7 @@
96 + char **values;
97 + char *valp;
98 + int idx;
99 +- krb5_boolean val;
100 ++ krb5_boolean val = 0;
101 +
102 + kret = krb5_aprof_getvals (acontext, hierarchy, &values);
103 + if (kret)
104 +--- a/src/lib/krb5/unicode/ucstr.c
105 ++++ b/src/lib/krb5/unicode/ucstr.c
106 +@@ -109,7 +109,7 @@
107 + krb5_data ** newdataptr,
108 + unsigned flags)
109 + {
110 +- int i, j, len, clen, outpos, ucsoutlen, outsize;
111 ++ int i, j, len, clen, outpos = 0, ucsoutlen, outsize;
112 + char *out = NULL, *outtmp, *s;
113 + krb5_ucs4 *ucs = NULL, *p, *ucsout = NULL;
114 + krb5_data *newdata;
115 +diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c
116 +index 7dc5b47..cd90db8 100644
117 +--- a/src/util/profile/prof_init.c
118 ++++ b/src/util/profile/prof_init.c
119 +@@ -255,7 +255,7 @@ copy_vtable_profile(profile_t profile, profile_t *ret_new_profile)
120 + {
121 + errcode_t err;
122 + void *cbdata;
123 +- profile_t new_profile;
124 ++ profile_t new_profile = NULL;
125 +
126 + *ret_new_profile = NULL;
127 +
128 +--- a/src/lib/krb5/krb/preauth2.c 2012-12-24 12:39:18.432678497 +0100
129 ++++ b/src/lib/krb5/krb/preauth2.c 2012-12-24 12:50:49.444099126 +0100
130 +@@ -956,7 +956,7 @@
131 + size_t i, h;
132 + int out_pa_list_size = 0;
133 + krb5_pa_data **out_pa_list = NULL;
134 +- krb5_error_code ret, module_ret;
135 ++ krb5_error_code ret, module_ret = 0;
136 + krb5_responder_fn responder = opte->opt_private->responder;
137 + static const int paorder[] = { PA_INFO, PA_REAL };
138 +
139 +--- a/src/tests/asn.1/trval.c 2013-04-12 12:51:36.000000000 -0500
140 ++++ b/src/tests/asn.1/trval.c 2013-05-24 04:31:14.077036380 -0500
141 +@@ -404,7 +404,7 @@
142 + {
143 + int n;
144 + int r = 0;
145 +- int rlen2;
146 ++ int rlen2 = 0;
147 + int rlent;
148 + int save_appl;
149
150 diff --git a/app-crypt/mit-krb5/files/mit-krb5-1.12_uninitialized.patch b/app-crypt/mit-krb5/files/mit-krb5-1.12_uninitialized.patch
151 new file mode 100644
152 index 0000000..e6d1921
153 --- /dev/null
154 +++ b/app-crypt/mit-krb5/files/mit-krb5-1.12_uninitialized.patch
155 @@ -0,0 +1,55 @@
156 +--- a/src/slave/kprop.c
157 ++++ b/src/slave/kprop.c
158 +@@ -91,7 +91,7 @@ main(argc, argv)
159 + int argc;
160 + char **argv;
161 + {
162 +- int fd, database_fd, database_size;
163 ++ int fd = -1, database_fd, database_size;
164 + krb5_error_code retval;
165 + krb5_context context;
166 + krb5_creds *my_creds;
167 +--- a/src/kadmin/ktutil/ktutil_funcs.c
168 ++++ b/src/kadmin/ktutil/ktutil_funcs.c
169 +@@ -64,7 +64,7 @@
170 + krb5_kt_list *list;
171 + int idx;
172 + {
173 +- krb5_kt_list lp, prev;
174 ++ krb5_kt_list lp, prev = NULL;
175 + int i;
176 +
177 + for (lp = *list, i = 1; lp; prev = lp, lp = lp->next, i++) {
178 +--- a/src/lib/kadm5/alt_prof.c
179 ++++ b/src/lib/kadm5/alt_prof.c
180 +@@ -164,7 +164,7 @@
181 + char **values;
182 + char *valp;
183 + int idx;
184 +- krb5_boolean val;
185 ++ krb5_boolean val = 0;
186 +
187 + kret = krb5_aprof_getvals (acontext, hierarchy, &values);
188 + if (kret)
189 +
190 +--- a/src/util/profile/prof_init.c
191 ++++ b/src/util/profile/prof_init.c
192 +@@ -255,7 +255,7 @@ copy_vtable_profile(profile_t profile, profile_t *ret_new_profile)
193 + {
194 + errcode_t err;
195 + void *cbdata;
196 +- profile_t new_profile;
197 ++ profile_t new_profile = NULL;
198 +
199 + *ret_new_profile = NULL;
200 +
201 +--- a/src/tests/asn.1/trval.c 2013-04-12 12:51:36.000000000 -0500
202 ++++ b/src/tests/asn.1/trval.c 2013-05-24 04:31:14.077036380 -0500
203 +@@ -404,7 +404,7 @@
204 + {
205 + int n;
206 + int r = 0;
207 +- int rlen2;
208 ++ int rlen2 = 0;
209 + int rlent;
210 + int save_appl;
211
212 diff --git a/app-crypt/mit-krb5/files/mit-krb5-config_LDFLAGS.patch b/app-crypt/mit-krb5/files/mit-krb5-config_LDFLAGS.patch
213 new file mode 100644
214 index 0000000..8490e62
215 --- /dev/null
216 +++ b/app-crypt/mit-krb5/files/mit-krb5-config_LDFLAGS.patch
217 @@ -0,0 +1,12 @@
218 +Bug #448778
219 +--- a/src/build-tools/krb5-config.in 2012-12-18 02:47:04.000000000 +0000
220 ++++ b/src/build-tools/krb5-config.in 2012-12-28 07:13:16.582693363 +0000
221 +@@ -217,7 +217,7 @@
222 + -e 's#\$(PROG_RPATH)#'$libdir'#' \
223 + -e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \
224 + -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \
225 +- -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
226 ++ -e 's#\$(LDFLAGS)##' \
227 + -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
228 + -e 's#\$(CFLAGS)##'`
229 +
230
231 diff --git a/app-crypt/mit-krb5/files/mit-krb5_krb5-config_LDFLAGS.patch b/app-crypt/mit-krb5/files/mit-krb5_krb5-config_LDFLAGS.patch
232 new file mode 100644
233 index 0000000..0b300cb
234 --- /dev/null
235 +++ b/app-crypt/mit-krb5/files/mit-krb5_krb5-config_LDFLAGS.patch
236 @@ -0,0 +1,12 @@
237 +Bug #448778
238 +--- krb5-1.11/src/krb5-config.in 2012-12-18 02:47:04.000000000 +0000
239 ++++ krb5-1.11/src/krb5-config.in 2012-12-28 07:13:16.582693363 +0000
240 +@@ -217,7 +217,7 @@
241 + -e 's#\$(PROG_RPATH)#'$libdir'#' \
242 + -e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \
243 + -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \
244 +- -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
245 ++ -e 's#\$(LDFLAGS)##' \
246 + -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
247 + -e 's#\$(CFLAGS)##'`
248 +
249
250 diff --git a/app-crypt/mit-krb5/files/mit-krb5kadmind.initd-r1 b/app-crypt/mit-krb5/files/mit-krb5kadmind.initd-r1
251 new file mode 100644
252 index 0000000..7b28fb2
253 --- /dev/null
254 +++ b/app-crypt/mit-krb5/files/mit-krb5kadmind.initd-r1
255 @@ -0,0 +1,25 @@
256 +#!/sbin/runscript
257 +
258 +#---------------------------------------------------------------------------
259 +# This script starts/stops the MIT Kerberos 5 Admin daemon
260 +#---------------------------------------------------------------------------
261 +
262 +daemon="MIT Kerberos 5 Admin daemon"
263 +exec="/usr/sbin/kadmind"
264 +
265 +depend() {
266 + need mit-krb5kdc
267 + use net
268 +}
269 +
270 +start() {
271 + ebegin "Starting $daemon"
272 + start-stop-daemon --start --quiet --exec ${exec} 1>&2
273 + eend $? "Error starting $daemon"
274 +}
275 +
276 +stop() {
277 + ebegin "Stopping $daemon"
278 + start-stop-daemon --stop --quiet --exec ${exec} 1>&2
279 + eend $? "Error stopping $daemon"
280 +}
281
282 diff --git a/app-crypt/mit-krb5/files/mit-krb5kdc.initd-r1 b/app-crypt/mit-krb5/files/mit-krb5kdc.initd-r1
283 new file mode 100644
284 index 0000000..94f1f79
285 --- /dev/null
286 +++ b/app-crypt/mit-krb5/files/mit-krb5kdc.initd-r1
287 @@ -0,0 +1,24 @@
288 +#!/sbin/runscript
289 +
290 +#---------------------------------------------------------------------------
291 +# This script starts/stops the MIT Kerberos 5 KDC
292 +#---------------------------------------------------------------------------
293 +
294 +daemon="MIT Kerberos 5 KDC"
295 +exec="/usr/sbin/krb5kdc"
296 +
297 +depend() {
298 + use net
299 +}
300 +
301 +start() {
302 + ebegin "Starting $daemon"
303 + start-stop-daemon --start --quiet --exec ${exec} 1>&2
304 + eend $? "Error starting $daemon"
305 +}
306 +
307 +stop() {
308 + ebegin "Stopping $daemon"
309 + start-stop-daemon --stop --quiet --exec ${exec} 1>&2
310 + eend $? "Error stopping $daemon"
311 +}
312
313 diff --git a/app-crypt/mit-krb5/files/mit-krb5kpropd.initd-r1 b/app-crypt/mit-krb5/files/mit-krb5kpropd.initd-r1
314 new file mode 100644
315 index 0000000..d800d66
316 --- /dev/null
317 +++ b/app-crypt/mit-krb5/files/mit-krb5kpropd.initd-r1
318 @@ -0,0 +1,24 @@
319 +#!/sbin/runscript
320 +
321 +#---------------------------------------------------------------------------
322 +# This script starts/stops the MIT Kerberos 5 kpropd
323 +#---------------------------------------------------------------------------
324 +
325 +daemon="MIT Kerberos 5 kpropd"
326 +exec="/usr/sbin/kpropd"
327 +
328 +depend() {
329 + use net mit-krb5kdc mit-krb5kadmind
330 +}
331 +
332 +start() {
333 + ebegin "Starting $daemon"
334 + start-stop-daemon --start --quiet --exec ${exec} -- -S 1>&2
335 + eend $? "Error starting $daemon"
336 +}
337 +
338 +stop() {
339 + ebegin "Stopping $daemon"
340 + start-stop-daemon --stop --quiet --exec ${exec} 1>&2
341 + eend $? "Error stopping $daemon"
342 +}
343
344 diff --git a/app-crypt/mit-krb5/metadata.xml b/app-crypt/mit-krb5/metadata.xml
345 new file mode 100644
346 index 0000000..2609e96
347 --- /dev/null
348 +++ b/app-crypt/mit-krb5/metadata.xml
349 @@ -0,0 +1,16 @@
350 +<?xml version="1.0" encoding="UTF-8"?>
351 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
352 +<pkgmetadata>
353 +<herd>kerberos</herd>
354 +<longdescription>Kerberos 5 reference implementation from MIT</longdescription>
355 +<use>
356 + <flag name="doc">
357 + Creates and installs the API and implementation
358 + documentation. This is only useful if you want to develop software
359 + which depends on kerberos.
360 + </flag>
361 + <flag name="keyutils">Enable for the keyring ccache using keyutils.</flag>
362 + <flag name="pkinit">Enable pkinit support for the initial ticket.</flag>
363 + <flag name="openldap">Enable support for ldap as a database backend.</flag>
364 +</use>
365 +</pkgmetadata>
366
367 diff --git a/app-crypt/mit-krb5/mit-krb5-1.11.4-r99.ebuild b/app-crypt/mit-krb5/mit-krb5-1.11.4-r99.ebuild
368 new file mode 100644
369 index 0000000..0f0473f
370 --- /dev/null
371 +++ b/app-crypt/mit-krb5/mit-krb5-1.11.4-r99.ebuild
372 @@ -0,0 +1,128 @@
373 +# Copyright 1999-2013 Gentoo Foundation
374 +# Distributed under the terms of the GNU General Public License v2
375 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/mit-krb5/mit-krb5-1.11.4.ebuild,v 1.10 2013/11/16 08:40:46 ago Exp $
376 +
377 +EAPI=5
378 +
379 +PYTHON_COMPAT=( python{2_6,2_7} )
380 +inherit eutils flag-o-matic python-any-r1 versionator
381 +
382 +MY_P="${P/mit-}"
383 +P_DIR=$(get_version_component_range 1-2)
384 +DESCRIPTION="MIT Kerberos V"
385 +HOMEPAGE="http://web.mit.edu/kerberos/www/"
386 +SRC_URI="http://web.mit.edu/kerberos/dist/krb5/${P_DIR}/${MY_P}-signed.tar"
387 +
388 +LICENSE="openafs-krb5-a BSD MIT OPENLDAP BSD-2 HPND BSD-4 ISC RSA CC-BY-SA-3.0 || ( BSD-2 GPL-2+ )"
389 +SLOT="0"
390 +KEYWORDS="amd64 arm x86"
391 +IUSE="doc +keyutils openldap +pkinit +threads test xinetd"
392 +
393 +RDEPEND="!!app-crypt/heimdal
394 + >=sys-libs/e2fsprogs-libs-1.41.0
395 + || ( dev-libs/libverto[libev] dev-libs/libverto[libevent] dev-libs/libverto[tevent] )
396 + keyutils? ( sys-apps/keyutils )
397 + openldap? ( net-nds/openldap )
398 + pkinit? ( dev-libs/openssl )
399 + xinetd? ( sys-apps/xinetd )"
400 +DEPEND="${RDEPEND}
401 + ${PYTHON_DEPS}
402 + virtual/yacc
403 + doc? ( virtual/latex-base )
404 + test? ( ${PYTHON_DEPS}
405 + dev-lang/tcl
406 + dev-util/dejagnu )"
407 +
408 +S=${WORKDIR}/${MY_P}/src
409 +
410 +src_unpack() {
411 + unpack ${A}
412 + unpack ./"${MY_P}".tar.gz
413 +}
414 +
415 +src_prepare() {
416 + epatch "${FILESDIR}/${PN}-1.11_uninitialized.patch"
417 + epatch "${FILESDIR}/${PN}_krb5-config_LDFLAGS.patch"
418 + epatch "${FILESDIR}/${PN}-1.11.4-add-netdb_h.patch"
419 +
420 + # tcl-8.6 compatibility
421 + sed -i -e 's/interp->result/Tcl_GetStringResult(interp)/' \
422 + kadmin/testing/util/tcl_kadm5.c || die
423 +}
424 +
425 +src_configure() {
426 + append-cppflags "-I${EPREFIX}/usr/include/et"
427 + # QA
428 + append-flags -fno-strict-aliasing
429 + append-flags -fno-strict-overflow
430 +
431 + use keyutils || export ac_cv_header_keyutils_h=no
432 + econf \
433 + $(use_with openldap ldap) \
434 + "$(use_with test tcl "${EPREFIX}/usr")" \
435 + $(use_enable pkinit) \
436 + $(use_enable threads thread-support) \
437 + --without-hesiod \
438 + --enable-shared \
439 + --with-system-et \
440 + --with-system-ss \
441 + --enable-dns-for-realm \
442 + --enable-kdc-lookaside-cache \
443 + --with-system-verto \
444 + --disable-rpath
445 +}
446 +
447 +src_compile() {
448 + emake -j1
449 +}
450 +
451 +src_test() {
452 + emake -j1 check
453 +}
454 +
455 +src_install() {
456 + emake \
457 + DESTDIR="${D}" \
458 + EXAMPLEDIR="${EPREFIX}/usr/share/doc/${PF}/examples" \
459 + install
460 +
461 + # default database dir
462 + keepdir /var/lib/krb5kdc
463 +
464 + cd ..
465 + dodoc README
466 +
467 + if use doc; then
468 + dohtml -r doc/html/*
469 + docinto pdf
470 + dodoc doc/pdf/*.pdf
471 + fi
472 +
473 + newinitd "${FILESDIR}"/mit-krb5kadmind.initd-r1 mit-krb5kadmind
474 + newinitd "${FILESDIR}"/mit-krb5kdc.initd-r1 mit-krb5kdc
475 + newinitd "${FILESDIR}"/mit-krb5kpropd.initd-r1 mit-krb5kpropd
476 +
477 + insinto /etc
478 + newins "${ED}/usr/share/doc/${PF}/examples/krb5.conf" krb5.conf.example
479 + insinto /var/lib/krb5kdc
480 + newins "${ED}/usr/share/doc/${PF}/examples/kdc.conf" kdc.conf.example
481 +
482 + if use openldap ; then
483 + insinto /etc/openldap/schema
484 + doins "${S}/plugins/kdb/ldap/libkdb_ldap/kerberos.schema"
485 + fi
486 +
487 + if use xinetd ; then
488 + insinto /etc/xinetd.d
489 + newins "${FILESDIR}/kpropd.xinetd" kpropd
490 + fi
491 +}
492 +
493 +pkg_preinst() {
494 + if has_version "<${CATEGORY}/${PN}-1.8.0" ; then
495 + elog "MIT split the Kerberos applications from the base Kerberos"
496 + elog "distribution. Kerberized versions of telnet, rlogin, rsh, rcp,"
497 + elog "ftp clients and telnet, ftp deamons now live in"
498 + elog "\"app-crypt/mit-krb5-appl\" package."
499 + fi
500 +}
501
502 diff --git a/app-crypt/mit-krb5/mit-krb5-1.12.1-r99.ebuild b/app-crypt/mit-krb5/mit-krb5-1.12.1-r99.ebuild
503 new file mode 100644
504 index 0000000..4d46d57
505 --- /dev/null
506 +++ b/app-crypt/mit-krb5/mit-krb5-1.12.1-r99.ebuild
507 @@ -0,0 +1,128 @@
508 +# Copyright 1999-2014 Gentoo Foundation
509 +# Distributed under the terms of the GNU General Public License v2
510 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/mit-krb5/mit-krb5-1.12.1.ebuild,v 1.1 2014/01/18 21:08:09 eras Exp $
511 +
512 +EAPI=5
513 +
514 +PYTHON_COMPAT=( python{2_6,2_7} )
515 +inherit eutils flag-o-matic python-any-r1 versionator
516 +
517 +MY_P="${P/mit-}"
518 +P_DIR=$(get_version_component_range 1-2)
519 +DESCRIPTION="MIT Kerberos V"
520 +HOMEPAGE="http://web.mit.edu/kerberos/www/"
521 +SRC_URI="http://web.mit.edu/kerberos/dist/krb5/${P_DIR}/${MY_P}-signed.tar"
522 +
523 +LICENSE="openafs-krb5-a BSD MIT OPENLDAP BSD-2 HPND BSD-4 ISC RSA CC-BY-SA-3.0 || ( BSD-2 GPL-2+ )"
524 +SLOT="0"
525 +KEYWORDS="~amd64 ~arm ~x86"
526 +IUSE="doc +keyutils openldap +pkinit +threads test xinetd"
527 +
528 +RDEPEND="!!app-crypt/heimdal
529 + >=sys-libs/e2fsprogs-libs-1.41.0
530 + || ( dev-libs/libverto[libev] dev-libs/libverto[libevent] dev-libs/libverto[tevent] )
531 + keyutils? ( sys-apps/keyutils )
532 + openldap? ( net-nds/openldap )
533 + pkinit? ( dev-libs/openssl )
534 + xinetd? ( sys-apps/xinetd )"
535 +DEPEND="${RDEPEND}
536 + ${PYTHON_DEPS}
537 + virtual/yacc
538 + doc? ( virtual/latex-base )
539 + test? ( ${PYTHON_DEPS}
540 + dev-lang/tcl
541 + dev-util/dejagnu )"
542 +
543 +S=${WORKDIR}/${MY_P}/src
544 +
545 +src_unpack() {
546 + unpack ${A}
547 + unpack ./"${MY_P}".tar.gz
548 +}
549 +
550 +src_prepare() {
551 + epatch "${FILESDIR}/${PN}-1.12_uninitialized.patch"
552 + epatch "${FILESDIR}/${PN}-config_LDFLAGS.patch"
553 + epatch "${FILESDIR}/${PN}-1.11.4-add-netdb_h.patch"
554 +
555 + # tcl-8.6 compatibility
556 + sed -i -e 's/interp->result/Tcl_GetStringResult(interp)/' \
557 + kadmin/testing/util/tcl_kadm5.c || die
558 +}
559 +
560 +src_configure() {
561 + append-cppflags "-I${EPREFIX}/usr/include/et"
562 + # QA
563 + append-flags -fno-strict-aliasing
564 + append-flags -fno-strict-overflow
565 +
566 + use keyutils || export ac_cv_header_keyutils_h=no
567 + econf \
568 + $(use_with openldap ldap) \
569 + "$(use_with test tcl "${EPREFIX}/usr")" \
570 + $(use_enable pkinit) \
571 + $(use_enable threads thread-support) \
572 + --without-hesiod \
573 + --enable-shared \
574 + --with-system-et \
575 + --with-system-ss \
576 + --enable-dns-for-realm \
577 + --enable-kdc-lookaside-cache \
578 + --with-system-verto \
579 + --disable-rpath
580 +}
581 +
582 +src_compile() {
583 + emake -j1
584 +}
585 +
586 +src_test() {
587 + emake -j1 check
588 +}
589 +
590 +src_install() {
591 + emake \
592 + DESTDIR="${D}" \
593 + EXAMPLEDIR="${EPREFIX}/usr/share/doc/${PF}/examples" \
594 + install
595 +
596 + # default database dir
597 + keepdir /var/lib/krb5kdc
598 +
599 + cd ..
600 + dodoc README
601 +
602 + if use doc; then
603 + dohtml -r doc/html/*
604 + docinto pdf
605 + dodoc doc/pdf/*.pdf
606 + fi
607 +
608 + newinitd "${FILESDIR}"/mit-krb5kadmind.initd-r1 mit-krb5kadmind
609 + newinitd "${FILESDIR}"/mit-krb5kdc.initd-r1 mit-krb5kdc
610 + newinitd "${FILESDIR}"/mit-krb5kpropd.initd-r1 mit-krb5kpropd
611 +
612 + insinto /etc
613 + newins "${ED}/usr/share/doc/${PF}/examples/krb5.conf" krb5.conf.example
614 + insinto /var/lib/krb5kdc
615 + newins "${ED}/usr/share/doc/${PF}/examples/kdc.conf" kdc.conf.example
616 +
617 + if use openldap ; then
618 + insinto /etc/openldap/schema
619 + doins "${S}/plugins/kdb/ldap/libkdb_ldap/kerberos.schema"
620 + fi
621 +
622 + if use xinetd ; then
623 + insinto /etc/xinetd.d
624 + newins "${FILESDIR}/kpropd.xinetd" kpropd
625 + fi
626 +}
627 +
628 +pkg_preinst() {
629 + if has_version "<${CATEGORY}/${PN}-1.8.0" ; then
630 + elog "MIT split the Kerberos applications from the base Kerberos"
631 + elog "distribution. Kerberized versions of telnet, rlogin, rsh, rcp,"
632 + elog "ftp clients and telnet, ftp deamons now live in"
633 + elog "\"app-crypt/mit-krb5-appl\" package."
634 + fi
635 +}