summaryrefslogtreecommitdiff
blob: 95d19a4ba6c922f0488a1da54ee1141f7ac7397c (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagstamon/nagstamon-0.9.8.ebuild,v 1.3 2012/01/28 14:46:41 phajdan.jr Exp $

EAPI="3"

PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.* *-jython"

inherit eutils python

MY_P="${PN}_${PV/_/-}"
MY_PN="Nagstamon"

DESCRIPTION="Nagstamon is a Nagios status monitor for a systray and displays a realtime status of a Nagios box"
HOMEPAGE="http://nagstamon.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="gnome"

DEPEND=""
RDEPEND="dev-python/pygtk
	dev-python/lxml
	dev-python/beautifulsoup
	gnome? ( dev-python/egg-python )"

#S="${WORKDIR}/${MY_P}"
S="${WORKDIR}/Nagstamon"

src_prepare() {
	epatch "${FILESDIR}/${PN}-0.9.5-resources.patch"

	python_convert_shebangs 2 nagstamon.py

	rm Nagstamon/resources/LICENSE
	rm Nagstamon/BeautifulSoup.py
}

src_install() {
	# setup.py is broken
	cd Nagstamon/

	doman resources/nagstamon.1 || die
	rm resources/nagstamon.1

	nagstamon_install() {
		exeinto $(python_get_sitedir)/${MY_PN}
		doexe ../nagstamon.py || die
		dosym $(python_get_sitedir)/${MY_PN}/${PN}.py /usr/bin/${PN} || die

		insinto $(python_get_sitedir)/${MY_PN}
		doins {GUI,Config,Objects,Custom,Actions}.py || die
		touch "${D}/$(python_get_sitedir)/${MY_PN}/__init__.py" || die
		doins -r Server/ || die

		insinto /usr/share/${PN}/resources
		doins resources/* || die

		insinto /usr/share/applications
		doins "${FILESDIR}"/${PN}.desktop || die
	}

	python_execute_function nagstamon_install
}

pkg_postinst() {
	python_mod_optimize ${MY_PN}
}

pkg_postrm() {
	python_mod_cleanup ${MY_PN}
}