summaryrefslogtreecommitdiff
path: root/app-i18n/man-pages-l10n/man-pages-l10n-4.32.2.ebuild
blob: 9da761fa3378ce630911f4526d007f8bbe7287ea (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
75
76
77
78
79
80
81
82
83
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{13..14} )
inherit cmake python-any-r1

DESCRIPTION="A somewhat comprehensive collection of man page translations"
HOMEPAGE="https://manpages-l10n-team.pages.debian.net/manpages-l10n/"
SRC_URI="https://salsa.debian.org/manpages-l10n-team/${PN/-}/-/archive/${PV}/${P/-}.tar.bz2"
S="${WORKDIR}/${P/-}"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
# fa omitted because of missing rtl support in *roff
MY_L10N=(cs da de el es fi fr hu id it ko mk nb nl pl pt-BR ro ru sr sv tr uk vi)
IUSE="${MY_L10N[@]/#/l10n_}"
# Require at least one language, otherwise the package would be empty.
# Unfortunately, this triggers a RequiredUseDefaults pkgcheck warning.
REQUIRED_USE="|| ( ${MY_L10N[@]/#/l10n_} )"

RDEPEND="virtual/man
	l10n_ru? ( !app-i18n/man-pages-ru )"

BDEPEND="app-text/po4a
	dev-lang/perl
	${PYTHON_DEPS}"

DOCS=(AUTHORS.md CHANGES.md CONTRIBUTING.md COPYRIGHT.md README.md)

src_prepare() {
	cmake_src_prepare

	# some packages have their own translations
	local f noinst_manpages=(
		# net-wireless/wireless-tools
		wireless.7
		iwconfig.8
		# sys-apps/net-tools
		dnsdomainname.1
		hostname.1
		ethers.5
		arp.8
		ifconfig.8
		ipmaddr.8
		iptunnel.8
		mii-tool.8
		nameif.8
		netstat.8
		rarp.8
		route.8
		# sys-apps/shadow
		groups.1
		# sys-apps/sysvinit
		killall5.8
		runlevel.8
		shutdown.8
	)

	for f in "${noinst_manpages[@]}"; do
		rm po/*/"man${f##*.}/${f}.po" || die
	done

	# CMakeLists.txt has no option to build only a subset of languages,
	# so we brute-force it
	# https://salsa.debian.org/manpages-l10n-team/manpages-l10n/-/work_items/24
	for f in po/*; do
		if [[ -d ${f} ]] && ! has "${f#*/}" ${L10N//-/_}; then
			rm -r "${f}" || die
		fi
	done
}

src_configure() {
	local mycmakeargs=(
		"-DCOMPRESSION=none"
		# An absolute path for CMAKE_INSTALL_MANDIR breaks installation
		"-DCMAKE_INSTALL_MANDIR=share/man"
	)
	cmake_src_configure
}