summaryrefslogtreecommitdiff
blob: 972bd58f025aff7b2c0a63b3e64aebcd98afbf1d (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/tdb/tdb-1.1.5.ebuild,v 1.4 2009/11/04 11:30:39 patrick Exp $

EAPI="2"

inherit confutils eutils

DESCRIPTION="Samba tdb"
HOMEPAGE="http://tdb.samba.org/"
SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
LICENSE="GPL-3"
IUSE="python tools tdbtest"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ppc64 ~x86"

DEPEND="
	!<net-fs/samba-libs-3.4
	"
RDEPEND="${DEPEND}"

BINPROGS="bin/tdbdump bin/tdbtool bin/tdbbackup"

src_prepare() {

	./autogen.sh || die "autogen.sh failed"

	sed -i \
		-e 's|SHLD_FLAGS = @SHLD_FLAGS@|SHLD_FLAGS = @SHLD_FLAGS@ @LDFLAGS@|' \
		-e 's|CC = @CC@|CC = @CC@\
LDFLAGS = @LDFLAGS@|' \
		Makefile.in || die "sed failed"

}

src_configure() {

	econf \
		--sysconfdir=/etc/samba \
		--localstatedir=/var \
		--enable-largefile \
		$(use_enable python) \
	|| die "econf failed"

}

src_compile() {

	emake dirs || die "emake dirs failed"
	emake showflags || die "emake showflags failed"
	emake shared-build || die "emake shared-build failed"
	if use tools ; then emake ${BINPROGS} || die "emake binaries failed"; fi
	if use python ; then emake build-python || die "emake build-python failed"; fi
	if use tdbtest ; then make bin/tdbtest || die "emake tdbtest failed"; fi

}

src_install() {

	dolib.a sharedbuild/lib/libtdb.a
	dolib.so sharedbuild/lib/libtdb.so

	if use python || use tools ; then
		emake install DESTDIR="${D}" || die "emake install failed"
	fi

	if ! use tools ; then
		for prog in ${BINPROGS} ; do
			rm -f "${D}/usr/${prog}"
		done
	fi

	if use tdbtest ; then
		dobin bin/tdbtest
	fi

}