summaryrefslogtreecommitdiff
blob: b7d45a6b5baf5ab598ee5f042a36669bd8f9854a (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/keybinder/keybinder-0.2.2.ebuild,v 1.2 2011/03/13 16:31:52 hwoarang Exp $

EAPI=3

PYTHON_DEPEND="python? 2:2.5"

inherit python

DESCRIPTION="A library for registering global keyboard shortcuts"
HOMEPAGE="http://kaizer.se/wiki/keybinder/"
SRC_URI="http://kaizer.se/publicfiles/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~x86"
IUSE="lua python"

RDEPEND=">=x11-libs/gtk+-2.20:2
	x11-libs/libXext
	x11-libs/libXrender
	x11-libs/libX11
	lua? ( >=dev-lang/lua-5.1 )
	python? ( >=dev-python/pygobject-2.15.3
		>=dev-python/pygtk-2.12 )"
DEPEND="${RDEPEND}
	dev-util/pkgconfig"

pkg_setup() {
	if use python; then
		python_set_active_version 2
		python_pkg_setup
	fi
}

src_prepare() {
	rm -f py-compile
	ln -s $(type -P true) py-compile
}

src_configure() {
	local myconf
	use lua || myconf="--disable-lua"

	econf \
		--disable-dependency-tracking \
		$(use_enable python) \
		${myconf}
}

src_install() {
	emake DESTDIR="${D}" install || die
	dodoc AUTHORS NEWS README

	find "${D}" -name '*.la' -exec rm -f '{}' +
}

pkg_postinst() {
	use python && python_mod_optimize keybinder
}

pkg_postrm() {
	use python && python_mod_cleanup keybinder
}