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