summaryrefslogtreecommitdiff
blob: f04f9eb4d758f228988c0a2fdb25e18a9b521909 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/metakit/metakit-2.4.9.7.ebuild,v 1.3 2010/02/22 11:46:57 phajdan.jr Exp $

inherit python multilib eutils

DESCRIPTION="Embedded database library"
HOMEPAGE="http://www.equi4.com/metakit/"
SRC_URI="http://www.equi4.com/pub/mk/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~s390 ~sparc ~x86"
IUSE="python tcl static"

DEPEND=">=sys-apps/sed-4
	python? ( >=dev-lang/python-2.2.1 )
	tcl? ( >=dev-lang/tcl-8.3.3-r2 )"

RESTRICT="test"

src_unpack() {
	python_version

	unpack ${A}
	cd "${S}"

	# Fix all hardcoded python2.5 paths
	for name in python/scxx/PWOBase.h python/PyHead.h python/PyStorage.cpp ; do
		sed -i -e "s:Python.h:python${PYVER}/Python.h:" ${name}
	done
	sed -i -e "s:python2.5:python${PYVER}:" unix/configure
}

src_compile() {
	local myconf mycxxflags
	use python && myconf="--with-python=/usr/include/python${PYVER},/usr/$(get_libdir)/python${PYVER}/site-packages"
	use tcl && myconf="${myconf} --with-tcl=/usr/include,/usr/$(get_libdir)"
	use static && myconf="${myconf} --disable-shared"
	use static || mycxxflags="-fPIC"

	sed -i -e "s:^\(CXXFLAGS = \).*:\1${CXXFLAGS} ${mycxxflags} -I\$(srcdir)/../include:" unix/Makefile.in

	CXXFLAGS="${CXXFLAGS} ${mycxxflags}" unix/configure \
		${myconf} \
		--host=${CHOST} \
		--prefix=/usr \
		--libdir=/usr/$(get_libdir) \
		--infodir=/usr/share/info \
		--mandir=/usr/share/man || die "./configure failed"

	emake || die
}

src_install () {
	python_version

	use python && dodir /usr/$(get_libdir)/python${PYVER}/site-packages
	make DESTDIR="${D}" install || die

	dodoc CHANGES README
	dohtml Metakit.html
	dohtml -a html,gif,png,jpg -r doc/*
}