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, 28 Jun 2018 18:28:12
Message-Id: 1530210395.f12959e48cb787bee968a6a0a6463628f6c88c98.williamh@gentoo
1 commit: f12959e48cb787bee968a6a0a6463628f6c88c98
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 28 18:23:21 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 28 18:26:35 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f12959e4
7
8 sys-apps/openrc: 0.38 bump
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 sys-apps/openrc/Manifest | 1 +
13 sys-apps/openrc/openrc-0.38.ebuild | 326 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 327 insertions(+)
15
16 diff --git a/sys-apps/openrc/Manifest b/sys-apps/openrc/Manifest
17 index 070573d7e90..3ac0546b907 100644
18 --- a/sys-apps/openrc/Manifest
19 +++ b/sys-apps/openrc/Manifest
20 @@ -2,3 +2,4 @@ DIST openrc-0.34.11.tar.gz 228054 BLAKE2B 8d4fdd7de4b3c44df0ccec728b91bd2624582d
21 DIST openrc-0.35.5.tar.gz 241784 BLAKE2B 6f63dcf30c430949f25108b0ca808f2317b2e58440419fa5c2aac04ed614c5b22105bfa38d51d54ee0d293be8b11f15b756b00d805ab71f9a2e92f44b98ce6e1 SHA512 655a0a32650ed46998ae84473e8a82aadd9de09904c5173cd9b9e2500fc8935e96539672b513a883c077ae862ece12ab768d4f379dbeb4389a7067ce7121dc0d
22 DIST openrc-0.36.tar.gz 240179 BLAKE2B 1361d22782d6063e7fce61a98ef1e1f754d0208ec58de02ae60a0950531d248ac6e65e1ed45b412c89288103f6848b24aa51dd66232aa46e7900b339cac21a57 SHA512 f4730489e595a9ac4477c2b410e034b4eea2b8111c12c2695916aa04102020f8c84cb24220d3aa552709898035aa196e2fd48cba9b12a71dff1f5c2b03c3d424
23 DIST openrc-0.37.tar.gz 240928 BLAKE2B b802260a3bd71e6d8e6d54b21007024481d42a4f179eff824a39fb91f5b1cd4f7a2fd52d9e7f23b1077965b57d319a99a5b39b8cd2d7f66dfe272b4497d53a22 SHA512 16235774ad28a66308dd1ea00238b4025a4d26c9c0bb6cdb032f28d00479520c4c5fdb349f82d33a535eee3d491d0349b5871b15cae30ef296ec476883965b83
24 +DIST openrc-0.38.tar.gz 241387 BLAKE2B 1fdd1b4d771248c3b067afbc9cc707ddf1ca50de3ebdd81e9d240883604f9e7cdd2ad4450dae7229c2c0d63dd534136ad0e6a6e22774e68895c8c220e87e1164 SHA512 9a0b96a4536e6bf29c0343059146a6f1fac8d98da54fb302a278acd9248d72a5ad55eac0b111ded79f9d7edb8d064f6c5e3d0ee91af47a841f68d3e1ff95f6a7
25
26 diff --git a/sys-apps/openrc/openrc-0.38.ebuild b/sys-apps/openrc/openrc-0.38.ebuild
27 new file mode 100644
28 index 00000000000..7babd0045d3
29 --- /dev/null
30 +++ b/sys-apps/openrc/openrc-0.38.ebuild
31 @@ -0,0 +1,326 @@
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-20180302
88 + !<app-shells/gentoo-zsh-completions-20180228
89 +"
90 +
91 +PDEPEND="netifrc? ( net-misc/netifrc )"
92 +
93 +src_prepare() {
94 + default
95 + if [[ ${PV} == "9999" ]] ; then
96 + local ver="git-${EGIT_VERSION:0:6}"
97 + sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
98 + fi
99 +}
100 +
101 +src_compile() {
102 + unset LIBDIR #266688
103 +
104 + MAKE_ARGS="${MAKE_ARGS}
105 + LIBNAME=$(get_libdir)
106 + LIBEXECDIR=${EPREFIX}/lib/rc
107 + MKBASHCOMP=yes
108 + MKNET=$(usex newnet)
109 + MKSELINUX=$(usex selinux)
110 + MKAUDIT=$(usex audit)
111 + MKPAM=$(usev pam)
112 + MKSTATICLIBS=$(usex static-libs)
113 + MKZSHCOMP=yes"
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 /lib/rc/init.d
158 + fi
159 + keepdir /lib/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 + fi
249 +
250 + # these were added in 0.12.
251 + if ! has_version ">=sys-apps/openrc-0.12"; then
252 + add_boot_init loopback
253 +
254 + # ensure existing /etc/conf.d/net is not removed
255 + # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
256 + # this needs to stay in openrc ebuilds for a long time. :(
257 + # Added in 0.12.
258 + if [[ -f "${EROOT}"etc/conf.d/net ]]; then
259 + einfo "Modifying conf.d/net to keep it from being removed"
260 + cat <<-EOF >>"${EROOT}"etc/conf.d/net
261 +
262 +# The network scripts are now part of net-misc/netifrc
263 +# In order to avoid sys-apps/${P} from removing this file, this comment was
264 +# added; you can safely remove this comment. Please see
265 +# /usr/share/doc/netifrc*/README* for more information.
266 +EOF
267 + fi
268 + fi
269 + has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
270 +
271 + if ! has_version ">=sys-apps/openrc-0.18.3"; then
272 + add_boot_init mtab
273 + if [[ -f "${EROOT}"etc/mtab ]] && [[ ! -L "${EROOT}"etc/mtab ]]; then
274 + ewarn "${EROOT}etc/mtab will be replaced with a"
275 + ewarn "symbolic link to /proc/self/mounts on the next"
276 + ewarn "reboot."
277 + ewarn "Change the setting in ${EROOT}etc/conf.d/mtab"
278 + ewarn "if you do not want this to happen."
279 + fi
280 + fi
281 +
282 + has_version ">=sys-apps/openrc-0.35" || add_boot_init cgroups sysinit
283 +
284 +}
285 +
286 +# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
287 +migrate_udev_mount_script() {
288 + if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
289 + ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
290 + add_boot_init udev-mount sysinit
291 + fi
292 + return 0
293 +}
294 +
295 +pkg_postinst() {
296 + local LIBDIR=$(get_libdir)
297 +
298 + # Make our runlevels if they don't exist
299 + if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
300 + einfo "Copying across default runlevels"
301 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
302 + rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
303 + else
304 + if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
305 + mkdir -p "${EROOT}"etc/runlevels/sysinit
306 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
307 + "${EROOT}"etc/runlevels/sysinit
308 + fi
309 + if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
310 + mkdir -p "${EROOT}"etc/runlevels/shutdown
311 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
312 + "${EROOT}"etc/runlevels/shutdown
313 + fi
314 + if [[ ! -e "${EROOT}"etc/runlevels/nonetwork/local ]]; then
315 + cp -RPp "${EROOT}"usr/share/${PN}/runlevels/nonetwork \
316 + "${EROOT}"etc/runlevels
317 + fi
318 + fi
319 +
320 + if use hppa; then
321 + elog "Setting the console font does not work on all HPPA consoles."
322 + elog "You can still enable it by running:"
323 + elog "# rc-update add consolefont boot"
324 + fi
325 +
326 + # Added for 0.35.
327 + if use kernel_linux && [[ ! -h "${EROOT}"/lib ]]; then
328 + if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
329 + cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
330 + fi
331 + elif ! use kernel_linux; then
332 + if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
333 + cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
334 + fi
335 + fi
336 +
337 + # update the dependency tree after touching all files #224171
338 + [[ "${EROOT}" = "/" ]] && "${EROOT}"/lib/rc/bin/rc-depend -u
339 +
340 + if ! use newnet && ! use netifrc; then
341 + ewarn "You have emerged OpenRc without network support. This"
342 + ewarn "means you need to SET UP a network manager such as"
343 + ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
344 + ewarn "net-misc/NetworkManager, or net-vpn/badvpn."
345 + ewarn "Or, you have the option of emerging openrc with the newnet"
346 + ewarn "use flag and configuring /etc/conf.d/network and"
347 + ewarn "/etc/conf.d/staticroute if you only use static interfaces."
348 + ewarn
349 + fi
350 +
351 + if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
352 + ewarn "Please add the network service to your boot runlevel"
353 + ewarn "as soon as possible. Not doing so could leave you with a system"
354 + ewarn "without networking."
355 + ewarn
356 + fi
357 +}