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: Fri, 02 Mar 2018 01:56:02
Message-Id: 1519955602.085810d333aeec2e42d6019a17f710365554c608.williamh@gentoo
1 commit: 085810d333aeec2e42d6019a17f710365554c608
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 2 01:53:22 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 2 01:53:22 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=085810d3
7
8 sys-apps/openrc: 0.35.2 bump
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 sys-apps/openrc/Manifest | 1 +
13 sys-apps/openrc/openrc-0.35.2.ebuild | 331 +++++++++++++++++++++++++++++++++++
14 2 files changed, 332 insertions(+)
15
16 diff --git a/sys-apps/openrc/Manifest b/sys-apps/openrc/Manifest
17 index e779df1669c..9d58fb82ce3 100644
18 --- a/sys-apps/openrc/Manifest
19 +++ b/sys-apps/openrc/Manifest
20 @@ -1,3 +1,4 @@
21 DIST openrc-0.34.11.tar.gz 228054 BLAKE2B 8d4fdd7de4b3c44df0ccec728b91bd2624582dc2bbdb1fa7892aa61ce0a953a7cf66964f38da888636d895e3c6b776747a4a7fbbdbbbd26029313695f35837fe SHA512 76245d31c6fe9e90e5e2f35ce918b915fc88c231674e0c99dc98b8f3fa120e794900eec9919a0ab029a081b206393246eccb9119a79c90ad6e39325d022928be
22 DIST openrc-0.35.1.tar.gz 241480 BLAKE2B 336c2398bbfecc59dc068481b50d7470fd9ec4435f0b06b1a6787e2a95ab1aea74a8fb97de41989ea6419bac078553e88bfb456d119ca644e0f75b82338de465 SHA512 53013e40021ad8de93db64aec54753f9fc8eb6d4fb61c4d8683450375191ff29c03a9a7607175e201b3f712a84ca7334ad1cc34302822bb8b75097bc95922988
23 +DIST openrc-0.35.2.tar.gz 241600 BLAKE2B 09517a33ea7faf2e59d3a194876a3bb55a2477dde5f7f30915f77c24104531a27e752a59a049929878a115710ecbe1ed116e4283357f88c65cbe130787b88220 SHA512 61282509bae087a6c94a1947a30eddfa633cd2dbc91392511daa7240318d9f0c0a231005e329b6e46eece194fe497071f40387bea46d27ef09db9eb6e92f07d6
24 DIST openrc-0.35.tar.gz 241364 BLAKE2B b7655f3e7ba21d4af96c7f72e02cc44c557cb6465fcb0d7912a08fdde5af603dcc3551694b89641d58c749453f032ef4224d18fd36bc1b5e27dd97e8cd9bd664 SHA512 a95f11eb8c7b154044fa720f803dc158bcd993a3ce28cd465fab44d9f40555e45a160ea2e923a89161ab43673a95920970ea00cdc34c652efd68ec22a2577cbc
25
26 diff --git a/sys-apps/openrc/openrc-0.35.2.ebuild b/sys-apps/openrc/openrc-0.35.2.ebuild
27 new file mode 100644
28 index 00000000000..8c7c2151f6b
29 --- /dev/null
30 +++ b/sys-apps/openrc/openrc-0.35.2.ebuild
31 @@ -0,0 +1,331 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +inherit flag-o-matic pam toolchain-funcs
38 +
39 +DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
40 +HOMEPAGE="https://github.com/openrc/openrc/"
41 +
42 +if [[ ${PV} == "9999" ]]; then
43 + EGIT_REPO_URI="https://github.com/OpenRC/${PN}.git"
44 + inherit git-r3
45 +else
46 + SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
47 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
48 +fi
49 +
50 +LICENSE="BSD-2"
51 +SLOT="0"
52 +IUSE="audit debug ncurses pam newnet prefix +netifrc selinux static-libs
53 + unicode kernel_linux kernel_FreeBSD"
54 +
55 +COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
56 + ncurses? ( sys-libs/ncurses:0= )
57 + pam? (
58 + sys-auth/pambase
59 + virtual/pam
60 + )
61 + audit? ( sys-process/audit )
62 + kernel_linux? (
63 + sys-process/psmisc
64 + !<sys-process/procps-3.3.9-r2
65 + )
66 + selinux? (
67 + sys-apps/policycoreutils
68 + >=sys-libs/libselinux-2.6
69 + )
70 + !<sys-apps/baselayout-2.1-r1
71 + !<sys-fs/udev-init-scripts-27"
72 +DEPEND="${COMMON_DEPEND}
73 + virtual/os-headers
74 + ncurses? ( virtual/pkgconfig )"
75 +RDEPEND="${COMMON_DEPEND}
76 + !prefix? (
77 + kernel_linux? (
78 + >=sys-apps/sysvinit-2.86-r6[selinux?]
79 + virtual/tmpfiles
80 + )
81 + kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
82 + )
83 + selinux? (
84 + >=sec-policy/selinux-base-policy-2.20170204-r4
85 + >=sec-policy/selinux-openrc-2.20170204-r4
86 + )
87 + !<app-shells/gentoo-bashcomp-20140911-r1
88 + !<app-shells/gentoo-zsh-completions-20180228
89 +"
90 +
91 +PDEPEND="netifrc? ( net-misc/netifrc )"
92 +
93 +src_prepare() {
94 + default
95 +
96 + sed -i 's:0444:0644:' mk/sys.mk || die
97 +
98 + if [[ ${PV} == "9999" ]] ; then
99 + local ver="git-${EGIT_VERSION:0:6}"
100 + sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
101 + fi
102 +}
103 +
104 +src_compile() {
105 + unset LIBDIR #266688
106 +
107 + MAKE_ARGS="${MAKE_ARGS}
108 + LIBNAME=$(get_libdir)
109 + LIBEXECDIR=${EPREFIX}/lib/rc
110 + MKBASHCOMP=yes
111 + MKNET=$(usex newnet)
112 + MKSELINUX=$(usex selinux)
113 + MKAUDIT=$(usex audit)
114 + MKPAM=$(usev pam)
115 + MKSTATICLIBS=$(usex static-libs)
116 + MKZSHCOMP=yes"
117 +
118 + local brand="Unknown"
119 + if use kernel_linux ; then
120 + MAKE_ARGS="${MAKE_ARGS} OS=Linux"
121 + brand="Linux"
122 + elif use kernel_FreeBSD ; then
123 + MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
124 + brand="FreeBSD"
125 + fi
126 + export BRANDING="Gentoo ${brand}"
127 + use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
128 + export DEBUG=$(usev debug)
129 + export MKTERMCAP=$(usev ncurses)
130 +
131 + tc-export CC AR RANLIB
132 + emake ${MAKE_ARGS}
133 +}
134 +
135 +# set_config <file> <option name> <yes value> <no value> test
136 +# a value of "#" will just comment out the option
137 +set_config() {
138 + local file="${ED}/$1" var=$2 val com
139 + eval "${@:5}" && val=$3 || val=$4
140 + [[ ${val} == "#" ]] && com="#" && val='\2'
141 + sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
142 +}
143 +
144 +set_config_yes_no() {
145 + set_config "$1" "$2" YES NO "${@:3}"
146 +}
147 +
148 +src_install() {
149 + emake ${MAKE_ARGS} DESTDIR="${D}" install
150 +
151 + # move the shared libs back to /usr so ldscript can install
152 + # more of a minimal set of files
153 + # disabled for now due to #270646
154 + #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
155 + #gen_usr_ldscript -a einfo rc
156 + gen_usr_ldscript libeinfo.so
157 + gen_usr_ldscript librc.so
158 +
159 + if ! use kernel_linux; then
160 + keepdir /lib/rc/init.d
161 + fi
162 + keepdir /lib/rc/tmp
163 +
164 + # Backup our default runlevels
165 + dodir /usr/share/"${PN}"
166 + cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
167 + rm -rf "${ED}"/etc/runlevels
168 +
169 + # Setup unicode defaults for silly unicode users
170 + set_config_yes_no /etc/rc.conf unicode use unicode
171 +
172 + # Cater to the norm
173 + set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
174 +
175 + # On HPPA, do not run consolefont by default (bug #222889)
176 + if use hppa; then
177 + rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
178 + fi
179 +
180 + # Support for logfile rotation
181 + insinto /etc/logrotate.d
182 + newins "${FILESDIR}"/openrc.logrotate openrc
183 +
184 + # install gentoo pam.d files
185 + newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
186 + newpamd "${FILESDIR}"/start-stop-daemon.pam supervise-daemon
187 +
188 + # install documentation
189 + dodoc ChangeLog *.md
190 + if use newnet; then
191 + dodoc README.newnet
192 + fi
193 +}
194 +
195 +add_boot_init() {
196 + local initd=$1
197 + local runlevel=${2:-boot}
198 + # if the initscript is not going to be installed and is not
199 + # currently installed, return
200 + [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
201 + || return
202 + [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
203 +
204 + # if runlevels dont exist just yet, then create it but still flag
205 + # to pkg_postinst that it needs real setup #277323
206 + if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
207 + mkdir -p "${EROOT}"etc/runlevels/${runlevel}
208 + touch "${EROOT}"etc/runlevels/.add_boot_init.created
209 + fi
210 +
211 + elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
212 + ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
213 +}
214 +add_boot_init_mit_config() {
215 + local config=$1 initd=$2
216 + if [[ -e ${EROOT}${config} ]] ; then
217 + if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
218 + add_boot_init ${initd}
219 + fi
220 + fi
221 +}
222 +
223 +pkg_preinst() {
224 + local f LIBDIR=$(get_libdir)
225 +
226 + # avoid default thrashing in conf.d files when possible #295406
227 + if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
228 + (
229 + unset hostname HOSTNAME
230 + source "${EROOT}"etc/conf.d/hostname
231 + : ${hostname:=${HOSTNAME}}
232 + [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
233 + )
234 + fi
235 +
236 + # set default interactive shell to sulogin if it exists
237 + set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
238 +
239 + # termencoding was added in 0.2.1 and needed in boot
240 + has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
241 +
242 + # swapfiles was added in 0.9.9 and needed in boot (february 2012)
243 + has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
244 +
245 + if ! has_version ">=sys-apps/openrc-0.11"; then
246 + add_boot_init sysfs sysinit
247 + fi
248 +
249 + if ! has_version ">=sys-apps/openrc-0.11.3" ; then
250 + migrate_udev_mount_script
251 + add_boot_init tmpfiles.setup boot
252 + fi
253 +
254 + # these were added in 0.12.
255 + if ! has_version ">=sys-apps/openrc-0.12"; then
256 + add_boot_init loopback
257 + add_boot_init tmpfiles.dev sysinit
258 +
259 + # ensure existing /etc/conf.d/net is not removed
260 + # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
261 + # this needs to stay in openrc ebuilds for a long time. :(
262 + # Added in 0.12.
263 + if [[ -f "${EROOT}"etc/conf.d/net ]]; then
264 + einfo "Modifying conf.d/net to keep it from being removed"
265 + cat <<-EOF >>"${EROOT}"etc/conf.d/net
266 +
267 +# The network scripts are now part of net-misc/netifrc
268 +# In order to avoid sys-apps/${P} from removing this file, this comment was
269 +# added; you can safely remove this comment. Please see
270 +# /usr/share/doc/netifrc*/README* for more information.
271 +EOF
272 + fi
273 + fi
274 + has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
275 +
276 + if ! has_version ">=sys-apps/openrc-0.18.3"; then
277 + add_boot_init mtab
278 + if [[ -f "${EROOT}"etc/mtab ]] && [[ ! -L "${EROOT}"etc/mtab ]]; then
279 + ewarn "${EROOT}etc/mtab will be replaced with a"
280 + ewarn "symbolic link to /proc/self/mounts on the next"
281 + ewarn "reboot."
282 + ewarn "Change the setting in ${EROOT}etc/conf.d/mtab"
283 + ewarn "if you do not want this to happen."
284 + fi
285 + fi
286 +
287 + has_version ">=sys-apps/openrc-0.35" || add_boot_init cgroups sysinit
288 +
289 +}
290 +
291 +# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
292 +migrate_udev_mount_script() {
293 + if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
294 + ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
295 + add_boot_init udev-mount sysinit
296 + fi
297 + return 0
298 +}
299 +
300 +pkg_postinst() {
301 + local LIBDIR=$(get_libdir)
302 +
303 + # Make our runlevels if they don't exist
304 + if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
305 + einfo "Copying across default runlevels"
306 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
307 + rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
308 + else
309 + if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
310 + mkdir -p "${EROOT}"etc/runlevels/sysinit
311 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
312 + "${EROOT}"etc/runlevels/sysinit
313 + fi
314 + if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
315 + mkdir -p "${EROOT}"etc/runlevels/shutdown
316 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
317 + "${EROOT}"etc/runlevels/shutdown
318 + fi
319 + if [[ ! -e "${EROOT}"etc/runlevels/nonetwork/local ]]; then
320 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels/nonetwork \
321 + "${EROOT}"etc/runlevels
322 + fi
323 + fi
324 +
325 + if use hppa; then
326 + elog "Setting the console font does not work on all HPPA consoles."
327 + elog "You can still enable it by running:"
328 + elog "# rc-update add consolefont boot"
329 + fi
330 +
331 + # Added for 0.35.
332 + if use kernel_linux && [[ ! -h "${EROOT}"/lib ]]; then
333 + if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
334 + cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
335 + fi
336 + elif ! use kernel_linux; then
337 + if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
338 + cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
339 + fi
340 + fi
341 +
342 + # update the dependency tree after touching all files #224171
343 + [[ "${EROOT}" = "/" ]] && "${EROOT}"/lib/rc/bin/rc-depend -u
344 +
345 + if ! use newnet && ! use netifrc; then
346 + ewarn "You have emerged OpenRc without network support. This"
347 + ewarn "means you need to SET UP a network manager such as"
348 + ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
349 + ewarn "net-misc/NetworkManager, or net-vpn/badvpn."
350 + ewarn "Or, you have the option of emerging openrc with the newnet"
351 + ewarn "use flag and configuring /etc/conf.d/network and"
352 + ewarn "/etc/conf.d/staticroute if you only use static interfaces."
353 + ewarn
354 + fi
355 +
356 + if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
357 + ewarn "Please add the network service to your boot runlevel"
358 + ewarn "as soon as possible. Not doing so could leave you with a system"
359 + ewarn "without networking."
360 + ewarn
361 + fi
362 +}