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

EAPI="6"

DESCRIPTION="Collection of Gentoo eclass manpages"
HOMEPAGE="https://www.gentoo.org/"
SRC_URI=""

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE=""

DEPEND="
	|| (
		sys-apps/portage
		sys-apps/portage-mgorny
	)"

S=${WORKDIR}

genit() {
	local e=${1:-${ECLASSDIR}}
	einfo "Generating man pages from: ${e}"
	# Need `bash` because the .sh isn't +x on the servers #451352
	env ECLASSDIR=${e} bash "${FILESDIR}"/eclass-to-manpage.sh || die
}

src_compile() {
	# First process any eclasses found in overlays.  Then process
	# the main eclassdir last so that its output will clobber anything
	# that might have come from overlays.  Main tree wins!
	local o e
	for o in $(portageq get_repos /) ; do
		e="$(portageq get_repo_path / ${o})/eclass"
		[[ -d ${e} ]] || continue
		genit "${e}" || die
	done
	genit || die
}

src_install() {
	doman *.5
}