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