summaryrefslogtreecommitdiff
blob: ae12d509a0a5551fe9ac8ad5eb2f63ffcfeea42c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-crypt/mit-krb5/mit-krb5-1.4.ebuild,v 1.4 2005/04/08 20:41:17 seemant Exp $

inherit eutils flag-o-matic versionator

MY_P=${P/mit-}
P_DIR=$(get_version_component_range 1-2)
S=${WORKDIR}/${MY_P}/src
DESCRIPTION="MIT Kerberos V"
HOMEPAGE="http://web.mit.edu/kerberos/www/"
SRC_URI="http://web.mit.edu/kerberos/dist/krb5/${P_DIR}/${MY_P}-signed.tar"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
IUSE="krb4 static tcltk ipv6 doc tetex"

RDEPEND="virtual/libc"
#	!virtual/krb5"

DEPEND="${RDEPEND}
	sys-libs/com_err
	sys-libs/ss
	sys-devel/autoconf"

PROVIDE="virtual/krb5"

src_unpack() {
	unpack ${A}; tar -zxf ${MY_P}.tar.gz; cd ${S}
	epatch ${FILESDIR}/${P}-2005-001.patch
}

src_compile() {
	export DB_HEADER="/usr/include/db4.2/db_185.h"
	export DB_LIB="/usr/$(get_libdir)/libdb.so"

	econf \
		$(use_enable static) \
		$(use_with krb4) \
		$(use_enable ipv6) \
		$(use_with tcltk tcl) \
		--enable-shared \
		--with-system-et --with-system-ss --with-system-db \
		--enable-dns-for-realm \
		--program-prefix=mit- \
		--sysconfdir=/etc/kerberos \
		--libdir=/usr/$(get_libdir)/kerberos/mit \
		--includedir=/usr/include/kerberos/mit || die

	emake || die

	# Now, remake the ksu binary with -Wl,-z,now in CFLAGS
	append-ldflags "-Wl,-z,now"
	emake -C clients/ksu clean || die
	emake LDFLAGS="${LDFLAGS}" -C clients/ksu || die

	if use doc
	then
		cd ../doc
		rm man2html && ln -sf ${ROOT}/usr/bin/man2html

		make || die

		if use tetex
		then
			cd api
			make || die
		fi
	fi
}

src_install() {
	make \
		DESTDIR=${D} \
		EXAMPLEDIR=/usr/share/doc/${PF}/examples \
		install || die

	# Fix remaining namespace issues
	mv ${D}/usr/bin/{,mit-}krb5-config
	mv ${D}/usr/sbin/{,mit-}kadmin
	mv ${D}/usr/sbin/{,mit-}kadmind
	mv ${D}/usr/sbin/{,mit-}ktutil


	cd ..
	dodoc README
	doinfo doc/*.texinfo

	if use doc
	then
		dohtml -r doc
		use tetex \
			&& dodoc doc/api/*.ps \
			|| dodoc doc/api/*.{tex,sty}

	fi

	newinitd ${FILESDIR}/mit-krb5kadmind.initd mit-krb5kadmind
	newinitd ${FILESDIR}/mit-krb5kdc.initd mit-krb5kdc
}

pkg_postinst() {

	if use doc
	then
		einfo "See /usr/share/doc/${PF}/html/admin.html for documentation."
		echo ""
	fi
	einfo "The client apps are installed with the mit- prefix"
	einfo "(ie. mit-ftp, mit-ftpd, mit-telnet, mit-telnetd, etc...)"
	echo ""
}