dev-python/html2text: Fix /usr/bin/html2text collision regression
[gentoo.git] / net-mail / rss2email / rss2email-2.71-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit eutils python-r1
9
10 DEBIAN_PV="2.65"
11
12 DESCRIPTION="A python script that converts RSS/Atom newsfeeds to email"
13 HOMEPAGE="http://www.allthingsrss.com/rss2email"
14 SRC_URI="http://www.allthingsrss.com/${PN}/${P}.tar.gz
15         mirror://debian/pool/main/r/${PN}/${PN}_${DEBIAN_PV}-1.diff.gz"
16
17 LICENSE="GPL-2"
18 SLOT="0"
19 KEYWORDS="amd64 x86"
20 IUSE=""
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
22
23 DEPEND="dev-util/patchutils"
24 RDEPEND="${PYTHON_DEPS}
25         >=dev-python/feedparser-5.0.1
26         >=dev-python/html2text-3.01"
27
28 src_unpack() {
29         # Tarball has zero permissions inside
30         tar xf "${DISTDIR}"/${P}.tar.gz || die
31         chmod 0755 ${P} || die
32         chmod 0644 ${P}/* || die
33 }
34
35 src_prepare() {
36         epatch "${FILESDIR}"/${PN}-2.69-config-location.patch
37
38         # Extract man page from Debian patch
39         zcat "${DISTDIR}"/${PN}_${DEBIAN_PV}-1.diff.gz \
40                 | filterdiff -i '*/r2e.1' \
41                 > "${S}"/r2e.1.patch || die
42         EPATCH_OPTS="-p1" epatch r2e.1.patch
43 }
44
45 src_install() {
46         my_install() {
47                 python_moduleinto ${PN}
48                 python_newscript rss2email.py main.py
49         }
50         python_foreach_impl my_install
51
52         insinto /etc/${PN}
53         doins config.py.example
54
55         dodoc CHANGELOG readme.html
56         doman r2e.1
57
58         # Replace r2e wrapper
59         cat <<-"EOF" >r2e
60                 #! /bin/sh
61                 SITE_PACKAGES=`python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`
62                 CONF_DIR=${HOME}/.rss2email
63                 mkdir -p "${CONF_DIR}"
64                 exec python2 "${SITE_PACKAGES}"/rss2email/main.py "${CONF_DIR}"/feeds.dat $*
65         EOF
66
67         dobin r2e
68 }