add support for openrc; cleanup old cruft
authorBenedikt Boehm <hollow@gentoo.org>
Tue, 11 Mar 2008 10:19:36 +0000 (10:19 +0000)
committerBenedikt Boehm <hollow@gentoo.org>
Tue, 11 Mar 2008 10:19:36 +0000 (10:19 +0000)
Package-Manager: portage-2.1.4.4

sys-cluster/util-vserver/ChangeLog
sys-cluster/util-vserver/Manifest
sys-cluster/util-vserver/files/init.d/vprocunhide [deleted file]
sys-cluster/util-vserver/files/init.d/vservers.default [deleted file]
sys-cluster/util-vserver/files/util-vserver-0.30.212-initpost.patch [deleted file]
sys-cluster/util-vserver/files/util-vserver-0.30.212-vsomething-fix.patch [deleted file]
sys-cluster/util-vserver/files/util-vserver-0.30.212-wrapper.patch [deleted file]
sys-cluster/util-vserver/files/util-vserver-0.30.214-openrc.patch [new file with mode: 0644]
sys-cluster/util-vserver/util-vserver-0.30.214-r1.ebuild [moved from sys-cluster/util-vserver/util-vserver-0.30.212-r2.ebuild with 76% similarity]

index fa04f7913f2374e5ab75a1fab7e4115f85076e24..a72588664e86e97241bbda5fcdbd7a7cace71152 100644 (file)
@@ -1,6 +1,17 @@
 # ChangeLog for sys-cluster/util-vserver
-# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/ChangeLog,v 1.86 2007/11/18 10:23:54 hollow Exp $
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/ChangeLog,v 1.87 2008/03/11 10:19:34 hollow Exp $
+
+*util-vserver-0.30.214-r1 (11 Mar 2008)
+
+  11 Mar 2008; Benedikt Böhm <hollow@gentoo.org>
+  -files/util-vserver-0.30.212-initpost.patch,
+  -files/util-vserver-0.30.212-vsomething-fix.patch,
+  -files/util-vserver-0.30.212-wrapper.patch,
+  +files/util-vserver-0.30.214-openrc.patch, -files/init.d/vprocunhide,
+  -files/init.d/vservers.default, -util-vserver-0.30.212-r2.ebuild,
+  +util-vserver-0.30.214-r1.ebuild:
+  add support for openrc; cleanup old cruft
 
   18 Nov 2007; Benedikt Böhm <hollow@gentoo.org>
   files/util-vserver-0.30.214-baselayout2_path.patch:
index 8196cdee0d6c491c30b996bec41d1c61f074ada1..06e3a62acc7f809b5abf7f2c2b6ef6cac9379912 100644 (file)
@@ -1,13 +1,8 @@
 AUX bash_completion 7568 RMD160 45feafa30f715fb287403518eee8c45fecfe418e SHA1 d281bcad111df21ab0f37703142dd102145d784e SHA256 2232166a5aed9857a7a5c30adfdd4ea944e0608a29fad05f229b8cef2d61795d
-AUX init.d/vprocunhide 506 RMD160 b26000655f88eba51e2e80b5665f49b7698324a3 SHA1 f1bf6bc18f228c16090bbd8daec0b1e497ef75a8 SHA256 4e7f95b4bd0aca85383d0fc5ce9ffd78869a60e6f0f2dffaa4b1c8ec9d9b2c3d
-AUX init.d/vservers.default 328 RMD160 4ae796520847688da33befaa551faefd58be8184 SHA1 0fe4e1c1ee93bd9f28f2f4dbbc078fbdc2940620 SHA256 cdab1911b6d13a3253c2744ee1b007eda16d28c24d9eeea732d63934a1bdaaba
-AUX util-vserver-0.30.212-initpost.patch 2066 RMD160 70194e005c573eba073d95415188c9ed779511e9 SHA1 180fe7a2187af1247f3695e1687efe506d1ac929 SHA256 231c86e9f2ce2aa2ac1643662162c9e064fbeff620b6781fd13e5edb2439d527
-AUX util-vserver-0.30.212-vsomething-fix.patch 2174 RMD160 d56ccb5406ceb37e6139158a353af8c318afd76d SHA1 8d86c976e8968b5d0ae055260b590fd29a78c7e4 SHA256 2316404887b69095ff1090e5ed4e612286423b68886a66c16e6e9de99713e2f2
-AUX util-vserver-0.30.212-wrapper.patch 1349 RMD160 f8c4bfd740846c43e56a97db86302e81b8afa1c8 SHA1 2b5e04383bc3e5a52ae2fde86eb77a8f3cf8eeb5 SHA256 548b9732f12492f1ca58d72c3fd8634c99047d1619c19a1c9407a6864150c3fe
 AUX util-vserver-0.30.214-baselayout2_path.patch 648 RMD160 7775e5bc109774f9f253a88157739b5eb88ffc87 SHA1 fe8a94e8e0c76989b6d7268f9c9a07183a63b183 SHA256 59ad64c7b5356c16f500dc328eec989844301adeeefd4fe968955a03e9eb2630
-DIST util-vserver-0.30.212.tar.bz2 643139 RMD160 e0bb7600204c99bf2192332b2fb5680cd647d226 SHA1 366e9aa56490de71dccebf7ee99a81e37a274267 SHA256 dad182f0c882f32d96cab8d9065e4417d9c2f8146e1e2c9f197580389cc4a484
+AUX util-vserver-0.30.214-openrc.patch 4903 RMD160 12681cb3ed9904cbb99c7ad7411325b5856f45cf SHA1 530fb6e8077c5f4f4323811f06b8124a5e211419 SHA256 2abe4a75c33944205e0ba2f93009c45c1886c365ea141901df45af633b4c462b
 DIST util-vserver-0.30.214.tar.bz2 676250 RMD160 fbcf8b23719af991443d59f6c8670e99e2b746d6 SHA1 d0996cd6415db91c869912680e9b9798edd57228 SHA256 c88a27ccd1593f4396e1cf4aca37c715c7618a77d709ad63c7cc744ca1557c45
-EBUILD util-vserver-0.30.212-r2.ebuild 3825 RMD160 55abe18531b899dd143610f67baa9f4f36bea357 SHA1 1d633e3b7b51f9be305166cf7333633399a5b7c0 SHA256 f135b163663292611ec8f7b0448833bbfa38d279a784ea3c92715e0642c79e12
+EBUILD util-vserver-0.30.214-r1.ebuild 3737 RMD160 a51767e5866e4676fc2e3efbb508dd96aed6b871 SHA1 34b230de4438bf8601094a7aa36c6fd95d80bd73 SHA256 2d4f6920f19f348356893253993fe798dec0711f5e84882e88adac8120dceee2
 EBUILD util-vserver-0.30.214.ebuild 3742 RMD160 81da7567905875d7b97a1823505300630a0443bf SHA1 b5b8f513d43aea27ac40b3b8738bcd5d71c85b91 SHA256 b2270da4758be3a2407dc6a8a82dda6f5217aa9372d5fe05fc4a5dc5b85fe309
-MISC ChangeLog 17532 RMD160 676729460132adba33914d94bb2b7ef2525a9bae SHA1 fe2b30f34a04edcf5343c5b34da85aad28efa182 SHA256 5896649cffc94e5a57131ec53cf0dfd5c74b358cbb30cd5fd707b02bee559df0
+MISC ChangeLog 17990 RMD160 8b4c9470a45d9b920c1da23f9c55cd5be2c7b92c SHA1 f4f493bd79a4a18be49e1cea8a350f646c7728b7 SHA256 c9c240f7aa0a8160d22b4edfb07c429b23d3a76dfe656c67e6ee00d7ef49a9d0
 MISC metadata.xml 588 RMD160 43bd819942f6f0c03bec0bcf67601a7099b59a2b SHA1 d0e5af40193886066bbe1060324dede1f0fd367f SHA256 798e87b6d5fb379322178e9f8b7432371f630caaf3fd6ff369e35056483cc31d
diff --git a/sys-cluster/util-vserver/files/init.d/vprocunhide b/sys-cluster/util-vserver/files/init.d/vprocunhide
deleted file mode 100755 (executable)
index d7199ca..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-start() {
-       : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
-       if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then
-               eerror "Cannot find util-vserver installation"
-               eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
-               return 1
-       fi
-       
-       source ${UTIL_VSERVER_VARS}
-       
-       ebegin "Fixing /proc entries visibility"
-       ${_VPROCUNHIDE}
-       eend $?
-}
-
-# vim:ts=4:filetype=gentoo-init-d
diff --git a/sys-cluster/util-vserver/files/init.d/vservers.default b/sys-cluster/util-vserver/files/init.d/vservers.default
deleted file mode 100755 (executable)
index 76f9ca3..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-start() {
-       MARK=${SVCNAME#vservers.} /usr/lib/util-vserver/vserver-wrapper start
-}
-
-stop() {
-       MARK=${SVCNAME#vservers.} /usr/lib/util-vserver/vserver-wrapper stop
-}
-
-
-
-# vim:ts=4:filetype=gentoo-init-d
diff --git a/sys-cluster/util-vserver/files/util-vserver-0.30.212-initpost.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.212-initpost.patch
deleted file mode 100644 (file)
index 2717841..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-Index: util-vserver-0.30.212/distrib/gentoo/initpost
-===================================================================
---- util-vserver-0.30.212.orig/distrib/gentoo/initpost
-+++ util-vserver-0.30.212/distrib/gentoo/initpost
-@@ -17,7 +17,8 @@
- 
- ## Called as: initpost <cfgdir> <path of util-vserver-vars>
- 
--vdir="$1"/vdir
-+cfgdir="$1"
-+vdir="$cfgdir"/vdir
- . "$2"
- 
- # portage stuff
-@@ -29,7 +30,7 @@ popd &>/dev/null
- 
- # gentoo initstyle magic
- initstyle=sysv
--test -e "$1"/apps/init/style && initstyle=$(<"$1"/apps/init/style)
-+test -e "$cfgdir"/apps/init/style && initstyle=$(<"$cfgdir"/apps/init/style)
- 
- if test "$initstyle" == "gentoo"; then
-       pushd "$vdir" &>/dev/null
-@@ -53,6 +54,31 @@ if test "$initstyle" == "gentoo"; then
- fi
- 
- 
-+# unneeded runlevel scripts
-+pushd "$vdir" &>/dev/null
-+echo ">>> Fixing default runlevel scripts ... "
-+$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
-+$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
-+popd &>/dev/null
-+
-+
-+# setting hostname
-+pushd "$vdir" &>/dev/null
-+
-+if test -r "$cfgdir"/uts/nodename && $_CHROOT_SH testfile /etc/conf.d/hostname; then
-+      echo ">>> Setting hostname ... "
-+      hostnametmp=$($_MKTEMP hostname.XXXXXX)
-+
-+      $_CHROOT_SH cat /etc/conf.d/hostname | \
-+      $_SED "s:HOSTNAME=\"\(.*\)\":HOSTNAME=\"$(< "$cfgdir"/uts/nodename)\":" > $hostnametmp
-+      $_CHROOT_SH truncate /etc/conf.d/hostname  < $hostnametmp
-+
-+      $_RM -f $hostnametmp
-+fi
-+
-+popd &>/dev/null
-+
-+
- # check for baselayout >= 1.13
- pushd "$vdir" &>/dev/null
- basever=$($_CHROOT_SH cat /etc/gentoo-release | $_AWK '{print $5}')
-@@ -88,14 +114,6 @@ fi
- popd &>/dev/null
- 
- 
--# unneeded runlevel scripts
--pushd "$vdir" &>/dev/null
--echo ">>> Fixing default runlevel scripts ... "
--$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
--$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
--popd &>/dev/null
--
--
- # fix fstab for checkfs/localmount
- pushd "$vdir" &>/dev/null
- echo ">>> Fixing fstab ... "
diff --git a/sys-cluster/util-vserver/files/util-vserver-0.30.212-vsomething-fix.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.212-vsomething-fix.patch
deleted file mode 100644 (file)
index ead3fff..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-Index: util-vserver-0.30.212/scripts/vupdateworld
-===================================================================
---- util-vserver-0.30.212/scripts/vupdateworld (revision 2452)
-+++ util-vserver-0.30.212/scripts/vupdateworld (revision 2486)
-@@ -65,4 +65,14 @@
- done
- 
-+declare -a vserver_names
-+
-+while [ $# -gt 0 ]; do
-+    case "$1" in
-+      (--)            shift; break;;
-+      (*)             vserver_names=( "${vserver_names[@]}" "$1" );;
-+    esac
-+    shift
-+done
-+
- VSOMETHING_TITLE=vemerge
- VSOMETHING_PKGMGMT=1
-@@ -71,3 +81,3 @@
- 
- test ${#vsomething_opts[@]} -eq 0 || vsomething_opts=( "${vsomething_opts[@]}" -- )
--exec $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" --update --deep --newuse "$@"
-+exec $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" "${vserver_names[@]}" -- world --update --deep --newuse "$@"
-Index: util-vserver-0.30.212/scripts/vdispatch-conf
-===================================================================
---- util-vserver-0.30.212/scripts/vdispatch-conf (revision 2363)
-+++ util-vserver-0.30.212/scripts/vdispatch-conf (revision 2486)
-@@ -70,3 +70,3 @@
- export VSOMETHING_TITLE VSOMETHING_PKGMGMT
- 
--exec $_VSOMETHING "${send_through[@]}" dispatch-conf "${vsomething_opts[@]}"
-+exec $_VSOMETHING "${send_through[@]}" dispatch-conf "${vsomething_opts[@]}" "$@"
-Index: util-vserver-0.30.212/scripts/vesync
-===================================================================
---- util-vserver-0.30.212/scripts/vesync (revision 2363)
-+++ util-vserver-0.30.212/scripts/vesync (revision 2486)
-@@ -76,15 +76,13 @@
- export VSOMETHING_TITLE VSOMETHING_PKGMGMT
- 
--test ${#vsomething_opts[@]} -eq 0 || vsomething_opts=( "${vsomething_opts[@]}" -- )
--
- ret=0
- 
- test $overlay_only -eq 0 && \
--      $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" --metadata
-+      $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" "$@" -- --metadata
- 
- ret=$?
- 
- test -n "$overlay" -a -n "$overlay_host" && \
--      $_VSOMETHING "${send_through[@]}" rsync "${vsomething_opts[@]}" \
-+      $_VSOMETHING "${send_through[@]}" rsync "${vsomething_opts[@]}" "$@" -- \
-       -rtW --progress --delete --delete-after "${overlay_host}/" "${overlay}/"
- 
diff --git a/sys-cluster/util-vserver/files/util-vserver-0.30.212-wrapper.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.212-wrapper.patch
deleted file mode 100644 (file)
index b712c7c..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-Index: /home/bene/work/vserver/util-vserver/scripts/vserver-wrapper
-===================================================================
---- scripts/vserver-wrapper    (revision 2423)
-+++ scripts/vserver-wrapper    (working copy)
-@@ -29,7 +29,7 @@
- 
- if test -e /etc/init.d/functions; then
-     . /etc/init.d/functions
--    _beginResult() { echo -n "$@"; }
-+    _beginResult() { echo -n "$@ ..."; }
-     lockfile=/var/lock/subsys/$LOCKFILE
- elif test -e /etc/gentoo-release; then
-     . /sbin/functions.sh
-@@ -39,7 +39,7 @@
-     failure() { eend "$@"; }
-     lockfile=/var/lock/vservers/$LOCKFILE
- else
--    _beginResult() { echo -n "$@"; }
-+    _beginResult() { echo -n "$@ ..."; }
-     success() { echo .; }
-     passed()  { echo .; }
-     failure() { echo ERROR; }
-@@ -54,13 +54,12 @@
-       (2)     passed; rc=0;;
-       (*)     failure;;
-     esac
--    echo
-     return $rc
- }
- 
- function start()
- {
--    _beginResult $"Starting vservers of type '$MARK'..."
-+    _beginResult $"Starting vservers of type '$MARK'"
-     $_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --start
-     _tellResult $?
-     local rc=$?
-@@ -70,7 +69,7 @@
- 
- function stop()
- {
--    _beginResult $"Stopping vservers of type '$MARK'..."
-+    _beginResult $"Stopping vservers of type '$MARK'"
-     $_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --stop
-     _tellResult $?
-     local rc=$?
diff --git a/sys-cluster/util-vserver/files/util-vserver-0.30.214-openrc.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.214-openrc.patch
new file mode 100644 (file)
index 0000000..247f365
--- /dev/null
@@ -0,0 +1,126 @@
+diff -NurpP util-vserver-0.30.214.orig/distrib/gentoo/initpost util-vserver-0.30.214/distrib/gentoo/initpost
+--- util-vserver-0.30.214.orig/distrib/gentoo/initpost 2007-09-02 22:06:42.000000000 +0200
++++ util-vserver-0.30.214/distrib/gentoo/initpost      2008-03-11 10:39:53.955478789 +0100
+@@ -51,6 +51,11 @@ $_CHROOT_SH mkdir /usr/portage 2>/dev/nu
+ $_CHROOT_SH mkdir /usr/portage/distfiles 2>/dev/null || :
+ 
+ 
++# check if we have openrc
++have_openrc=0
++$_CHROOT_SH testfile /lib/rc/bin/is_older_than && have_openrc=1
++
++
+ # gentoo initstyle magic
+ initstyle=sysv
+ test -e "$cfgdir"/apps/init/style && initstyle=$(<"$cfgdir"/apps/init/style)
+@@ -59,8 +64,8 @@ if test "$initstyle" == "gentoo"; then
+       echo ">>> Installing special init-style magic ... "
+ 
+       $_CAT "$__DISTRIBDIR"/gentoo/init-vserver.sh | \
+-      $_CHROOT_SH truncate   /lib/rcscripts/sh/init-vserver.sh
+-      $_CHROOT_SH chmod 0755 /lib/rcscripts/sh/init-vserver.sh
++      $_CHROOT_SH truncate   /lib/rc/sh/init-vserver.sh
++      $_CHROOT_SH chmod 0755 /lib/rc/sh/init-vserver.sh
+ 
+       $_CAT "$__DISTRIBDIR"/gentoo/reboot.sh | \
+       $_CHROOT_SH truncate   /etc/init.d/reboot.sh
+@@ -78,23 +83,29 @@ if test "$initstyle" == "gentoo"; then
+       echo "!!! Consult the Gentoo Handbook on how to chroot and install"
+       echo "!!! packages into the guest environment."
+       echo "!!!"
++else
++      # fix gettys in inittab
++      if $_CHROOT_SH testfile /etc/inittab; then
++              echo ">>> Fixing inittab ... "
++              chrootsed /etc/inittab \
++                      -e 's/\(^[^#].*getty.*$\)/#\1/'
++      fi
+ fi
+ 
+-
+ # unneeded runlevel scripts
+-echo ">>> Fixing default runlevel scripts ... "
+-$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
+-$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
+-
++if test $have_openrc -ne 1; then
++      echo ">>> Fixing default runlevel scripts ... "
++      $_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
++      $_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
++fi
+ 
+ # setting hostname
+ if test -r "$cfgdir"/uts/nodename && $_CHROOT_SH testfile /etc/conf.d/hostname; then
+       echo ">>> Setting hostname ... "
+       chrootsed /etc/conf.d/hostname \
+-              -e "s:HOSTNAME=\"\(.*\)\":HOSTNAME=\"$(< "$cfgdir"/uts/nodename)\":"
++              -e "s:\(HOSTNAME\)=\"\(.*\)\":\1=\"$(< "$cfgdir"/uts/nodename)\":i"
+ fi
+ 
+-
+ # fix syslog-ng.conf
+ if $_CHROOT_SH testfile /etc/syslog-ng/syslog-ng.conf; then
+       echo ">>> Fixing syslog-ng.conf ... "
+@@ -103,27 +114,21 @@ if $_CHROOT_SH testfile /etc/syslog-ng/s
+               -e 's:\(.*console_all.*\):#\1:g'
+ fi
+ 
+-
+-# fix gettys in inittab
+-if $_CHROOT_SH testfile /etc/inittab; then
+-      echo ">>> Fixing inittab ... "
+-      chrootsed /etc/inittab \
+-              -e 's/\(^[^#].*getty.*$\)/#\1/'
+-fi
+-
+-
+ # fix fstab for checkfs/localmount in baselayout-2
+ # (does not affect any previous versions)
+-echo ">>> Fixing fstab ... "
+-echo "/dev/hdv1 / ufs defaults 0 0" | $_CHROOT_SH truncate /etc/fstab
+-
++if test $have_openrc -ne 1; then
++      echo ">>> Fixing fstab ... "
++      echo "/dev/hdv1 / ufs defaults 0 0" | $_CHROOT_SH truncate /etc/fstab
++fi
+ 
+ # always satisfy net dependency in baselayout-2
+ # (does not affect any previous versions)
+-echo ">>> Providing dummy net dependency ... "
+-$_CAT "$__DISTRIBDIR"/gentoo/net.vserver | \
+-$_CHROOT_SH truncate /etc/init.d/net.vserver
+-$_CHROOT_SH chmod 0755 /etc/init.d/net.vserver
+-$_CHROOT_SH link /etc/init.d/net.vserver /etc/runlevels/boot/net.vserver
++if test $have_openrc -ne 1; then
++      echo ">>> Providing dummy net dependency ... "
++      $_CAT "$__DISTRIBDIR"/gentoo/net.vserver | \
++      $_CHROOT_SH truncate /etc/init.d/net.vserver
++      $_CHROOT_SH chmod 0755 /etc/init.d/net.vserver
++      $_CHROOT_SH link /etc/init.d/net.vserver /etc/runlevels/boot/net.vserver
++fi
+ 
+ popd &>/dev/null
+diff -NurpP util-vserver-0.30.214.orig/scripts/vserver.functions util-vserver-0.30.214/scripts/vserver.functions
+--- util-vserver-0.30.214.orig/scripts/vserver.functions       2007-09-02 22:06:41.000000000 +0200
++++ util-vserver-0.30.214/scripts/vserver.functions    2008-03-11 10:31:41.758515991 +0100
+@@ -314,9 +314,18 @@ function _generateInitOptions
+ 
+       (xgentoo)
+           test -n "$RUNLEVEL_START" || RUNLEVEL_START="default"
++          RC_PATH=/usr/sbin:/usr/bin:/sbin:/bin
+ 
+-          INITCMD_START=( env TERM=$TERM /lib/rcscripts/sh/init-vserver.sh "$RUNLEVEL_START" )
+-          INITCMD_STOP=( env -i TERM=$TERM RUNLEVEL=0 /sbin/rc shutdown )
++          if test -x "$vdir/vdir/lib/rcscripts/sh/init-vserver.sh"; then
++              RC_WRAP=/lib/rcscripts/sh/init-vserver.sh
++          elif test -x "$vdir/vdir/lib/rc/sh/init-vserver.sh"; then
++              RC_WRAP=/lib/rc/sh/init-vserver.sh
++          else
++              panic "init-vserver.sh not found; aborting"
++          fi
++
++          INITCMD_START=( env TERM=$TERM $RC_WRAP "$RUNLEVEL_START" )
++          INITCMD_STOP=( env -i PATH=$RC_PATH TERM=$TERM RUNLEVEL=0 /sbin/rc shutdown )
+           INITCMD_PREPARE=( $_FAKE_RUNLEVEL 3 /var/run/utmp )
+           ;;
+ 
similarity index 76%
rename from sys-cluster/util-vserver/util-vserver-0.30.212-r2.ebuild
rename to sys-cluster/util-vserver/util-vserver-0.30.214-r1.ebuild
index 48a354fd46a166d91afaa326520fcc29a2906361..d50ba865b6bf5a311f62d8f1ab4fbdcf7db5980a 100644 (file)
@@ -1,8 +1,10 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/util-vserver-0.30.212-r2.ebuild,v 1.2 2007/05/03 19:39:00 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/util-vserver-0.30.214-r1.ebuild,v 1.1 2008/03/11 10:19:34 hollow Exp $
 
-inherit eutils bash-completion
+WANT_AUTOMAKE="1.9"
+
+inherit autotools eutils bash-completion
 
 DESCRIPTION="Linux-VServer admin utilities"
 HOMEPAGE="http://www.nongnu.org/util-vserver/"
@@ -10,17 +12,20 @@ SRC_URI="http://ftp.linux-vserver.org/pub/utils/${PN}/${P}.tar.bz2"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~ppc ~sparc x86"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
 
 IUSE=""
 
-RDEPEND="dev-libs/beecrypt
+DEPEND=">=dev-libs/dietlibc-0.30-r2
+       dev-libs/beecrypt
        net-firewall/iptables
        net-misc/vconfig
        sys-apps/iproute2"
 
-DEPEND="${RDEPEND}
-       >=dev-libs/dietlibc-0.30-r2"
+RDEPEND="sys-apps/iproute2
+       net-misc/vconfig
+       net-firewall/iptables
+       dev-libs/beecrypt"
 
 pkg_setup() {
        if [[ -z "${VDIRBASE}" ]]; then
@@ -39,16 +44,13 @@ pkg_setup() {
 src_unpack() {
        unpack ${A}
        cd "${S}"
-
-       epatch "${FILESDIR}"/${P}-wrapper.patch
-       epatch "${FILESDIR}"/${P}-initpost.patch
-       epatch "${FILESDIR}"/${P}-vsomething-fix.patch
+       epatch "${FILESDIR}"/${P}-openrc.patch
 }
 
 src_compile() {
        econf --with-vrootdir=${VDIRBASE} \
-               --localstatedir=/var \
-               --with-initrddir=/etc/init.d || die "econf failed!"
+               --with-initscripts=gentoo \
+               --localstatedir=/var || die "econf failed!"
        emake || die "emake failed!"
 }
 
@@ -56,11 +58,6 @@ src_install() {
        make DESTDIR="${D}" install install-distribution \
                || die "make install failed!"
 
-       # create the /sbin/vshelper symlink so we don't have to mess around with
-       # (a) echoing stuff to /etc/sysctl.conf
-       # (b) changing the default vshelper in the kernel sources.
-       dosym /usr/lib/util-vserver/vshelper /sbin/vshelper
-
        # keep dirs
        keepdir /var/run/vservers
        keepdir /var/run/vservers.rev
@@ -68,17 +65,11 @@ src_install() {
        keepdir /var/lock/vservers
        keepdir /var/cache/vservers
        keepdir "${VDIRBASE}"
+       keepdir "${VDIRBASE}"/.pkg
 
        # remove legacy config file
        rm -f "${D}"/etc/vservers.conf
 
-       # remove the non-gentoo init-scripts:
-       rm -f "${D}"/etc/init.d/*
-
-       # and install gentoo'ized ones:
-       doinitd "${FILESDIR}"/init.d/vservers.default
-       doinitd "${FILESDIR}"/init.d/vprocunhide
-
        # bash-completion
        dobashcompletion "${FILESDIR}"/bash_completion util-vserver
 
@@ -86,6 +77,15 @@ src_install() {
 }
 
 pkg_postinst() {
+       # Create VDIRBASE in postinst, so it is (a) not unmerged and (b) also
+       # present when merging.
+
+       [ ! -d "${VDIRBASE}" ] && mkdir -p "${VDIRBASE}" &> /dev/null
+       setattr --barrier "${VDIRBASE}" &> /dev/null
+
+       rm /etc/vservers/.defaults/vdirbase
+       ln -sf "${VDIRBASE}" /etc/vservers/.defaults/vdirbase
+
        elog
        elog "You have to run the vprocunhide command after every reboot"
        elog "in order to setup /proc permissions correctly for vserver"