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