summaryrefslogtreecommitdiff
blob: ce3e1c485bf7ee0c20fcf5a4b27b9146485dc76c (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/talloc/talloc-2.0.1-r1.ebuild,v 1.1 2010/04/03 19:26:15 dev-zero Exp $

EAPI="2"

inherit eutils autotools

DESCRIPTION="Samba talloc library"
HOMEPAGE="http://talloc.samba.org/"
SRC_URI="http://samba.org/ftp/${PN}/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
IUSE="compat doc static-libs swig"

RDEPEND=""
DEPEND="doc? ( app-text/docbook-xml-dtd:4.2
		dev-libs/libxslt )
	swig? ( dev-lang/swig )
	!<net-fs/samba-libs-3.4
	!<net-fs/samba-3.3"

src_prepare() {
	epatch "${FILESDIR}/${PN}-2.0.0-without-doc.patch"

	eautoconf -Ilibreplace

	sed -i \
		-e 's:$(SHLD_FLAGS) :$(SHLD_FLAGS) $(LDFLAGS) :' \
		Makefile.in
}

src_configure() {
	if ! use swig ; then
		sed -i \
			-e '/swig/d' \
			talloc.mk || die "sed failed"
	fi

	if ! use static-libs ; then
		sed -i \
			-e 's|:: $(TALLOC_STLIB)|::|' \
			-e '/$(TALLOC_STLIB) /d' \
			-e '/libtalloc.a/d' \
			talloc.mk Makefile.in || die "sed failed"
	fi

	econf \
		--sysconfdir=/etc/samba \
		--localstatedir=/var \
		$(use_enable compat talloc-compat1) \
		$(use_with doc)
}

src_compile() {
	emake shared-build || die "emake shared-build failed"
}

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

	use doc && dohtml *.html

	# installs missing symlink
	dolib.so sharedbuild/lib/libtalloc.so
}