summaryrefslogtreecommitdiff
blob: 5b234a1e725cef63b415eefe384d8a815a82d211 (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-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/kde-base/pykde/pykde-3.5.8.ebuild,v 1.3 2007/10/29 07:38:59 philantrop Exp $

KMNAME=kdebindings
KMMODULE=python
KM_MAKEFILESREV=1
MAXKDEVER=$PV
KM_DEPRANGE="$PV $MAXKDEVER"

inherit kde-meta distutils

DESCRIPTION="PyKDE is a set of Python bindings for kdelibs."

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="debug doc examples"

DEPEND=">=dev-python/sip-4.6
		>=dev-python/PyQt-3.17.2
		kde-base/kdelibs
		|| ( kde-base/kdebase kde-base/konsole )
		!dev-python/pykde"

src_unpack() {
	kde-meta_src_unpack
	cd "${S}/python/pykde"
	epatch "${FILESDIR}/${P}-python-2.5-compat.diff"

	mkdir -p kparts
	ln -s "${PREFIX}"/$(get_libdir)/kde3/libkonsolepart* ./kparts/
}

src_compile() {
	cd "${S}/python/pykde"
	distutils_python_version

	local myconf="-d /usr/$(get_libdir)/python${PYVER}/site-packages \
			-v /usr/share/sip \
			-k $(kde-config --prefix)"

	use debug && myconf="${myconf} -u"
	myconf="${myconf} -i"

	python configure.py ${myconf} || die "configure failed"
	emake || die
}

src_install() {
	cd "${S}/python/pykde"
	dodir "${PREFIX}"/$(get_libdir)
	sed -i -e "s:/lib/:/$(get_libdir)/:g" Makefile

	for X in dcop kdecore kdefx kdeui kio kresources kabc kutils kfile kparts khtml kspell kdeprint kmdi ; do
		sed -i -e '/strip $(DESTDIR).*/d' ${X}/Makefile
	done

	make DESTDIR="${D}" install || die
	find "${D}/usr/share/sip" -not -type d -not -iname *.sip -exec rm '{}' \;

	dodoc AUTHORS ChangeLog NEWS README THANKS
	use doc && dohtml -r doc/*
	if use examples ; then
		cp -r examples "${D}/usr/share/doc/${PF}"
		cp -r templates "${D}/usr/share/doc/${PF}"
	fi
}