Gentoo Archives: gentoo-commits

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