Gentoo Archives: gentoo-commits

From: "Doug Goldstein (cardoe)" <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/openrc: ChangeLog openrc-0.2.3.ebuild
Date: Tue, 29 Apr 2008 19:18:41
Message-Id: E1JqvLa-0003XS-3Q@stork.gentoo.org
1 cardoe 08/04/29 19:18:38
2
3 Modified: ChangeLog
4 Added: openrc-0.2.3.ebuild
5 Log:
6 version bump. numerous bug fixes
7 (Portage version: 2.1.5_rc6)
8
9 Revision Changes Path
10 1.34 sys-apps/openrc/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/openrc/ChangeLog?rev=1.34&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/openrc/ChangeLog?rev=1.34&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/openrc/ChangeLog?r1=1.33&r2=1.34
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v
19 retrieving revision 1.33
20 retrieving revision 1.34
21 diff -u -r1.33 -r1.34
22 --- ChangeLog 19 Apr 2008 20:40:51 -0000 1.33
23 +++ ChangeLog 29 Apr 2008 19:18:37 -0000 1.34
24 @@ -1,6 +1,11 @@
25 # ChangeLog for sys-apps/openrc
26 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.33 2008/04/19 20:40:51 vapier Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.34 2008/04/29 19:18:37 cardoe Exp $
29 +
30 +*openrc-0.2.3 (29 Apr 2008)
31 +
32 + 29 Apr 2008; Doug Goldstein <cardoe@g.o> +openrc-0.2.3.ebuild:
33 + version bump. numerous bug fixes
34
35 19 Apr 2008; Mike Frysinger <vapier@g.o> openrc-0.2.2.ebuild,
36 openrc-9999.ebuild:
37
38
39
40 1.1 sys-apps/openrc/openrc-0.2.3.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/openrc/openrc-0.2.3.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/openrc/openrc-0.2.3.ebuild?rev=1.1&content-type=text/plain
44
45 Index: openrc-0.2.3.ebuild
46 ===================================================================
47 # Copyright 1999-2008 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.2.3.ebuild,v 1.1 2008/04/29 19:18:37 cardoe Exp $
50
51 inherit eutils flag-o-matic multilib toolchain-funcs
52
53 if [[ ${PV} == "9999" ]] ; then
54 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/openrc.git"
55 EGIT_BRANCH="master"
56 inherit git
57 else
58 SRC_URI="http://roy.marples.name/${PN}/${P}.tar.bz2
59 mirror://gentoo/${P}.tar.bz2
60 http://dev.gentoo.org/~cardoe/files/${P}.tar.bz2
61 http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2"
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 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
70 IUSE="debug ncurses pam unicode kernel_linux kernel_FreeBSD"
71
72 RDEPEND="virtual/init
73 kernel_linux? ( >=sys-apps/module-init-tools-3.2.2-r2 )
74 kernel_FreeBSD? ( sys-process/fuser-bsd )
75 elibc_glibc? ( >=sys-libs/glibc-2.5 )
76 ncurses? ( sys-libs/ncurses )
77 pam? ( virtual/pam )
78 >=sys-apps/baselayout-2.0.0
79 !<sys-fs/udev-118-r2"
80 DEPEND="${RDEPEND}
81 virtual/os-headers"
82
83 pkg_setup() {
84 LIBDIR="lib"
85 [ "${SYMLINK_LIB}" = "yes" ] && LIBDIR=$(get_abi_LIBDIR "${DEFAULT_ABI}")
86
87 MAKE_ARGS="${MAKE_ARGS} LIBNAME=${LIBDIR}"
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 export DEBUG=$(usev debug)
100 export MKPAM=$(usev pam)
101 export MKTERMCAP=$(usev ncurses)
102 }
103
104 src_unpack() {
105 if [[ ${PV} == "9999" ]] ; then
106 git_src_unpack
107 else
108 unpack ${A}
109 fi
110 cd "${S}"
111 epatch "${FILESDIR}"/9999/*.patch
112 }
113
114 src_compile() {
115 # catch people running `ebuild` w/out setup
116 if [[ -z ${MAKE_ARGS} ]] ; then
117 die "Your MAKE_ARGS is empty ... are you running 'ebuild' but forgot to execute 'setup' ?"
118 fi
119
120 if [[ ${PV} == "9999" ]] ; then
121 local ver="git-$(git --git-dir=${EGIT_STORE_DIR}/${EGIT_PROJECT} rev-parse --verify ${EGIT_BRANCH} | cut -c1-8)"
122 sed -i "/^VERSION[[:space:]]*=/s:=.*:=${ver}:" Makefile
123 fi
124
125 tc-export CC AR RANLIB
126 echo emake ${MAKE_ARGS}
127 emake ${MAKE_ARGS} || die "emake ${MAKE_ARGS} failed"
128 }
129
130 src_install() {
131 emake ${MAKE_ARGS} DESTDIR="${D}" install || die "make install failed"
132 gen_usr_ldscript libeinfo.so
133 gen_usr_ldscript librc.so
134
135 keepdir /"${LIBDIR}"/rc/init.d
136 keepdir /"${LIBDIR}"/rc/tmp
137
138 # Backup our default runlevels
139 dodir /usr/share/"${PN}"
140 mv "${D}/etc/runlevels" "${D}/usr/share/${PN}"
141
142 # Setup unicode defaults for silly unicode users
143 use unicode && sed -i -e '/^unicode=/s:NO:YES:' "${D}"/etc/rc.conf
144
145 # Cater to the norm
146 (use x86 || use amd64) && sed -i -e '/^windowkeys=/s:NO:YES:' "${D}"/etc/conf.d/keymaps
147 }
148
149 add_boot_init() {
150 local initd=$1
151 # if the initscript is not going to be installed and is not
152 # currently installed, return
153 [[ -e ${D}/etc/init.d/${initd} || -e ${ROOT}/etc/init.d/${initd} ]] \
154 || return
155 [[ -e ${ROOT}/etc/runlevels/boot/${initd} ]] && return
156 elog "Auto-adding '${initd}' service to your boot runlevel"
157 ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/boot/${initd}
158 }
159 add_boot_init_mit_config() {
160 local config=$1 initd=$2
161 if [[ -e ${ROOT}${config} ]] ; then
162 if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${ROOT}"/${config}) ]] ; then
163 add_boot_init ${initd}
164 fi
165 fi
166 }
167
168 pkg_preinst() {
169 local f
170
171 # default net script is just comments, so no point in biting people
172 # in the ass by accident
173 mv "${D}"/etc/conf.d/net "${T}"/
174 [[ -e ${ROOT}/etc/conf.d/net ]] && cp "${ROOT}"/etc/conf.d/net "${T}"/
175
176 # /etc/conf.d/clock moved to /etc/conf.d/hwclock
177 local clock
178 use kernel_FreeBSD && clock="adjkerntz" || clock="hwclock"
179 if [[ -e ${ROOT}/etc/conf.d/clock ]] ; then
180 mv "${ROOT}"/etc/conf.d/clock "${ROOT}"/etc/conf.d/${clock}
181 fi
182 if [[ -L ${ROOT}/etc/runlevels/boot/clock ]] ; then
183 rm -f "${ROOT}"/etc/runlevels/boot/clock
184 ln -snf /etc/init.d/${clock} "${ROOT}"/etc/runlevels/boot/${clock}
185 fi
186 if [[ -L ${ROOT}${LIBDIR}/rc/init.d/started/clock ]] ; then
187 rm -f "${ROOT}${LIBDIR}"/rc/init.d/started/clock
188 ln -snf /etc/init.d/${clock} "${ROOT}${LIBDIR}"/rc/init.d/started/${clock}
189 fi
190
191 # /etc/conf.d/rc is no longer used for configuration
192 if [[ -e ${ROOT}/etc/conf.d/rc ]] ; then
193 elog "/etc/conf.d/rc is no longer used for configuration."
194 elog "Please migrate your settings to /etc/rc.conf as applicable"
195 elog "and delete /etc/conf.d/rc"
196 fi
197
198 # upgrade timezone file
199 if [[ -e ${ROOT}/etc/conf.d/clock && ! -e ${ROOT}/etc/timezone ]] ; then
200 (
201 source "${ROOT}"/etc/conf.d/clock
202 [[ -n ${TIMEZONE} ]] && echo "${TIMEZONE}" > "${ROOT}"/etc/timezone
203 )
204 fi
205
206 # force net init.d scripts into symlinks
207 for f in $(find "${ROOT}"/etc/init.d/ -name 'net.*') ; do
208 [[ ${f} == *.openrc.bak ]] && continue
209 if [[ ! -L ${f} ]] ; then
210 elog "Moved net service '${f##*/}' to '${f##*/}.openrc.bak' to force a symlink."
211 elog "You should delete '${f##*/}.openrc.bak' if you don't need it."
212 mv "${f}" "${f}.openrc.bak"
213 ln -snf net.lo "${f}"
214 fi
215 done
216
217 # termencoding was added in 0.2.1 and needed in boot
218 has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
219
220 # skip remaining migration if we already have openrc installed
221 has_version sys-apps/openrc && return 0
222
223 # baselayout boot init scripts have been split out
224 for f in $(cd "${D}"/usr/share/${PN}/runlevels/boot || exit; echo *) ; do
225 add_boot_init ${f}
226 done
227
228 # Try to auto-add some addons when possible
229 add_boot_init_mit_config /etc/conf.d/cryptfs dmcrypt
230 add_boot_init_mit_config /etc/conf.d/dmcrypt dmcrypt
231 add_boot_init_mit_config /etc/mdadm.conf mdraid
232 add_boot_init_mit_config /etc/evms.conf evms
233 [[ -e ${ROOT}/sbin/dmsetup ]] && add_boot_init device-mapper
234 [[ -e ${ROOT}/sbin/vgscan ]] && add_boot_init lvm
235 elog "Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone"
236 elog "init.d scripts. If you use such a thing, make sure you have the"
237 elog "required init.d scripts added to your boot runlevel."
238
239 # Upgrade out state for baselayout-1 users
240 if [[ ! -e ${ROOT}${LIBDIR}/rc/init.d/started ]] ; then
241 (
242 [[ -e ${ROOT}/etc/conf.d/rc ]] && source "${ROOT}"/etc/conf.d/rc
243 svcdir=${svcdir:-/var/lib/init.d}
244 if [[ ! -d ${ROOT}${svcdir}/started ]] ; then
245 ewarn "No state found, and no state exists"
246 elog "You should reboot this host"
247 else
248 mkdir -p "${ROOT}${LIBDIR}/rc/init.d"
249 einfo "Moving state from ${ROOT}${svcdir} to ${ROOT}${LIBDIR}/rc/init.d"
250 mv "${ROOT}${svcdir}"/* "${ROOT}${LIBDIR}"/rc/init.d
251 rm -rf "${ROOT}${LIBDIR}"/rc/init.d/daemons \
252 "${ROOT}${LIBDIR}"/rc/init.d/console
253 umount "${ROOT}${svcdir}" 2>/dev/null
254 rm -rf "${ROOT}${svcdir}"
255 fi
256 )
257 fi
258
259 # Handle the /etc/modules.autoload.d -> /etc/conf.d/modules transition
260 if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
261 elog "Converting your /etc/modules.autoload.d/ files to /etc/conf.d/modules"
262 rm -f "${ROOT}"/etc/modules.autoload.d/.keep*
263 rmdir "${ROOT}"/etc/modules.autoload.d 2>/dev/null
264 if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
265 local f v
266 for f in "${ROOT}"/etc/modules.autoload.d/* ; do
267 v=${f##*/}
268 v=${v#kernel-}
269 v=${v//[^[:alnum:]]/_}
270 gawk -v v="${v}" -v f="${f##*/}" '
271 BEGIN { print "\n### START: Auto-converted from " f "\n" }
272 {
273 if ($0 ~ /^[^#]/) {
274 print "modules_" v "=\"${modules_" v "} " $1 "\""
275 gsub(/[^[:alnum:]]/, "_", $1)
276 printf "module_" $1 "_args_" v "=\""
277 for (i = 2; i <= NF; ++i) {
278 if (i > 2)
279 printf " "
280 printf $i
281 }
282 print "\"\n"
283 } else
284 print
285 }
286 END { print "\n### END: Auto-converted from " f "\n" }
287 ' "${f}" >> "${D}"/etc/conf.d/modules
288 done
289 rm -f "${f}"
290 rmdir "${ROOT}"/etc/modules.autoload.d 2>/dev/null
291 fi
292 fi
293 }
294
295 pkg_postinst() {
296 # Remove old baselayout links
297 rm -f "${ROOT}"/etc/runlevels/boot/{check{fs,root},rmnologin}
298
299 [[ -e ${T}/net && ! -e ${ROOT}/etc/conf.d/net ]] && mv "${T}"/net "${ROOT}"/etc/conf.d/net
300
301 # Make our runlevels if they don't exist
302 if [[ ! -e ${ROOT}/etc/runlevels ]] ; then
303 einfo "Copying across default runlevels"
304 cp -RPp "${ROOT}"/usr/share/${PN}/runlevels "${ROOT}"/etc
305 fi
306
307 if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
308 ewarn "/etc/modules.autoload.d is no longer used. Please convert"
309 ewarn "your files to /etc/conf.d/modules and delete the directory."
310 fi
311
312 elog "You should now update all files in /etc, using etc-update"
313 elog "or equivalent before restarting any services or this host."
314 elog
315 elog "Please read the migration guide available at:"
316 elog "http://www.gentoo.org/doc/en/openrc-migration.xml"
317 }
318
319
320
321 --
322 gentoo-commits@l.g.o mailing list