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