Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/openrc/
Date: Tue, 07 Jun 2022 23:41:36
Message-Id: 1654645098.257a0f1be2e13c7a4f8ccefc37c37391c2eb3edb.williamh@gentoo
1 commit: 257a0f1be2e13c7a4f8ccefc37c37391c2eb3edb
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 7 23:37:56 2022 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 7 23:38:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=257a0f1b
7
8 sys-apps/openrc: add 0.45
9
10 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
11
12 sys-apps/openrc/Manifest | 1 +
13 sys-apps/openrc/openrc-0.45.ebuild | 170 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 171 insertions(+)
15
16 diff --git a/sys-apps/openrc/Manifest b/sys-apps/openrc/Manifest
17 index b7c0f9bc1c43..78b6125311fc 100644
18 --- a/sys-apps/openrc/Manifest
19 +++ b/sys-apps/openrc/Manifest
20 @@ -1 +1,2 @@
21 DIST openrc-0.44.10.tar.gz 254298 BLAKE2B 3cfecc27b560b8bb60d2104ab3dcf176b98677b65b829fa403ad2eb0e2e8bb0d586d374c336328a07c2f35e3abcb3f897cf5df142540a60fc09883aabd0ac79d SHA512 0e41f5268c6b8c325a6773511ca58c38ba52a1987aa47165794df8a99359bd1bfcb99d30e0d129b9242a2661663234f6f85c92c55c891dbb6c5b8a11d93edea4
22 +DIST openrc-0.45.tar.gz 246553 BLAKE2B 33900e9269c64a2d3cbc53a14beb907547c8d6ba84f708600a181f8b0ecd13f57039059858f38d0a7a2465e0be489d8a71ca30d2a5df113f779c4d20ef4bb643 SHA512 ed47bbaabac37de300a5b3d5fe4c24887615ed402c92fb0a92991f0d8d17a330e424cde8b82c99b9b1156e8c8198cc4f587d0e3f162dff14d1bd5400e959d5d2
23
24 diff --git a/sys-apps/openrc/openrc-0.45.ebuild b/sys-apps/openrc/openrc-0.45.ebuild
25 new file mode 100644
26 index 000000000000..0be02cfdbdbb
27 --- /dev/null
28 +++ b/sys-apps/openrc/openrc-0.45.ebuild
29 @@ -0,0 +1,170 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=8
34 +
35 +inherit meson pam
36 +
37 +DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
38 +HOMEPAGE="https://github.com/openrc/openrc/"
39 +
40 +if [[ ${PV} =~ ^9{4,}$ ]]; then
41 + EGIT_REPO_URI="https://github.com/OpenRC/${PN}.git"
42 + inherit git-r3
43 +else
44 + SRC_URI="https://github.com/OpenRC/openrc/archive/${PV}.tar.gz -> ${P}.tar.gz"
45 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
46 +fi
47 +
48 +LICENSE="BSD-2"
49 +SLOT="0"
50 +IUSE="audit bash debug ncurses pam newnet +netifrc selinux sysv-utils unicode"
51 +
52 +COMMON_DEPEND="
53 + ncurses? ( sys-libs/ncurses:0= )
54 + pam? ( sys-libs/pam )
55 + audit? ( sys-process/audit )
56 + sys-process/psmisc
57 + selinux? (
58 + sys-apps/policycoreutils
59 + >=sys-libs/libselinux-2.6
60 + )"
61 +DEPEND="${COMMON_DEPEND}
62 + virtual/os-headers
63 + ncurses? ( virtual/pkgconfig )"
64 +RDEPEND="${COMMON_DEPEND}
65 + bash? ( app-shells/bash )
66 + !prefix? (
67 + sysv-utils? (
68 + !sys-apps/systemd[sysv-utils(-)]
69 + !sys-apps/sysvinit
70 + )
71 + !sysv-utils? ( >=sys-apps/sysvinit-2.86-r6[selinux?] )
72 + virtual/tmpfiles
73 + )
74 + selinux? (
75 + >=sec-policy/selinux-base-policy-2.20170204-r4
76 + >=sec-policy/selinux-openrc-2.20170204-r4
77 + )
78 +"
79 +
80 +PDEPEND="netifrc? ( net-misc/netifrc )"
81 +
82 +src_configure() {
83 + local emesonargs=(
84 + $(meson_feature audit)
85 + "-Dbranding=\"Gentoo Linux\""
86 + $(meson_use newnet)
87 + -Dos=Linux
88 + $(meson_use pam)
89 + $(meson_feature selinux)
90 + -Drootprefix="${EPREFIX}"
91 + -Dshell=$(usex bash /bin/bash /bin/sh)
92 + $(meson_use sysv-utils sysvinit)
93 + -Dtermcap=$(usev ncurses)
94 + )
95 + # export DEBUG=$(usev debug)
96 + meson_src_configure
97 +}
98 +
99 +# set_config <file> <option name> <yes value> <no value> test
100 +# a value of "#" will just comment out the option
101 +set_config() {
102 + local file="${ED}/$1" var=$2 val com
103 + eval "${@:5}" && val=$3 || val=$4
104 + [[ ${val} == "#" ]] && com="#" && val='\2'
105 + sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
106 +}
107 +
108 +set_config_yes_no() {
109 + set_config "$1" "$2" YES NO "${@:3}"
110 +}
111 +
112 +src_install() {
113 + meson_install
114 +
115 + keepdir /lib/rc/tmp
116 +
117 + # Setup unicode defaults for silly unicode users
118 + set_config_yes_no /etc/rc.conf unicode use unicode
119 +
120 + # Cater to the norm
121 + set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
122 +
123 + # On HPPA, do not run consolefont by default (bug #222889)
124 + if use hppa; then
125 + rm -f "${ED}"/etc/runlevels/boot/consolefont
126 + fi
127 +
128 + # Support for logfile rotation
129 + insinto /etc/logrotate.d
130 + newins "${FILESDIR}"/openrc.logrotate openrc
131 +
132 + if use pam; then
133 + # install gentoo pam.d files
134 + newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
135 + newpamd "${FILESDIR}"/start-stop-daemon.pam supervise-daemon
136 + fi
137 +
138 + # install documentation
139 + dodoc *.md
140 +}
141 +
142 +pkg_preinst() {
143 + # avoid default thrashing in conf.d files when possible #295406
144 + if [[ -e "${EROOT}"/etc/conf.d/hostname ]] ; then
145 + (
146 + unset hostname HOSTNAME
147 + source "${EROOT}"/etc/conf.d/hostname
148 + : ${hostname:=${HOSTNAME}}
149 + [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
150 + )
151 + fi
152 +
153 + # set default interactive shell to sulogin if it exists
154 + set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
155 + return 0
156 +}
157 +
158 +pkg_postinst() {
159 + if use hppa; then
160 + elog "Setting the console font does not work on all HPPA consoles."
161 + elog "You can still enable it by running:"
162 + elog "# rc-update add consolefont boot"
163 + fi
164 +
165 + if ! use newnet && ! use netifrc; then
166 + ewarn "You have emerged OpenRc without network support. This"
167 + ewarn "means you need to SET UP a network manager such as"
168 + ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/connman,"
169 + ewarn " net-misc/NetworkManager, or net-vpn/badvpn."
170 + ewarn "Or, you have the option of emerging openrc with the newnet"
171 + ewarn "use flag and configuring /etc/conf.d/network and"
172 + ewarn "/etc/conf.d/staticroute if you only use static interfaces."
173 + ewarn
174 + fi
175 +
176 + if use newnet && [ ! -e "${EROOT}"/etc/runlevels/boot/network ]; then
177 + ewarn "Please add the network service to your boot runlevel"
178 + ewarn "as soon as possible. Not doing so could leave you with a system"
179 + ewarn "without networking."
180 + ewarn
181 + fi
182 +
183 + # added for 0.45 to handle seedrng/urandom switching (2022-06-07)
184 + for v in ${REPLACING_VERSIONS}; do
185 + [[ -x $(type rc-update) ]] || continue
186 + if ver_test $v -lt 0.45; then
187 + if rc-update show boot | grep -q urandom; then
188 + rc-update del urandom boot
189 + rc-update add seedrng boot
190 + fi
191 + fi
192 + if ver_test $v -gt 0.45; then
193 + if rc-update show boot | grep -q seedrng; then
194 + rc-update del seedrng boot
195 + rc-update add urandom boot
196 + fi
197 + fi
198 + done
199 +}