summaryrefslogtreecommitdiff
blob: a453bb97fc4580d29379f2a3097da1e115bd8d3a (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$

DESCRIPTION="A library with the aim to simplify DNS programing in C"
HOMEPAGE="http://www.nlnetlabs.nl/projects/ldns/"
SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc examples sha2 ssl"

RDEPEND="ssl? ( dev-libs/openssl )"
DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )"

pkg_setup() {
	if use sha2; then
		if ! use ssl; then
			die "For sha2 support, you have to enable ssl USE flag too"
		fi
		ewarn "You enabled sha2 USE flag, this is still experimental"
	fi
}

src_compile() {
	econf \
	$(use_enable sha2) \
	$(use_with ssl)

	emake || die "emake failed"
	if use doc; then
		emake doxygen || die "emake doc failed"
	fi
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc Changelog README || die "dodoc failed"

	if use examples; then
		docinto examples
		dodoc examples/* || die "dodoc for examples failed"
	fi

	if use doc; then
		dohtml doc/html/* || die "dohtml failed"
	fi
}

pkg_postinst() {
	einfo "The drill binary and the ldns-* utilities were moved into their own"
	einfo "package. If you need them, install net-dns/ldns-utils."
}