c78123910dafdb7c25367b1ebf40814d383f840e
[gentoo.git] / app-text / pastebinit / pastebinit-1.5.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 PYTHON_COMPAT=( python{2_7,3_5,3_6} )
6 PYTHON_REQ_USE="xml"
7
8 inherit python-single-r1
9
10 DESCRIPTION="A software that lets you send anything you want directly to a pastebin"
11 HOMEPAGE="https://launchpad.net/pastebinit"
12 SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17 IUSE="crypt"
18
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21 RDEPEND="${PYTHON_DEPS}
22         dev-python/configobj[${PYTHON_USEDEP}]
23         crypt? ( app-crypt/gnupg )"
24 DEPEND="app-text/docbook-xsl-stylesheets"
25
26 src_prepare() {
27         local mo=""
28
29         for lang in ${LINGUAS}; do
30                 if [ -f po/${lang}.po ]; then
31                         mo="${mo} ${lang}.mo"
32                 fi
33         done
34
35         sed -i -e "/^build-mo/s/:.*/:${mo}/" po/Makefile || die
36         sed -i -e "/#!/s/python3/python/" pastebinit || die
37 }
38
39 src_compile() {
40         emake -C po
41         xsltproc --nonet \
42                 "${EROOT}"usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
43                 pastebinit.xml || die
44 }
45
46 src_install() {
47         dobin pastebinit utils/pbput
48         python_fix_shebang "${ED}usr/bin/${PN}"
49         dosym pbput /usr/bin/pbget
50         use crypt && dosym pbput /usr/bin/pbputs
51         dodoc README
52         doman pastebinit.1 utils/*.1
53         insinto /usr/share/locale
54         [[ -d po/mo ]] && doins -r po/mo/*
55         insinto /usr/share
56         doins -r pastebin.d
57 }