Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/sysvinit/
Date: Tue, 29 Mar 2022 05:29:40
Message-Id: 1648531758.43da0ef9e9ba894ef97788623be1b1d104da6c35.sam@gentoo
1 commit: 43da0ef9e9ba894ef97788623be1b1d104da6c35
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 29 04:48:50 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 29 05:29:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43da0ef9
7
8 sys-apps/sysvinit: add 3.02
9
10 Note this drops the 'shutdown' patch given QEMU has been fixed
11 (the impetus for the original bug) and the patch no longer applies --
12 to rebase it, we'd need to adapt the new translations and then always
13 have to regenerate them too. Not worth it given the original problem
14 is gone.
15
16 (Although, that said, it looks like the translations aren't
17 bundled generated anyway, so we ended up adding USE=nls for po4a for now.)
18
19 Bug: https://bugs.gentoo.org/449354
20 Signed-off-by: Sam James <sam <AT> gentoo.org>
21
22 sys-apps/sysvinit/Manifest | 2 +
23 sys-apps/sysvinit/metadata.xml | 19 ++--
24 sys-apps/sysvinit/sysvinit-3.02.ebuild | 175 +++++++++++++++++++++++++++++++++
25 3 files changed, 188 insertions(+), 8 deletions(-)
26
27 diff --git a/sys-apps/sysvinit/Manifest b/sys-apps/sysvinit/Manifest
28 index 439c1fbdc297..4aa02107a44b 100644
29 --- a/sys-apps/sysvinit/Manifest
30 +++ b/sys-apps/sysvinit/Manifest
31 @@ -1,3 +1,5 @@
32 DIST sysvinit-2.99.tar.xz 126908 BLAKE2B b82c745d5b695f918d4a163e7b9eaceccc07a46f73c3782c7771cc29a8600be13de4ff30891086df5773d60f37fa3b0f58566ccaf72cd70af68083b51152a38b SHA512 34f328d7d2e6ceddcddfebab49eb9c34e90dc96decf2caeb89dffd2ade54322fa4a3cb9fa1e1a4bc687e07fcb0a13e5aebe6186582a9f5c9153e1513baa87ddd
33 DIST sysvinit-3.00.tar.xz 127072 BLAKE2B d1c4e509d7c13cf0fb9da290f875e7c0ab0666d843d75d4dd6885112248a859dd077bdf9cc926c4af58473da99a5229bb879c7094afd648d5ebe72597a3ba6a7 SHA512 ba834ac6c48528304373018bfb05dcdd3573d8081dd7dc95a44808804404d77ee4832fedb3f34e67d87f22f201f9526c54910a51c6ed2a42ac55b756843cd825
34 DIST sysvinit-3.01.tar.xz 126616 BLAKE2B b991c6d2a09b02003cc587379b148f8ca3817c27fcaf81f184f679cfd5325e0b551484bba47bb554a34c7eeba60538f4943de49b1d59bd4bef73d7d086fefdb2 SHA512 66da3830aa32b70f0beea994213145a550e5b5d58a5b54afb17109243d5efface6aba8c296b76dbfb22ce6f86c9c58f237ff71ee04ec7d5b316ad412bf7acbcf
35 +DIST sysvinit-3.02.tar.xz 219560 BLAKE2B c68505aab9e257fa3fb4153b4d2a51a7a8ac0137f0ee21174c168b1a1e4f12ea6be53679c484e2ea31904a37cd94fb5d913a9885da6c618acdae566b70bb7fae SHA512 44a43e2faff3a0d3410447ffc9b8b7c66eae1a5cba54c2c4d8518d3b2e5accecc68a280c87dbf6d18f943ae466c3c1e09bc633009207cbd777d371effda30831
36 +DIST sysvinit-3.02.tar.xz.sig 833 BLAKE2B 07f86211d2ded8afea22df246140cb44ec4a949c2450b1cc9d996b4b582da7767726648595c5f1cf584c31c0c59c4b0915a22cc254fed56bd42ac155b544cbfc SHA512 9b8a2b3e480041ead8bd2b16551fb00e387d823ad196cf60f6938eda5accf33e944b7b530d47bc0bdd90de6766cf8d44050c0c3d95b18c8b76d412d0a6c3121a
37
38 diff --git a/sys-apps/sysvinit/metadata.xml b/sys-apps/sysvinit/metadata.xml
39 index 244cfb040246..f085bc59b51f 100644
40 --- a/sys-apps/sysvinit/metadata.xml
41 +++ b/sys-apps/sysvinit/metadata.xml
42 @@ -1,12 +1,15 @@
43 <?xml version="1.0" encoding="UTF-8"?>
44 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
45 <pkgmetadata>
46 -<maintainer type="person">
47 - <email>williamh@g.o</email>
48 - <name>William Hubbs</name>
49 -</maintainer>
50 -<maintainer type="project">
51 - <email>base-system@g.o</email>
52 - <name>Gentoo Base System</name>
53 -</maintainer>
54 + <maintainer type="person">
55 + <email>williamh@g.o</email>
56 + <name>William Hubbs</name>
57 + </maintainer>
58 + <maintainer type="project">
59 + <email>base-system@g.o</email>
60 + <name>Gentoo Base System</name>
61 + </maintainer>
62 + <upstream>
63 + <remote-id type="github">slicer69/sysvinit</remote-id>
64 + </upstream>
65 </pkgmetadata>
66
67 diff --git a/sys-apps/sysvinit/sysvinit-3.02.ebuild b/sys-apps/sysvinit/sysvinit-3.02.ebuild
68 new file mode 100644
69 index 000000000000..44203391cf14
70 --- /dev/null
71 +++ b/sys-apps/sysvinit/sysvinit-3.02.ebuild
72 @@ -0,0 +1,175 @@
73 +# Copyright 1999-2022 Gentoo Authors
74 +# Distributed under the terms of the GNU General Public License v2
75 +
76 +EAPI=7
77 +
78 +PLOCALES="de es fi fr hu id pl"
79 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/sysvinit.asc
80 +inherit toolchain-funcs flag-o-matic plocale verify-sig
81 +
82 +DESCRIPTION="/sbin/init - parent of all processes"
83 +HOMEPAGE="https://savannah.nongnu.org/projects/sysvinit"
84 +SRC_URI="mirror://nongnu/${PN}/${P/_/-}.tar.xz"
85 +SRC_URI+=" verify-sig? ( mirror://nongnu/${PN}/${P/_/-}.tar.xz.sig )"
86 +S="${WORKDIR}/${P/_*}"
87 +
88 +LICENSE="GPL-2"
89 +SLOT="0"
90 +if [[ ${PV} != *beta* ]] ; then
91 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
92 +fi
93 +IUSE="selinux ibm nls static"
94 +
95 +COMMON_DEPEND="
96 + selinux? (
97 + >=sys-libs/libselinux-1.28
98 + )"
99 +DEPEND="${COMMON_DEPEND}
100 + virtual/os-headers"
101 +RDEPEND="${COMMON_DEPEND}
102 + selinux? ( sec-policy/selinux-shutdown )"
103 +# po4a is for man page translations
104 +BDEPEND="nls? ( app-text/po4a )
105 + verify-sig? ( sec-keys/openpgp-keys-sysvinit )"
106 +
107 +PATCHES=(
108 + # bug #80220
109 + "${FILESDIR}/${PN}-2.86-kexec.patch"
110 + # bug #158615
111 + "${FILESDIR}/${PN}-2.94_beta-shutdown-single.patch"
112 +)
113 +
114 +src_prepare() {
115 + default
116 +
117 + sed -i \
118 + -e '/^CPPFLAGS =$/d' \
119 + -e '/^override CFLAGS +=/s/ -fstack-protector-strong//' \
120 + src/Makefile || die
121 +
122 + # last/lastb/mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux
123 + sed -i -r \
124 + -e '/^(USR)?S?BIN/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \
125 + -e '/^MAN[18]/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \
126 + src/Makefile || die
127 +
128 + # pidof has moved to >=procps-3.3.9
129 + sed -i -r \
130 + -e '/\/bin\/pidof/d' \
131 + -e '/^MAN8/s:\<pidof.8\>::g' \
132 + src/Makefile || die
133 +
134 + # logsave is already in e2fsprogs
135 + sed -i -r \
136 + -e '/^(USR)?S?BIN/s:\<logsave\>::g' \
137 + -e '/^MAN8/s:\<logsave.8\>::g' \
138 + src/Makefile || die
139 +
140 + # Mung inittab for specific architectures
141 + cd "${WORKDIR}" || die
142 + cp "${FILESDIR}"/inittab-2.98-r1 inittab || die "cp inittab"
143 + local insert=()
144 + use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
145 + use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
146 + use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
147 + use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
148 + use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
149 + if use ibm ; then
150 + insert+=(
151 + '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
152 + '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
153 + )
154 + fi
155 + (use arm || use mips || use sparc) && sed -i '/ttyS0/s:#::' inittab
156 + if use x86 || use amd64 ; then
157 + sed -i \
158 + -e '/ttyS[01]/s:9600:115200:' \
159 + inittab
160 + fi
161 +
162 + if [[ ${#insert[@]} -gt 0 ]] ; then
163 + printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
164 + fi
165 +
166 + delete_unused_locale() {
167 + local locale=${1}
168 +
169 + einfo "Deleting non-requested man page translations for locale=${locale}"
170 + rm "${S}"/man/po/${locale}.po || die
171 +
172 + sed -i -e "/^\[po4a_langs\]/ s:${locale}::" "${S}"/man/po/po4a.cfg || die
173 + }
174 +
175 + plocale_for_each_disabled_locale delete_unused_locale
176 +}
177 +
178 +src_compile() {
179 + tc-export CC
180 +
181 + append-lfs-flags
182 +
183 + # bug #381311
184 + export DISTRO=
185 + export VERSION="${PV}"
186 +
187 + use static && append-ldflags -static
188 + emake -C src $(usex selinux 'WITH_SELINUX=yes' '')
189 +
190 + if use nls && [[ -n "$(plocale_get_locales)" ]] ; then
191 + cd man/po || die
192 + po4a po4a.cfg || die
193 + fi
194 +}
195 +
196 +src_install() {
197 + emake -C src install ROOT="${D}"
198 + dodoc README doc/*
199 +
200 + insinto /etc
201 + doins "${WORKDIR}"/inittab
202 +
203 + newinitd "${FILESDIR}"/bootlogd.initd bootlogd
204 + newconfd "${FILESDIR}"/bootlogd.confd bootlogd
205 +
206 + into /
207 + dosbin "${FILESDIR}"/halt.sh
208 +
209 + keepdir /etc/inittab.d
210 +
211 + if use nls && [[ -n "$(plocale_get_locales)" ]] ; then
212 + install_locale_man_pages() {
213 + local locale=${1}
214 +
215 + doman -i18n=${locale} man/po/${locale}/*
216 + }
217 +
218 + plocale_for_each_locale install_locale_man_pages
219 + fi
220 +
221 + # Dead symlink
222 + find "${ED}" -xtype l -delete || die
223 +
224 + find "${ED}" -type d -empty -delete || die
225 +}
226 +
227 +pkg_postinst() {
228 + # Reload init to fix unmounting problems of / on next reboot.
229 + # This is really needed, as without the new version of init cause init
230 + # not to quit properly on reboot, and causes a fsck of / on next reboot.
231 + if [[ -z ${ROOT} ]] ; then
232 + if [[ -e /dev/initctl ]] && [[ ! -e /run/initctl ]] ; then
233 + ln -s /dev/initctl /run/initctl \
234 + || ewarn "Failed to set /run/initctl symlink!"
235 + fi
236 + # Do not return an error if this fails
237 + /sbin/telinit U &>/dev/null
238 + fi
239 +
240 + elog "The last/lastb/mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to"
241 + elog "sys-apps/util-linux. The pidof tool has been moved to sys-process/procps."
242 +
243 + # Required for new bootlogd service
244 + if [[ ! -e "${EROOT}/var/log/boot" ]] ; then
245 + touch "${EROOT}/var/log/boot"
246 + fi
247 +}