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