Gentoo Archives: gentoo-commits

From: "William Hubbs (williamh)" <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/openrc: ChangeLog openrc-0.9.1.ebuild openrc-0.9.0.ebuild
Date: Thu, 01 Sep 2011 22:39:55
Message-Id: 20110901223945.0B9F32004C@flycatcher.gentoo.org
1 williamh 11/09/01 22:39:45
2
3 Modified: ChangeLog
4 Added: openrc-0.9.1.ebuild
5 Removed: openrc-0.9.0.ebuild
6 Log:
7 version bump , bug #381463 tracks fixes since openrc-0.9.0.
8
9 (Portage version: 2.2.0_alpha51/cvs/Linux i686)
10
11 Revision Changes Path
12 1.167 sys-apps/openrc/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/openrc/ChangeLog?rev=1.167&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/openrc/ChangeLog?rev=1.167&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/openrc/ChangeLog?r1=1.166&r2=1.167
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v
21 retrieving revision 1.166
22 retrieving revision 1.167
23 diff -u -r1.166 -r1.167
24 --- ChangeLog 1 Sep 2011 16:09:14 -0000 1.166
25 +++ ChangeLog 1 Sep 2011 22:39:44 -0000 1.167
26 @@ -1,6 +1,12 @@
27 # ChangeLog for sys-apps/openrc
28 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.166 2011/09/01 16:09:14 williamh Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.167 2011/09/01 22:39:44 williamh Exp $
31 +
32 +*openrc-0.9.1 (01 Sep 2011)
33 +
34 + 01 Sep 2011; William Hubbs <williamh@g.o> -openrc-0.9.0.ebuild,
35 + +openrc-0.9.1.ebuild:
36 + version bump , bug #381463 tracks fixes since openrc-0.9.0.
37
38 *openrc-0.9.0 (01 Sep 2011)
39
40
41
42
43 1.1 sys-apps/openrc/openrc-0.9.1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/openrc/openrc-0.9.1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/openrc/openrc-0.9.1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: openrc-0.9.1.ebuild
49 ===================================================================
50 # Copyright 1999-2011 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.9.1.ebuild,v 1.1 2011/09/01 22:39:44 williamh Exp $
53
54 EAPI=4
55
56 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/${PN}.git"
57 [[ ${PV} == "9999" ]] && SCM_ECLASS="git-2"
58 inherit eutils flag-o-matic multilib pam toolchain-funcs ${SCM_ECLASS}
59 unset SCM_ECLASS
60
61 DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
62 HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
63 if [[ ${PV} != "9999" ]] ; then
64 SRC_URI="mirror://gentoo/${P}.tar.bz2"
65 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
66 fi
67
68 LICENSE="BSD-2"
69 SLOT="0"
70 IUSE="debug elibc_glibc ncurses pam selinux unicode kernel_linux kernel_FreeBSD"
71
72 RDEPEND="virtual/init
73 kernel_FreeBSD? ( sys-process/fuser-bsd )
74 elibc_glibc? ( >=sys-libs/glibc-2.5 )
75 ncurses? ( sys-libs/ncurses )
76 pam? ( virtual/pam )
77 >=sys-apps/baselayout-2.0.0
78 kernel_linux? ( !<sys-apps/module-init-tools-3.2.2-r2 )
79 !<sys-fs/udev-133
80 !<sys-apps/sysvinit-2.86-r11"
81 DEPEND="${RDEPEND}
82 virtual/os-headers"
83
84 make_args() {
85 unset LIBDIR #266688
86
87 MAKE_ARGS="${MAKE_ARGS} LIBNAME=$(get_libdir) LIBEXECDIR=/lib/rc"
88 MAKE_ARGS="${MAKE_ARGS} MKOLDNET=yes"
89
90 local brand="Unknown"
91 if use kernel_linux ; then
92 MAKE_ARGS="${MAKE_ARGS} OS=Linux"
93 brand="Linux"
94 elif use kernel_FreeBSD ; then
95 MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
96 brand="FreeBSD"
97 fi
98 if use selinux; then
99 MAKE_ARGS="${MAKE_ARGS} MKSELINUX=yes"
100 fi
101 export BRANDING="Gentoo ${brand}"
102 }
103
104 pkg_setup() {
105 export DEBUG=$(usev debug)
106 export MKPAM=$(usev pam)
107 export MKTERMCAP=$(usev ncurses)
108 }
109
110 src_prepare() {
111 sed -i 's:0444:0644:' mk/sys.mk || die
112 sed -i "/^DIR/s:/openrc:/${PF}:" doc/Makefile || die #241342
113
114 if [[ ${PV} == "9999" ]] ; then
115 local ver="git-${EGIT_VERSION:0:6}"
116 sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/git.mk || die
117 fi
118
119 # Allow user patches to be applied without modifying the ebuild
120 epatch_user
121 }
122
123 src_compile() {
124 make_args
125
126 tc-export CC AR RANLIB
127 emake ${MAKE_ARGS}
128 }
129
130 # set_config <file> <option name> <yes value> <no value> test
131 # a value of "#" will just comment out the option
132 set_config() {
133 local file="${D}/$1" var=$2 val com
134 eval "${@:5}" && val=$3 || val=$4
135 [[ ${val} == "#" ]] && com="#" && val='\2'
136 sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
137 }
138
139 set_config_yes_no() {
140 set_config "$1" "$2" YES NO "${@:3}"
141 }
142
143 src_install() {
144 make_args
145 emake ${MAKE_ARGS} DESTDIR="${D}" install
146
147 # install the readme for the new network scripts
148 dodoc README.newnet
149
150 # move the shared libs back to /usr so ldscript can install
151 # more of a minimal set of files
152 # disabled for now due to #270646
153 #mv "${D}"/$(get_libdir)/lib{einfo,rc}* "${D}"/usr/$(get_libdir)/ || die
154 #gen_usr_ldscript -a einfo rc
155 gen_usr_ldscript libeinfo.so
156 gen_usr_ldscript librc.so
157
158 keepdir /$(get_libdir)/rc/{init.d,tmp}
159
160 # Backup our default runlevels
161 dodir /usr/share/"${PN}"
162 cp -PR "${D}"/etc/runlevels "${D}"/usr/share/${PN} || die
163 rm -rf "${D}"/etc/runlevels
164
165 # Stick with "old" net as the default for now
166 doconfd conf.d/net || die
167 pushd "${D}"/usr/share/${PN}/runlevels/boot > /dev/null
168 rm -f network staticroute
169 ln -s /etc/init.d/net.lo net.lo
170 popd > /dev/null
171
172 # Setup unicode defaults for silly unicode users
173 set_config_yes_no /etc/rc.conf unicode use unicode
174
175 # Cater to the norm
176 set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
177
178 # On HPPA, do not run consolefont by default (bug #222889)
179 if use hppa; then
180 rm -f "${D}"/usr/share/openrc/runlevels/boot/consolefont
181 fi
182
183 # Support for logfile rotation
184 insinto /etc/logrotate.d
185 newins "${FILESDIR}"/openrc.logrotate openrc
186
187 # install the gentoo pam.d file
188 newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
189 }
190
191 add_boot_init() {
192 local initd=$1
193 local runlevel=${2:-boot}
194 # if the initscript is not going to be installed and is not
195 # currently installed, return
196 [[ -e ${D}/etc/init.d/${initd} || -e ${ROOT}/etc/init.d/${initd} ]] \
197 || return
198 [[ -e ${ROOT}/etc/runlevels/${runlevel}/${initd} ]] && return
199
200 # if runlevels dont exist just yet, then create it but still flag
201 # to pkg_postinst that it needs real setup #277323
202 if [[ ! -d ${ROOT}/etc/runlevels/${runlevel} ]] ; then
203 mkdir -p "${ROOT}"/etc/runlevels/${runlevel}
204 touch "${ROOT}"/etc/runlevels/.add_boot_init.created
205 fi
206
207 elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
208 ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/${runlevel}/${initd}
209 }
210 add_boot_init_mit_config() {
211 local config=$1 initd=$2
212 if [[ -e ${ROOT}${config} ]] ; then
213 if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${ROOT}"/${config}) ]] ; then
214 add_boot_init ${initd}
215 fi
216 fi
217 }
218
219 pkg_preinst() {
220 local f LIBDIR=$(get_libdir)
221
222 # default net script is just comments, so no point in biting people
223 # in the ass by accident. we save in preinst so that the package
224 # manager doesnt go throwing etc-update crap at us -- postinst is
225 # too late to prevent that. this behavior also lets us keep the
226 # file in the CONTENTS for binary packages.
227 [[ -e ${ROOT}/etc/conf.d/net ]] && cp "${ROOT}"/etc/conf.d/net "${D}"/etc/conf.d/
228
229 # avoid default thrashing in conf.d files when possible #295406
230 if [[ -e ${ROOT}/etc/conf.d/hostname ]] ; then
231 (
232 unset hostname HOSTNAME
233 source "${ROOT}"/etc/conf.d/hostname
234 : ${hostname:=${HOSTNAME}}
235 [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
236 )
237 fi
238
239 # upgrade timezone file ... do it before moving clock
240 if [[ -e ${ROOT}/etc/conf.d/clock && ! -e ${ROOT}/etc/timezone ]] ; then
241 (
242 unset TIMEZONE
243 source "${ROOT}"/etc/conf.d/clock
244 [[ -n ${TIMEZONE} ]] && echo "${TIMEZONE}" > "${ROOT}"/etc/timezone
245 )
246 fi
247
248 # /etc/conf.d/clock moved to /etc/conf.d/hwclock
249 local clock
250 use kernel_FreeBSD && clock="adjkerntz" || clock="hwclock"
251 if [[ -e ${ROOT}/etc/conf.d/clock ]] ; then
252 mv "${ROOT}"/etc/conf.d/clock "${ROOT}"/etc/conf.d/${clock}
253 fi
254 if [[ -e ${ROOT}/etc/init.d/clock ]] ; then
255 rm -f "${ROOT}"/etc/init.d/clock
256 fi
257 if [[ -L ${ROOT}/etc/runlevels/boot/clock ]] ; then
258 rm -f "${ROOT}"/etc/runlevels/boot/clock
259 ln -snf /etc/init.d/${clock} "${ROOT}"/etc/runlevels/boot/${clock}
260 fi
261 if [[ -L ${ROOT}${LIBDIR}/rc/init.d/started/clock ]] ; then
262 rm -f "${ROOT}${LIBDIR}"/rc/init.d/started/clock
263 ln -snf /etc/init.d/${clock} "${ROOT}${LIBDIR}"/rc/init.d/started/${clock}
264 fi
265
266 # /etc/conf.d/rc is no longer used for configuration
267 if [[ -e ${ROOT}/etc/conf.d/rc ]] ; then
268 elog "/etc/conf.d/rc is no longer used for configuration."
269 elog "Please migrate your settings to /etc/rc.conf as applicable"
270 elog "and delete /etc/conf.d/rc"
271 fi
272
273 # force net init.d scripts into symlinks
274 for f in "${ROOT}"/etc/init.d/net.* ; do
275 [[ -e ${f} ]] || continue # catch net.* not matching anything
276 [[ ${f} == */net.lo ]] && continue # real file now
277 [[ ${f} == *.openrc.bak ]] && continue
278 if [[ ! -L ${f} ]] ; then
279 elog "Moved net service '${f##*/}' to '${f##*/}.openrc.bak' to force a symlink."
280 elog "You should delete '${f##*/}.openrc.bak' if you don't need it."
281 mv "${f}" "${f}.openrc.bak"
282 ln -snf net.lo "${f}"
283 fi
284 done
285
286 # termencoding was added in 0.2.1 and needed in boot
287 has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
288
289 # set default interactive shell to sulogin if it exists
290 set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
291
292 has_version sys-apps/openrc || migrate_from_baselayout_1
293 has_version ">=sys-apps/openrc-0.4.0" || migrate_udev_init_script
294 }
295
296 # >=openrc-0.4.0 no longer loads the udev addon
297 migrate_udev_init_script() {
298 # make sure udev is in sysinit if it was enabled before
299 local enable_udev=false
300 local rc_devices=$(
301 [[ -f /etc/rc.conf ]] && source /etc/rc.conf
302 [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc
303 echo "${rc_devices:-${RC_DEVICES:-auto}}"
304 )
305 case ${rc_devices} in
306 udev|auto)
307 enable_udev=true
308 ;;
309 esac
310
311 if $enable_udev; then
312 add_boot_init udev sysinit
313 add_boot_init udev-postmount default
314 fi
315 }
316
317 migrate_from_baselayout_1() {
318 # baselayout boot init scripts have been split out
319 for f in $(cd "${D}"/usr/share/${PN}/runlevels/boot || exit; echo *) ; do
320 # baselayout-1 is always "old" net, so ignore "new" net
321 [[ ${f} == "network" ]] && continue
322
323 add_boot_init ${f}
324 done
325
326 # Try to auto-add some addons when possible
327 add_boot_init_mit_config /etc/conf.d/cryptfs dmcrypt
328 add_boot_init_mit_config /etc/conf.d/dmcrypt dmcrypt
329 add_boot_init_mit_config /etc/mdadm.conf mdraid
330 add_boot_init_mit_config /etc/evms.conf evms
331 [[ -e ${ROOT}/sbin/dmsetup ]] && add_boot_init device-mapper
332 [[ -e ${ROOT}/sbin/vgscan ]] && add_boot_init lvm
333 elog "Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone"
334 elog "init.d scripts. If you use such a thing, make sure you have the"
335 elog "required init.d scripts added to your boot runlevel."
336
337 # Upgrade our state for baselayout-1 users
338 if [[ ! -e ${ROOT}${LIBDIR}/rc/init.d/started ]] ; then
339 (
340 [[ -e ${ROOT}/etc/conf.d/rc ]] && source "${ROOT}"/etc/conf.d/rc
341 svcdir=${svcdir:-/var/lib/init.d}
342 if [[ ! -d ${ROOT}${svcdir}/started ]] ; then
343 ewarn "No state found, and no state exists"
344 elog "You should reboot this host"
345 else
346 mkdir -p "${ROOT}${LIBDIR}/rc/init.d"
347 einfo "Moving state from ${ROOT}${svcdir} to ${ROOT}${LIBDIR}/rc/init.d"
348 mv "${ROOT}${svcdir}"/* "${ROOT}${LIBDIR}"/rc/init.d
349 rm -rf "${ROOT}${LIBDIR}"/rc/init.d/daemons \
350 "${ROOT}${LIBDIR}"/rc/init.d/console
351 umount "${ROOT}${svcdir}" 2>/dev/null
352 rm -rf "${ROOT}${svcdir}"
353 fi
354 )
355 fi
356
357 # Handle the /etc/modules.autoload.d -> /etc/conf.d/modules transition
358 if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
359 elog "Converting your /etc/modules.autoload.d/ files to /etc/conf.d/modules"
360 rm -f "${ROOT}"/etc/modules.autoload.d/.keep*
361 rmdir "${ROOT}"/etc/modules.autoload.d 2>/dev/null
362 if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
363 local f v
364 for f in "${ROOT}"/etc/modules.autoload.d/* ; do
365 v=${f##*/}
366 v=${v#kernel-}
367 v=${v//[^[:alnum:]]/_}
368 gawk -v v="${v}" -v f="${f##*/}" '
369 BEGIN { print "\n### START: Auto-converted from " f "\n" }
370 {
371 if ($0 ~ /^[^#]/) {
372 print "modules_" v "=\"${modules_" v "} " $1 "\""
373 gsub(/[^[:alnum:]]/, "_", $1)
374 printf "module_" $1 "_args_" v "=\""
375 for (i = 2; i <= NF; ++i) {
376 if (i > 2)
377 printf " "
378 printf $i
379 }
380 print "\"\n"
381 } else
382 print
383 }
384 END { print "\n### END: Auto-converted from " f "\n" }
385 ' "${f}" >> "${D}"/etc/conf.d/modules
386 done
387 rm -f "${f}"
388 rmdir "${ROOT}"/etc/modules.autoload.d 2>/dev/null
389 fi
390 fi
391 }
392
393 pkg_postinst() {
394 local LIBDIR=$(get_libdir)
395
396 # Remove old baselayout links
397 rm -f "${ROOT}"/etc/runlevels/boot/{check{fs,root},rmnologin}
398 rm -f "${ROOT}"/etc/init.d/{depscan,runscript}.sh
399
400 # Make our runlevels if they don't exist
401 if [[ ! -e ${ROOT}/etc/runlevels ]] || [[ -e ${ROOT}/etc/runlevels/.add_boot_init.created ]] ; then
402 einfo "Copying across default runlevels"
403 cp -RPp "${ROOT}"/usr/share/${PN}/runlevels "${ROOT}"/etc
404 rm -f "${ROOT}"/etc/runlevels/.add_boot_init.created
405 else
406 if [[ ! -e ${ROOT}/etc/runlevels/sysinit/devfs ]] ; then
407 mkdir -p "${ROOT}"/etc/runlevels/sysinit
408 cp -RPp "${ROOT}"/usr/share/${PN}/runlevels/sysinit/* \
409 "${ROOT}"/etc/runlevels/sysinit
410 fi
411 if [[ ! -e ${ROOT}/etc/runlevels/shutdown/mount-ro ]] ; then
412 mkdir -p "${ROOT}"/etc/runlevels/shutdown
413 cp -RPp "${ROOT}"/usr/share/${PN}/runlevels/shutdown/* \
414 "${ROOT}"/etc/runlevels/shutdown
415 fi
416 fi
417
418 # /etc/conf.d/net.example is no longer valid
419 local NET_EXAMPLE="${ROOT}/etc/conf.d/net.example"
420 local NET_MD5='8ebebfa07441d39eb54feae0ee4c8210'
421 if [[ -e "${NET_EXAMPLE}" ]] ; then
422 if [[ $(md5sum "${NET_EXAMPLE}") == ${NET_MD5}* ]]; then
423 rm -f "${NET_EXAMPLE}"
424 elog "${NET_EXAMPLE} has been removed."
425 else
426 sed -i '1i# This file is obsolete.\n' "${NET_EXAMPLE}"
427 elog "${NET_EXAMPLE} should be removed."
428 fi
429 elog "The new file is ${ROOT}/usr/share/doc/${PF}/net.example"
430 fi
431
432 # /etc/conf.d/wireless.example is no longer valid
433 local WIRELESS_EXAMPLE="${ROOT}/etc/conf.d/wireless.example"
434 local WIRELESS_MD5='d1fad7da940bf263c76af4d2082124a3'
435 if [[ -e "${WIRELESS_EXAMPLE}" ]] ; then
436 if [[ $(md5sum "${WIRELESS_EXAMPLE}") == ${WIRELESS_MD5}* ]]; then
437 rm -f "${WIRELESS_EXAMPLE}"
438 elog "${WIRELESS_EXAMPLE} is deprecated and has been removed."
439 else
440 sed -i '1i# This file is obsolete.\n' "${WIRELESS_EXAMPLE}"
441 elog "${WIRELESS_EXAMPLE} is deprecated and should be removed."
442 fi
443 elog "If you are using the old style network scripts,"
444 elog "Configure wireless settings in ${ROOT}/etc/conf.d/net"
445 elog "after reviewing ${ROOT}/usr/share/doc/${PF}/net.example"
446 fi
447
448 if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
449 ewarn "/etc/modules.autoload.d is no longer used. Please convert"
450 ewarn "your files to /etc/conf.d/modules and delete the directory."
451 fi
452
453 if use hppa; then
454 elog "Setting the console font does not work on all HPPA consoles."
455 elog "You can still enable it by running:"
456 elog "# rc-update add consolefont boot"
457 fi
458
459 # Handle the conf.d/local.{start,stop} -> local.d transition
460 if path_exists -o "${ROOT}"etc/conf.d/local.{start,stop} ; then
461 elog "Moving your ${ROOT}etc/conf.d/local.{start,stop}"
462 elog "files to ${ROOT}etc/local.d"
463 mv "${ROOT}"etc/conf.d/local.start "${ROOT}"etc/local.d/baselayout1.start
464 mv "${ROOT}"etc/conf.d/local.stop "${ROOT}"etc/local.d/baselayout1.stop
465 chmod +x "${ROOT}"etc/local.d/*{start,stop}
466 fi
467
468 # update the dependency tree after touching all files #224171
469 [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u
470
471 elog "You should now update all files in /etc, using etc-update"
472 elog "or equivalent before restarting any services or this host."
473 elog
474 elog "Please read the migration guide available at:"
475 elog "http://www.gentoo.org/doc/en/openrc-migration.xml"
476 }