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, 11 Dec 2018 17:31:10
Message-Id: 1544549437.7896da4d5ae27710b7e05b40b27a440e535f82b1.williamh@gentoo
1 commit: 7896da4d5ae27710b7e05b40b27a440e535f82b1
2 Author: William Hubbs <william.hubbs <AT> sony <DOT> com>
3 AuthorDate: Tue Dec 11 17:27:50 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 11 17:30:37 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7896da4d
7
8 sys-apps/openrc: remove old 0.40 versions
9
10 Package-Manager: Portage-2.3.51, Repoman-2.3.11
11 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
12
13 sys-apps/openrc/Manifest | 2 -
14 sys-apps/openrc/openrc-0.40.1.ebuild | 330 -----------------------------------
15 sys-apps/openrc/openrc-0.40.ebuild | 330 -----------------------------------
16 3 files changed, 662 deletions(-)
17
18 diff --git a/sys-apps/openrc/Manifest b/sys-apps/openrc/Manifest
19 index 8bb3fcb3b9a..a5e1d615f04 100644
20 --- a/sys-apps/openrc/Manifest
21 +++ b/sys-apps/openrc/Manifest
22 @@ -5,6 +5,4 @@ DIST openrc-0.37.tar.gz 240928 BLAKE2B b802260a3bd71e6d8e6d54b21007024481d42a4f1
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.2.tar.gz 242417 BLAKE2B 076834890b084b1dcf33f78e190f8f7163161d99d185d5cb7043dbc33c6ff0861bc4965ccbf63e2f1b173185d4d017d9269066d35cd75cb7c5a090d39be9b833 SHA512 ea1f23bb479085eea406bebe304a531d061e47955f7c98da21aa4f01694b5c6f23cb1bb9764aa7b27fd4c8c5a7602eb2a16baef63eb96660fab58c063ff88129
26 -DIST openrc-0.40.1.tar.gz 244639 BLAKE2B 889e357c1530638da6d1da3597d90a4438a1c48e753fabf2d91306262e684a66ba7a069a26060508f78cb486b76b0dc0c056c73136babe559932afead372ff54 SHA512 add676125187a1c47049cb281c98ee9512093250f8b65b2cf5c706b8a73c23f3ba98c96adda456c3fe930ff679669901b5e1f04ea9dcdcaf3fef13afa2412cdc
27 DIST openrc-0.40.2.tar.gz 245006 BLAKE2B 9e0aab4d42121296cb9bcc47e9222e0e99df80ab686636a8060c6271d30ff7c0d999f851d0e24dfab9e7a6532b56a6a1974cfa4514e88e6b82ec5fbbc192d76c SHA512 746e238f792113397486b9abb6e41c8179e51fe823c82c8e8942d71329a806b9c398628f835e2626ed0e8735c05b0dcd1b82bf9b5111f420105eeae6b0b0e3f2
28 -DIST openrc-0.40.tar.gz 244521 BLAKE2B c9c96ccd98430c8e055702ce0cb68f95a4e73658aebfb09871dda46ce0f2a62b390ea5a3440b793ae71aea071534d4bcf75a2f9b4b71fa992308eacd71771b10 SHA512 95aea0ce1d4caeaecdd4164bb6c37b9f7564573742a06e70e34bf457c00193b04743b0dd9369af23f525afeb777f06612c52720a0962807931213bee51893432
29
30 diff --git a/sys-apps/openrc/openrc-0.40.1.ebuild b/sys-apps/openrc/openrc-0.40.1.ebuild
31 deleted file mode 100644
32 index 03c55deff41..00000000000
33 --- a/sys-apps/openrc/openrc-0.40.1.ebuild
34 +++ /dev/null
35 @@ -1,330 +0,0 @@
36 -# Copyright 1999-2018 Gentoo Authors
37 -# Distributed under the terms of the GNU General Public License v2
38 -
39 -EAPI=6
40 -
41 -inherit flag-o-matic pam toolchain-funcs
42 -
43 -DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
44 -HOMEPAGE="https://github.com/openrc/openrc/"
45 -
46 -if [[ ${PV} == "9999" ]]; then
47 - EGIT_REPO_URI="https://github.com/OpenRC/${PN}.git"
48 - inherit git-r3
49 -else
50 - SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
51 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
52 -fi
53 -
54 -LICENSE="BSD-2"
55 -SLOT="0"
56 -IUSE="audit debug ncurses pam newnet prefix +netifrc selinux static-libs
57 - unicode kernel_linux kernel_FreeBSD"
58 -
59 -COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
60 - ncurses? ( sys-libs/ncurses:0= )
61 - pam? (
62 - sys-auth/pambase
63 - virtual/pam
64 - )
65 - audit? ( sys-process/audit )
66 - kernel_linux? (
67 - sys-process/psmisc
68 - !<sys-process/procps-3.3.9-r2
69 - )
70 - selinux? (
71 - sys-apps/policycoreutils
72 - >=sys-libs/libselinux-2.6
73 - )
74 - !<sys-apps/baselayout-2.1-r1
75 - !<sys-fs/udev-init-scripts-27"
76 -DEPEND="${COMMON_DEPEND}
77 - virtual/os-headers
78 - ncurses? ( virtual/pkgconfig )"
79 -RDEPEND="${COMMON_DEPEND}
80 - !prefix? (
81 - kernel_linux? (
82 - >=sys-apps/sysvinit-2.86-r6[selinux?]
83 - virtual/tmpfiles
84 - )
85 - kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
86 - )
87 - selinux? (
88 - >=sec-policy/selinux-base-policy-2.20170204-r4
89 - >=sec-policy/selinux-openrc-2.20170204-r4
90 - )
91 - !<app-shells/gentoo-bashcomp-20180302
92 - !<app-shells/gentoo-zsh-completions-20180228
93 -"
94 -
95 -PDEPEND="netifrc? ( net-misc/netifrc )"
96 -
97 -src_prepare() {
98 - default
99 - if [[ ${PV} == "9999" ]] ; then
100 - local ver="git-${EGIT_VERSION:0:6}"
101 - sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
102 - fi
103 -}
104 -
105 -src_compile() {
106 - unset LIBDIR #266688
107 -
108 - MAKE_ARGS="${MAKE_ARGS}
109 - LIBNAME=$(get_libdir)
110 - LIBEXECDIR=${EPREFIX}/lib/rc
111 - MKBASHCOMP=yes
112 - MKNET=$(usex newnet)
113 - MKSELINUX=$(usex selinux)
114 - MKAUDIT=$(usex audit)
115 - MKPAM=$(usev pam)
116 - MKSTATICLIBS=$(usex static-libs)
117 - MKZSHCOMP=yes"
118 -
119 - local brand="Unknown"
120 - if use kernel_linux ; then
121 - MAKE_ARGS="${MAKE_ARGS} OS=Linux"
122 - brand="Linux"
123 - elif use kernel_FreeBSD ; then
124 - MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
125 - brand="FreeBSD"
126 - fi
127 - export BRANDING="Gentoo ${brand}"
128 - use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
129 - export DEBUG=$(usev debug)
130 - export MKTERMCAP=$(usev ncurses)
131 -
132 - tc-export CC AR RANLIB
133 - emake ${MAKE_ARGS}
134 -}
135 -
136 -# set_config <file> <option name> <yes value> <no value> test
137 -# a value of "#" will just comment out the option
138 -set_config() {
139 - local file="${ED}/$1" var=$2 val com
140 - eval "${@:5}" && val=$3 || val=$4
141 - [[ ${val} == "#" ]] && com="#" && val='\2'
142 - sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
143 -}
144 -
145 -set_config_yes_no() {
146 - set_config "$1" "$2" YES NO "${@:3}"
147 -}
148 -
149 -src_install() {
150 - emake ${MAKE_ARGS} DESTDIR="${D}" install
151 -
152 - # move the shared libs back to /usr so ldscript can install
153 - # more of a minimal set of files
154 - # disabled for now due to #270646
155 - #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
156 - #gen_usr_ldscript -a einfo rc
157 - gen_usr_ldscript libeinfo.so
158 - gen_usr_ldscript librc.so
159 -
160 - if ! use kernel_linux; then
161 - keepdir /lib/rc/init.d
162 - fi
163 - keepdir /lib/rc/tmp
164 -
165 - # Backup our default runlevels
166 - dodir /usr/share/"${PN}"
167 - cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
168 - rm -rf "${ED}"/etc/runlevels
169 -
170 - # Setup unicode defaults for silly unicode users
171 - set_config_yes_no /etc/rc.conf unicode use unicode
172 -
173 - # Cater to the norm
174 - set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
175 -
176 - # On HPPA, do not run consolefont by default (bug #222889)
177 - if use hppa; then
178 - rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
179 - fi
180 -
181 - # Support for logfile rotation
182 - insinto /etc/logrotate.d
183 - newins "${FILESDIR}"/openrc.logrotate openrc
184 -
185 - # install gentoo pam.d files
186 - newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
187 - newpamd "${FILESDIR}"/start-stop-daemon.pam supervise-daemon
188 -
189 - # install documentation
190 - dodoc ChangeLog *.md
191 - if use newnet; then
192 - dodoc README.newnet
193 - fi
194 -}
195 -
196 -add_boot_init() {
197 - local initd=$1
198 - local runlevel=${2:-boot}
199 - # if the initscript is not going to be installed and is not
200 - # currently installed, return
201 - [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
202 - || return
203 - [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
204 -
205 - # if runlevels dont exist just yet, then create it but still flag
206 - # to pkg_postinst that it needs real setup #277323
207 - if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
208 - mkdir -p "${EROOT}"etc/runlevels/${runlevel}
209 - touch "${EROOT}"etc/runlevels/.add_boot_init.created
210 - fi
211 -
212 - elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
213 - ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
214 -}
215 -add_boot_init_mit_config() {
216 - local config=$1 initd=$2
217 - if [[ -e ${EROOT}${config} ]] ; then
218 - if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
219 - add_boot_init ${initd}
220 - fi
221 - fi
222 -}
223 -
224 -pkg_preinst() {
225 - local f LIBDIR=$(get_libdir)
226 -
227 - # avoid default thrashing in conf.d files when possible #295406
228 - if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
229 - (
230 - unset hostname HOSTNAME
231 - source "${EROOT}"etc/conf.d/hostname
232 - : ${hostname:=${HOSTNAME}}
233 - [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
234 - )
235 - fi
236 -
237 - # set default interactive shell to sulogin if it exists
238 - set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
239 -
240 - # termencoding was added in 0.2.1 and needed in boot
241 - has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
242 -
243 - # swapfiles was added in 0.9.9 and needed in boot (february 2012)
244 - has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
245 -
246 - if ! has_version ">=sys-apps/openrc-0.11"; then
247 - add_boot_init sysfs sysinit
248 - fi
249 -
250 - if ! has_version ">=sys-apps/openrc-0.11.3" ; then
251 - migrate_udev_mount_script
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 -
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 - if ! has_version ">=sys-apps/openrc-0.40"; then
289 - add_boot_init save-keymaps
290 - add_boot_init save-termencoding
291 - fi
292 -}
293 -
294 -# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
295 -migrate_udev_mount_script() {
296 - if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
297 - ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
298 - add_boot_init udev-mount sysinit
299 - fi
300 - return 0
301 -}
302 -
303 -pkg_postinst() {
304 - local LIBDIR=$(get_libdir)
305 -
306 - # Make our runlevels if they don't exist
307 - if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
308 - einfo "Copying across default runlevels"
309 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
310 - rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
311 - else
312 - if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
313 - mkdir -p "${EROOT}"etc/runlevels/sysinit
314 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
315 - "${EROOT}"etc/runlevels/sysinit
316 - fi
317 - if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
318 - mkdir -p "${EROOT}"etc/runlevels/shutdown
319 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
320 - "${EROOT}"etc/runlevels/shutdown
321 - fi
322 - if [[ ! -e "${EROOT}"etc/runlevels/nonetwork/local ]]; then
323 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/nonetwork \
324 - "${EROOT}"etc/runlevels
325 - fi
326 - fi
327 -
328 - if use hppa; then
329 - elog "Setting the console font does not work on all HPPA consoles."
330 - elog "You can still enable it by running:"
331 - elog "# rc-update add consolefont boot"
332 - fi
333 -
334 - # Added for 0.35.
335 - if use kernel_linux && [[ ! -h "${EROOT}"/lib ]]; then
336 - if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
337 - cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
338 - fi
339 - elif ! use kernel_linux; then
340 - if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
341 - cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
342 - fi
343 - fi
344 -
345 - # update the dependency tree after touching all files #224171
346 - [[ "${EROOT}" = "/" ]] && "${EROOT}"/lib/rc/bin/rc-depend -u
347 -
348 - if ! use newnet && ! use netifrc; then
349 - ewarn "You have emerged OpenRc without network support. This"
350 - ewarn "means you need to SET UP a network manager such as"
351 - ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
352 - ewarn "net-misc/NetworkManager, or net-vpn/badvpn."
353 - ewarn "Or, you have the option of emerging openrc with the newnet"
354 - ewarn "use flag and configuring /etc/conf.d/network and"
355 - ewarn "/etc/conf.d/staticroute if you only use static interfaces."
356 - ewarn
357 - fi
358 -
359 - if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
360 - ewarn "Please add the network service to your boot runlevel"
361 - ewarn "as soon as possible. Not doing so could leave you with a system"
362 - ewarn "without networking."
363 - ewarn
364 - fi
365 -}
366
367 diff --git a/sys-apps/openrc/openrc-0.40.ebuild b/sys-apps/openrc/openrc-0.40.ebuild
368 deleted file mode 100644
369 index 03c55deff41..00000000000
370 --- a/sys-apps/openrc/openrc-0.40.ebuild
371 +++ /dev/null
372 @@ -1,330 +0,0 @@
373 -# Copyright 1999-2018 Gentoo Authors
374 -# Distributed under the terms of the GNU General Public License v2
375 -
376 -EAPI=6
377 -
378 -inherit flag-o-matic pam toolchain-funcs
379 -
380 -DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
381 -HOMEPAGE="https://github.com/openrc/openrc/"
382 -
383 -if [[ ${PV} == "9999" ]]; then
384 - EGIT_REPO_URI="https://github.com/OpenRC/${PN}.git"
385 - inherit git-r3
386 -else
387 - SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
388 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
389 -fi
390 -
391 -LICENSE="BSD-2"
392 -SLOT="0"
393 -IUSE="audit debug ncurses pam newnet prefix +netifrc selinux static-libs
394 - unicode kernel_linux kernel_FreeBSD"
395 -
396 -COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
397 - ncurses? ( sys-libs/ncurses:0= )
398 - pam? (
399 - sys-auth/pambase
400 - virtual/pam
401 - )
402 - audit? ( sys-process/audit )
403 - kernel_linux? (
404 - sys-process/psmisc
405 - !<sys-process/procps-3.3.9-r2
406 - )
407 - selinux? (
408 - sys-apps/policycoreutils
409 - >=sys-libs/libselinux-2.6
410 - )
411 - !<sys-apps/baselayout-2.1-r1
412 - !<sys-fs/udev-init-scripts-27"
413 -DEPEND="${COMMON_DEPEND}
414 - virtual/os-headers
415 - ncurses? ( virtual/pkgconfig )"
416 -RDEPEND="${COMMON_DEPEND}
417 - !prefix? (
418 - kernel_linux? (
419 - >=sys-apps/sysvinit-2.86-r6[selinux?]
420 - virtual/tmpfiles
421 - )
422 - kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
423 - )
424 - selinux? (
425 - >=sec-policy/selinux-base-policy-2.20170204-r4
426 - >=sec-policy/selinux-openrc-2.20170204-r4
427 - )
428 - !<app-shells/gentoo-bashcomp-20180302
429 - !<app-shells/gentoo-zsh-completions-20180228
430 -"
431 -
432 -PDEPEND="netifrc? ( net-misc/netifrc )"
433 -
434 -src_prepare() {
435 - default
436 - if [[ ${PV} == "9999" ]] ; then
437 - local ver="git-${EGIT_VERSION:0:6}"
438 - sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
439 - fi
440 -}
441 -
442 -src_compile() {
443 - unset LIBDIR #266688
444 -
445 - MAKE_ARGS="${MAKE_ARGS}
446 - LIBNAME=$(get_libdir)
447 - LIBEXECDIR=${EPREFIX}/lib/rc
448 - MKBASHCOMP=yes
449 - MKNET=$(usex newnet)
450 - MKSELINUX=$(usex selinux)
451 - MKAUDIT=$(usex audit)
452 - MKPAM=$(usev pam)
453 - MKSTATICLIBS=$(usex static-libs)
454 - MKZSHCOMP=yes"
455 -
456 - local brand="Unknown"
457 - if use kernel_linux ; then
458 - MAKE_ARGS="${MAKE_ARGS} OS=Linux"
459 - brand="Linux"
460 - elif use kernel_FreeBSD ; then
461 - MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
462 - brand="FreeBSD"
463 - fi
464 - export BRANDING="Gentoo ${brand}"
465 - use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
466 - export DEBUG=$(usev debug)
467 - export MKTERMCAP=$(usev ncurses)
468 -
469 - tc-export CC AR RANLIB
470 - emake ${MAKE_ARGS}
471 -}
472 -
473 -# set_config <file> <option name> <yes value> <no value> test
474 -# a value of "#" will just comment out the option
475 -set_config() {
476 - local file="${ED}/$1" var=$2 val com
477 - eval "${@:5}" && val=$3 || val=$4
478 - [[ ${val} == "#" ]] && com="#" && val='\2'
479 - sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
480 -}
481 -
482 -set_config_yes_no() {
483 - set_config "$1" "$2" YES NO "${@:3}"
484 -}
485 -
486 -src_install() {
487 - emake ${MAKE_ARGS} DESTDIR="${D}" install
488 -
489 - # move the shared libs back to /usr so ldscript can install
490 - # more of a minimal set of files
491 - # disabled for now due to #270646
492 - #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
493 - #gen_usr_ldscript -a einfo rc
494 - gen_usr_ldscript libeinfo.so
495 - gen_usr_ldscript librc.so
496 -
497 - if ! use kernel_linux; then
498 - keepdir /lib/rc/init.d
499 - fi
500 - keepdir /lib/rc/tmp
501 -
502 - # Backup our default runlevels
503 - dodir /usr/share/"${PN}"
504 - cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
505 - rm -rf "${ED}"/etc/runlevels
506 -
507 - # Setup unicode defaults for silly unicode users
508 - set_config_yes_no /etc/rc.conf unicode use unicode
509 -
510 - # Cater to the norm
511 - set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
512 -
513 - # On HPPA, do not run consolefont by default (bug #222889)
514 - if use hppa; then
515 - rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
516 - fi
517 -
518 - # Support for logfile rotation
519 - insinto /etc/logrotate.d
520 - newins "${FILESDIR}"/openrc.logrotate openrc
521 -
522 - # install gentoo pam.d files
523 - newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
524 - newpamd "${FILESDIR}"/start-stop-daemon.pam supervise-daemon
525 -
526 - # install documentation
527 - dodoc ChangeLog *.md
528 - if use newnet; then
529 - dodoc README.newnet
530 - fi
531 -}
532 -
533 -add_boot_init() {
534 - local initd=$1
535 - local runlevel=${2:-boot}
536 - # if the initscript is not going to be installed and is not
537 - # currently installed, return
538 - [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
539 - || return
540 - [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
541 -
542 - # if runlevels dont exist just yet, then create it but still flag
543 - # to pkg_postinst that it needs real setup #277323
544 - if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
545 - mkdir -p "${EROOT}"etc/runlevels/${runlevel}
546 - touch "${EROOT}"etc/runlevels/.add_boot_init.created
547 - fi
548 -
549 - elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
550 - ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
551 -}
552 -add_boot_init_mit_config() {
553 - local config=$1 initd=$2
554 - if [[ -e ${EROOT}${config} ]] ; then
555 - if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
556 - add_boot_init ${initd}
557 - fi
558 - fi
559 -}
560 -
561 -pkg_preinst() {
562 - local f LIBDIR=$(get_libdir)
563 -
564 - # avoid default thrashing in conf.d files when possible #295406
565 - if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
566 - (
567 - unset hostname HOSTNAME
568 - source "${EROOT}"etc/conf.d/hostname
569 - : ${hostname:=${HOSTNAME}}
570 - [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
571 - )
572 - fi
573 -
574 - # set default interactive shell to sulogin if it exists
575 - set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
576 -
577 - # termencoding was added in 0.2.1 and needed in boot
578 - has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
579 -
580 - # swapfiles was added in 0.9.9 and needed in boot (february 2012)
581 - has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
582 -
583 - if ! has_version ">=sys-apps/openrc-0.11"; then
584 - add_boot_init sysfs sysinit
585 - fi
586 -
587 - if ! has_version ">=sys-apps/openrc-0.11.3" ; then
588 - migrate_udev_mount_script
589 - fi
590 -
591 - # these were added in 0.12.
592 - if ! has_version ">=sys-apps/openrc-0.12"; then
593 - add_boot_init loopback
594 -
595 - # ensure existing /etc/conf.d/net is not removed
596 - # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
597 - # this needs to stay in openrc ebuilds for a long time. :(
598 - # Added in 0.12.
599 - if [[ -f "${EROOT}"etc/conf.d/net ]]; then
600 - einfo "Modifying conf.d/net to keep it from being removed"
601 - cat <<-EOF >>"${EROOT}"etc/conf.d/net
602 -
603 -# The network scripts are now part of net-misc/netifrc
604 -# In order to avoid sys-apps/${P} from removing this file, this comment was
605 -# added; you can safely remove this comment. Please see
606 -# /usr/share/doc/netifrc*/README* for more information.
607 -EOF
608 - fi
609 - fi
610 - has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
611 -
612 - if ! has_version ">=sys-apps/openrc-0.18.3"; then
613 - add_boot_init mtab
614 - if [[ -f "${EROOT}"etc/mtab ]] && [[ ! -L "${EROOT}"etc/mtab ]]; then
615 - ewarn "${EROOT}etc/mtab will be replaced with a"
616 - ewarn "symbolic link to /proc/self/mounts on the next"
617 - ewarn "reboot."
618 - ewarn "Change the setting in ${EROOT}etc/conf.d/mtab"
619 - ewarn "if you do not want this to happen."
620 - fi
621 - fi
622 -
623 - has_version ">=sys-apps/openrc-0.35" || add_boot_init cgroups sysinit
624 -
625 - if ! has_version ">=sys-apps/openrc-0.40"; then
626 - add_boot_init save-keymaps
627 - add_boot_init save-termencoding
628 - fi
629 -}
630 -
631 -# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
632 -migrate_udev_mount_script() {
633 - if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
634 - ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
635 - add_boot_init udev-mount sysinit
636 - fi
637 - return 0
638 -}
639 -
640 -pkg_postinst() {
641 - local LIBDIR=$(get_libdir)
642 -
643 - # Make our runlevels if they don't exist
644 - if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
645 - einfo "Copying across default runlevels"
646 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
647 - rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
648 - else
649 - if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
650 - mkdir -p "${EROOT}"etc/runlevels/sysinit
651 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
652 - "${EROOT}"etc/runlevels/sysinit
653 - fi
654 - if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
655 - mkdir -p "${EROOT}"etc/runlevels/shutdown
656 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
657 - "${EROOT}"etc/runlevels/shutdown
658 - fi
659 - if [[ ! -e "${EROOT}"etc/runlevels/nonetwork/local ]]; then
660 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/nonetwork \
661 - "${EROOT}"etc/runlevels
662 - fi
663 - fi
664 -
665 - if use hppa; then
666 - elog "Setting the console font does not work on all HPPA consoles."
667 - elog "You can still enable it by running:"
668 - elog "# rc-update add consolefont boot"
669 - fi
670 -
671 - # Added for 0.35.
672 - if use kernel_linux && [[ ! -h "${EROOT}"/lib ]]; then
673 - if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
674 - cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
675 - fi
676 - elif ! use kernel_linux; then
677 - if [[ -d "${EROOT}$(get_libdir)"/rc ]]; then
678 - cp -RPp "${EROOT}$(get_libdir)/rc" "${EROOT}"lib
679 - fi
680 - fi
681 -
682 - # update the dependency tree after touching all files #224171
683 - [[ "${EROOT}" = "/" ]] && "${EROOT}"/lib/rc/bin/rc-depend -u
684 -
685 - if ! use newnet && ! use netifrc; then
686 - ewarn "You have emerged OpenRc without network support. This"
687 - ewarn "means you need to SET UP a network manager such as"
688 - ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
689 - ewarn "net-misc/NetworkManager, or net-vpn/badvpn."
690 - ewarn "Or, you have the option of emerging openrc with the newnet"
691 - ewarn "use flag and configuring /etc/conf.d/network and"
692 - ewarn "/etc/conf.d/staticroute if you only use static interfaces."
693 - ewarn
694 - fi
695 -
696 - if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
697 - ewarn "Please add the network service to your boot runlevel"
698 - ewarn "as soon as possible. Not doing so could leave you with a system"
699 - ewarn "without networking."
700 - ewarn
701 - fi
702 -}