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