summaryrefslogtreecommitdiff
blob: 2a28859855c34c778a590c490afc1f2fc141998f (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-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

PYTHON_DEPEND="2"

inherit eutils multilib python

DESCRIPTION="A graphical newsreader written in Python"
HOMEPAGE="http://xpn.altervista.org/index-en.html"
SRC_URI="
	mirror://debian/pool/main/x/${PN}/${PN}_${PV}-5.debian.tar.gz
	http://xpn.altervista.org/codice/${P}.tar.gz"

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

LANGS="de fr it"
for i in ${LANGS} ; do
	IUSE="${IUSE} linguas_${i}"
done

DEPEND=""
RDEPEND="
	dev-python/pygtk
	x11-libs/gtk+:2"

pkg_setup() {
	python_set_active_version 2
	python_convert_shebangs -r 2 .
}

src_prepare() {
	# Debian Patches
	epatch "${WORKDIR}"/debian/patches/0{1..4}*.patch
}

src_install() {
	for i in ${LANGS} ; do
		insinto /usr/share/locale
		use linguas_${i} && doins -r lang/${i}
	done

	insinto $(python_get_sitedir)/${PN}/
	doins -r pixmaps xpn_src ${PN}.py

	newicon pixmaps/xpn-icon.png ${PN}.png
	make_desktop_entry "${PN} -d" ${PN} /usr/share/pixmaps/${PN}.png "Network;News"

	dodoc AUTHORS ChangeLog README
	dohtml xpn.html

	make_wrapper ${PN} "python2 ${PN}.py" $(python_get_sitedir)/${PN}

	python_need_rebuild
}

pkg_postinst() {
	python_mod_optimize ${PN}
}

pkg_postrm() {
	python_mod_cleanup ${PN}
}