summaryrefslogtreecommitdiff
blob: bf613cf69206aeb815ef0b587b3d8f39e9d0b560 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{9..11} )
PYTHON_REQ_USE="xml(+)"
inherit optfeature python-single-r1

MY_P="${PN}_${PV}"
DESCRIPTION="A software that lets you send anything you want directly to a pastebin"
HOMEPAGE="https://launchpad.net/pastebinit"
SRC_URI="mirror://ubuntu/pool/main/p/${PN}/${MY_P}.orig.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~riscv x86"
IUSE="man"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep '
		dev-python/configobj[${PYTHON_USEDEP}]
	')
"
BDEPEND="
	sys-devel/gettext
	man? (
		app-text/docbook-xsl-stylesheets
		dev-libs/libxslt
	)
"

PATCHES=( "${FILESDIR}"/${P}-distro.patch )

src_prepare() {
	default
	python_fix_shebang "${S}"/${PN}
}

src_compile() {
	emake -C po

	if use man; then
		ebegin "Generating a manpage with xsltproc"
		xsltproc --nonet \
			"${BROOT}"/usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
			pastebinit.xml
		eend $?
	fi
}

src_install() {
	dobin pastebinit utils/pbput
	dosym pbput /usr/bin/pbget
	dosym pbput /usr/bin/pbputs

	einstalldocs
	doman utils/*.1
	use man && doman pastebinit.1

	insinto /usr/share/locale
	doins -r po/mo/*

	insinto /usr/share
	doins -r pastebin.d
}

pkg_postinst() {
	optfeature "identification of your distribution" dev-python/distro
	optfeature "pbput and pbputs scripts" app-arch/xz-utils
	optfeature "pbget and pbputs scripts" app-crypt/gnupg
}