summaryrefslogtreecommitdiff
blob: aa246cb74a2959cd806bd8a1ecddcf5280c55929 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/qdbm/qdbm-1.8.74.ebuild,v 1.2 2006/11/26 23:58:29 vapier Exp $

inherit eutils java-pkg-opt-2 multilib

DESCRIPTION="Quick Database Manager"
HOMEPAGE="http://qdbm.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
IUSE="debug java perl ruby zlib"

RDEPEND="java? ( >=virtual/jre-1.4 )
	perl? ( dev-lang/perl )
	ruby? ( virtual/ruby )
	zlib? ( sys-libs/zlib )"
DEPEND="${RDEPEND}
	java? ( >=virtual/jdk-1.4 )"

src_unpack() {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}"/${PN}-runpath.diff
	epatch "${FILESDIR}"/${PN}-perl-runpath-vendor.diff
}

src_compile() {
	econf \
		$(use_enable debug) \
		$(use_enable zlib) \
		--enable-pthread \
		--enable-iconv \
		|| die
	emake || die

	local u
	for u in java perl ruby; do
		use ${u} || continue

		cd ${u}
		econf || die
		emake || die
		cd -
	done
}

src_test() {
	emake -j1 check || die

	local u
	for u in java perl ruby; do
		use ${u} || continue

		cd ${u}
		emake -j1 check || die
		cd -
	done
}

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

	dodoc ChangeLog NEWS README THANKS
	dohtml *.html

	rm -rf "${D}"/usr/share/${PN}

	local u mydatadir=/usr/share/doc/${P}/html

	for u in java perl ruby; do
		use ${u} || continue

		cd ${u}
		emake DESTDIR="${D}" MYDATADIR=${mydatadir}/${u} install || die

		case ${u} in
			java)
				java-pkg_dojar "${D}"/usr/$(get_libdir)/*.jar
				rm -f "${D}"/usr/$(get_libdir)/*.jar
				;;
			perl)
				rm "${D}"/$(perl -V:installarchlib | cut -d\' -f2)/*.pod
				;;
		esac
		cd -
	done

	rm -f "${D}"/usr/bin/*test
}