Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/sysvinit/
Date: Tue, 29 Mar 2022 11:49:44
Message-Id: 1648554565.cccaac2fdf7f1256c6cf5273fac824d24fdde777.ulm@gentoo
1 commit: cccaac2fdf7f1256c6cf5273fac824d24fdde777
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 29 11:46:53 2022 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 29 11:49:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cccaac2f
7
8 Revert "sys-apps/sysvinit: drop translations again"
9
10 And revision bump to -r3.
11
12 This reverts commit e18dcba3744bdbd1ef1700183c71a6a6703fed40.
13
14 Bug: https://bugs.gentoo.org/836362#c4
15 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
16
17 ...init-3.02-r2.ebuild => sysvinit-3.02-r3.ebuild} | 37 +++++++++++++++++++---
18 1 file changed, 32 insertions(+), 5 deletions(-)
19
20 diff --git a/sys-apps/sysvinit/sysvinit-3.02-r2.ebuild b/sys-apps/sysvinit/sysvinit-3.02-r3.ebuild
21 similarity index 82%
22 rename from sys-apps/sysvinit/sysvinit-3.02-r2.ebuild
23 rename to sys-apps/sysvinit/sysvinit-3.02-r3.ebuild
24 index c05001372e26..689e5a124a48 100644
25 --- a/sys-apps/sysvinit/sysvinit-3.02-r2.ebuild
26 +++ b/sys-apps/sysvinit/sysvinit-3.02-r3.ebuild
27 @@ -3,8 +3,9 @@
28
29 EAPI=7
30
31 +PLOCALES="de es fi fr hu id pl"
32 VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/sysvinit.asc
33 -inherit toolchain-funcs flag-o-matic verify-sig
34 +inherit toolchain-funcs flag-o-matic plocale verify-sig
35
36 DESCRIPTION="/sbin/init - parent of all processes"
37 HOMEPAGE="https://savannah.nongnu.org/projects/sysvinit"
38 @@ -17,7 +18,7 @@ SLOT="0"
39 if [[ ${PV} != *beta* ]] ; then
40 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
41 fi
42 -IUSE="selinux ibm static"
43 +IUSE="selinux ibm nls static"
44
45 COMMON_DEPEND="
46 selinux? (
47 @@ -30,9 +31,9 @@ DEPEND="${COMMON_DEPEND}
48 RDEPEND="${COMMON_DEPEND}
49 !<sys-apps/openrc-0.13
50 selinux? ( sec-policy/selinux-shutdown )"
51 -# We did have po4a for translations for a bit but clashes with i18n package
52 -# Leave it for now. bug #836362
53 -BDEPEND="verify-sig? ( sec-keys/openpgp-keys-sysvinit )"
54 +# po4a is for man page translations
55 +BDEPEND="nls? ( app-text/po4a )
56 + verify-sig? ( sec-keys/openpgp-keys-sysvinit )"
57
58 PATCHES=(
59 # bug #80220
60 @@ -92,6 +93,17 @@ src_prepare() {
61 if [[ ${#insert[@]} -gt 0 ]] ; then
62 printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
63 fi
64 +
65 + delete_unused_locale() {
66 + local locale=${1}
67 +
68 + einfo "Deleting non-requested man page translations for locale=${locale}"
69 + rm "${S}"/man/po/${locale}.po || die
70 +
71 + sed -i -e "/^\[po4a_langs\]/ s:${locale}::" "${S}"/man/po/po4a.cfg || die
72 + }
73 +
74 + plocale_for_each_disabled_locale delete_unused_locale
75 }
76
77 src_compile() {
78 @@ -105,6 +117,11 @@ src_compile() {
79
80 use static && append-ldflags -static
81 emake -C src $(usex selinux 'WITH_SELINUX=yes' '')
82 +
83 + if use nls && [[ -n "$(plocale_get_locales)" ]] ; then
84 + cd man/po || die
85 + po4a po4a.cfg || die
86 + fi
87 }
88
89 src_install() {
90 @@ -122,6 +139,16 @@ src_install() {
91
92 keepdir /etc/inittab.d
93
94 + if use nls && [[ -n "$(plocale_get_locales)" ]] ; then
95 + install_locale_man_pages() {
96 + local locale=${1}
97 +
98 + doman -i18n=${locale} man/po/${locale}/*
99 + }
100 +
101 + plocale_for_each_locale install_locale_man_pages
102 + fi
103 +
104 # Dead symlink
105 find "${ED}" -xtype l -delete || die