summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2006-12-09 20:06:34 +0000
committerBenedikt Boehm <hollow@gentoo.org>2006-12-09 20:06:34 +0000
commit938ba08c26c73e5867a6dbf0ef7ce8ac80fddaf1 (patch)
tree27c86563268195e95abc0b19d6c0b48a60792381 /sys-cluster/util-vserver
parentVersion bump (diff)
downloadhistorical-938ba08c26c73e5867a6dbf0ef7ce8ac80fddaf1.tar.gz
historical-938ba08c26c73e5867a6dbf0ef7ce8ac80fddaf1.tar.bz2
historical-938ba08c26c73e5867a6dbf0ef7ce8ac80fddaf1.zip
version bump; cleanup
Package-Manager: portage-2.1.2_rc1-r6
Diffstat (limited to 'sys-cluster/util-vserver')
-rw-r--r--sys-cluster/util-vserver/ChangeLog11
-rw-r--r--sys-cluster/util-vserver/files/bash_completion300
-rw-r--r--sys-cluster/util-vserver/files/digest-util-vserver-0.30.2123
-rwxr-xr-xsys-cluster/util-vserver/files/init.d/vprocunhide20
-rwxr-xr-xsys-cluster/util-vserver/files/init.d/vservers.default15
-rw-r--r--sys-cluster/util-vserver/files/util-vserver-0.30.212-wrapper.patch46
-rw-r--r--sys-cluster/util-vserver/util-vserver-0.30.212.ebuild124
7 files changed, 518 insertions, 1 deletions
diff --git a/sys-cluster/util-vserver/ChangeLog b/sys-cluster/util-vserver/ChangeLog
index ab967542911e..078aa8bc7042 100644
--- a/sys-cluster/util-vserver/ChangeLog
+++ b/sys-cluster/util-vserver/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-cluster/util-vserver
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/ChangeLog,v 1.65 2006/10/07 21:12:29 phreak Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/ChangeLog,v 1.66 2006/12/09 20:06:34 hollow Exp $
+
+*util-vserver-0.30.212 (09 Dec 2006)
+
+ 09 Dec 2006; Benedikt Böhm <hollow@gentoo.org>
+ +files/util-vserver-0.30.212-wrapper.patch, +files/bash_completion,
+ +files/init.d/vprocunhide, +files/init.d/vservers.default,
+ -util-vserver-0.30.210-r17.ebuild, -util-vserver-0.30.210-r18.ebuild,
+ +util-vserver-0.30.212.ebuild:
+ version bump; cleanup
*util-vserver-0.30.211 (07 Oct 2006)
diff --git a/sys-cluster/util-vserver/files/bash_completion b/sys-cluster/util-vserver/files/bash_completion
new file mode 100644
index 000000000000..73a9fef89f85
--- /dev/null
+++ b/sys-cluster/util-vserver/files/bash_completion
@@ -0,0 +1,300 @@
+# Completion for the vserver command. Source this file (or on some systems
+# add it to ~/.bash_completion and start a new shell) and bash's completion
+# mechanism will know all about vserver's options!
+#
+# Copyright (C) Thomas Champagne <lafeuil@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The latest version of this software can be obtained here:
+#
+# http://linux-vserver.org/Vserver+Completion
+#
+# version 0.4.0
+
+have vserver-info && {
+: ${UTIL_VSERVER_VARS:=$(vserver-info - SYSINFO |grep prefix: | awk '{ print $2}')/lib/util-vserver/util-vserver-vars}
+
+test -e "$UTIL_VSERVER_VARS" && {
+
+. "$UTIL_VSERVER_VARS"
+. "$_LIB_FUNCTIONS"
+
+_vserver() {
+ local cur cmds cmdOpts cmdMethodOpts helpCmds names names_pipe func i j method
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ # find available vServers:
+ # call function getAllVservers in vserver library
+ getAllVservers names
+ names_pipe=`echo ${names[@]} | sed 's/ /|/g'`
+
+ # available commands
+ cmds='start stop restart condrestart suexec exec enter chkconfig \
+ running status unify pkg apt-get apt-config apt-cache \
+ rpm pkgmgmt delete'
+
+ # options (long and short name)
+ cmdOpts='--help --version --debug --defaulttty -s --sync -v \
+ --verbose --silent --'
+
+ cmdMethodOpts='-m -n --context --confdir --lockfile \
+ --hostname --netdev --netbcast --netmask \
+ --netprefix --interface --cpuset \
+ --cpusetcpus --cpusetmems --cpusetvirt \
+ --initstyle --flags --help --'
+
+ # if the previous option is a single option
+ helpCmds='--help|--version'
+ if [[ ${COMP_WORDS[1]} == @($helpCmds) ]] ; then
+ return 0
+ fi
+
+ # lookup the vServer name
+ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
+ if [[ ${COMP_WORDS[i]} == @($names_pipe) ]] ; then
+ # found it!
+ break
+ fi
+ done
+
+ #a vserver has been found
+ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then
+ # Show the vserver command without build
+ case "${COMP_WORDS[i+1]}" in
+ start)
+ COMPREPLY=( $( compgen -W "--rescue --rescue-cmd" -- $cur ) )
+ ;;
+ # No completion for apt-config
+ stop|restart|condrestart|enter|running|status|apt-config|delete)
+ ;;
+ suexec)
+ # I don't know how to do
+ COMPREPLY=( $( compgen -W -- $cur ) )
+ ;;
+ exec)
+ #I don't know how to do
+ COMPREPLY=( $( compgen -W "" -- $cur ) )
+ ;;
+ unify)
+ COMPREPLY=( $( compgen -W "-R" -- $cur ) )
+ ;;
+ apt-get|apt-cache)
+ func=${COMP_WORDS[i+1]}
+ COMP_WORDS=( ${COMP_WORDS[@]:$((i+1))} )
+ COMP_CWORD=$((COMP_CWORD-i-1))
+ declare -f _${func//-/_} > /dev/null && _${func//-/_}
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
+ ;;
+ esac
+ return 0
+ else
+ #no vserver name found
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ #search the new name of vserver
+ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
+ if [[ ${COMP_WORDS[i]} == !(vserver|-*) ]] ; then
+ # found it!
+ break
+ fi
+ done
+
+ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then
+ j=$i
+ i=${#COMP_WORDS[@]}
+ for (( ; j < ${#COMP_WORDS[@]}-1; j++ )) ; do
+ if [[ ${COMP_WORDS[j]} == "--" ]]; then
+ # method's parameter
+ case "$method" in
+ legacy|copy)
+ ;;
+ apt-rpm)
+ COMPREPLY=( $( compgen -W "-d" -- $cur ) )
+ ;;
+ yum)
+ COMPREPLY=( $( compgen -W "-d" -- $cur ) )
+ ;;
+ rpm)
+ COMPREPLY=( $( compgen -W "-d --empty --force --nodeps" -- $cur ) )
+ ;;
+ skeleton)
+ ;;
+ debootstrap)
+ COMPREPLY=( $( compgen -W "-d -m -s --" -- $cur ) )
+ ;;
+ *)
+ ;;
+ esac
+ return 0
+ break
+ fi
+
+ if [[ ${COMP_WORDS[j]} == @(build|-m) ]]; then
+ i=$j
+ if (( $j+1 < ${#COMP_WORDS[@]}-1 )) ; then
+ method=${COMP_WORDS[j+1]}
+ fi
+ fi
+ done
+
+ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then
+ case $prev in
+ --help)
+ ;;
+ -n|--context|--confdir|--lockfile|--hostname|--netdev|--netbcast|--netmask|--netprefix|--interface|--cpuset|--cpusetcpus|--cpusetmems|--cpusetvirt|--initstyle|--flags)
+ COMPREPLY=( $( compgen -W "" -- $cur ) )
+ ;;
+ -m)
+ COMPREPLY=( $( compgen -W "legacy copy apt-rpm yum rpm skeleton debootstrap" -- $cur ) )
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W "$cmdMethodOpts" -- $cur ) )
+ ;;
+ esac
+ else
+ COMPREPLY=( $( compgen -W "build" -- $cur ) )
+ fi
+ else
+ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) )
+ fi
+
+ return 0
+ fi
+
+ return 0
+}
+
+complete -F _vserver vserver
+
+_vapt_rpm_yum()
+{
+ local cur cmds cmdOpts helpCmds names func i
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ # options (long and short name)
+ cmdOpts='--help --version --quiet -q --all'
+
+ # if the previous option is a single option
+ helpCmds='--help|--version'
+
+ if [[ "${COMP_WORDS[1]}" == "@($helpCmds)" ]] ; then
+ return 0
+ fi
+
+ # search --
+ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
+ if [[ ${COMP_WORDS[i]} = "--" ]] ; then
+ # found it!
+ break
+ fi
+ done
+
+ # find available vServers
+ # call function getAllVservers in vserver library
+ getAllVservers names
+ names_pipe=`echo ${names[@]}" --all" | sed 's/ /|/g'`
+
+ if (( $i < ${#COMP_WORDS[@]}-1 )) && (( $i < $COMP_CWORD )) ; then
+ func=${COMP_WORDS[0]:1}
+ COMP_WORDS=( $func ${COMP_WORDS[@]:$((i+1))} )
+ COMP_CWORD=$((COMP_CWORD-i))
+ declare -f _${func//-/_} > /dev/null && _${func//-/_}
+ else
+ # search vServer name
+ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
+ if [[ ${COMP_WORDS[i]} == @($names_pipe) ]] ; then
+ # found it!
+ break
+ fi
+ done
+
+ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then
+ if [[ "${COMP_WORDS[i]}" = "--all" ]] ; then
+ cmdOpts='--'
+ COMPREPLY=( $( compgen -W "$cmdOpts" -- $cur ) )
+ else
+ cmdOpts='--'
+ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) )
+ fi
+ else
+ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) )
+ fi
+ fi
+
+ return 0
+}
+
+_vserver_copy()
+{
+ local cur prev cmdOpts helpCmds confCmds names names_pipe i
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ # find available vServers
+ # call function getAllVservers in vserver library
+ getAllVservers names
+ names_pipe=`echo ${names[@]} | sed 's/ /|/g'`
+
+ # options (long and short name)
+ cmdOpts='--help -h --version -V --verbose -v --quiet -q \
+ --vsroot -r --rsh -R --stopstart -s \
+ --domain -d --ip -i'
+
+ # if the previous option is a single option
+ helpCmds='--help|-h|--version|-V'
+
+ if [[ ${COMP_WORDS[1]} == @($helpCmds) ]] ; then
+ return 0
+ fi
+
+ confCmds='--ip|-i|--domain|-d'
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ if [[ $prev == @($confCmds) ]] ; then
+ return 0
+ fi
+
+ # search a vServer name
+ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
+ if [[ ${COMP_WORDS[i]} == @($names_pipe) ]] ; then
+ # found it!
+ break
+ fi
+ done
+
+ if (( $i < ${#COMP_WORDS[@]}-1 )) ; then
+ return 0
+ else
+ COMPREPLY=( $( compgen -W "${names[@]} $cmdOpts" -- $cur ) )
+ fi
+
+ return 0
+}
+
+complete -F _vapt_rpm_yum vapt-get
+complete -F _vapt_rpm_yum vrpm
+complete -F _vapt_rpm_yum vyum
+complete -F _vserver_copy vserver-copy
+
+}
+}
diff --git a/sys-cluster/util-vserver/files/digest-util-vserver-0.30.212 b/sys-cluster/util-vserver/files/digest-util-vserver-0.30.212
new file mode 100644
index 000000000000..0babb2f87de0
--- /dev/null
+++ b/sys-cluster/util-vserver/files/digest-util-vserver-0.30.212
@@ -0,0 +1,3 @@
+MD5 386b91732b7f0f132b4e9d978389dcc2 util-vserver-0.30.212.tar.bz2 643139
+RMD160 e0bb7600204c99bf2192332b2fb5680cd647d226 util-vserver-0.30.212.tar.bz2 643139
+SHA256 dad182f0c882f32d96cab8d9065e4417d9c2f8146e1e2c9f197580389cc4a484 util-vserver-0.30.212.tar.bz2 643139
diff --git a/sys-cluster/util-vserver/files/init.d/vprocunhide b/sys-cluster/util-vserver/files/init.d/vprocunhide
new file mode 100755
index 000000000000..d7199cab9892
--- /dev/null
+++ b/sys-cluster/util-vserver/files/init.d/vprocunhide
@@ -0,0 +1,20 @@
+#!/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
new file mode 100755
index 000000000000..76f9ca3edc19
--- /dev/null
+++ b/sys-cluster/util-vserver/files/init.d/vservers.default
@@ -0,0 +1,15 @@
+#!/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-wrapper.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.212-wrapper.patch
new file mode 100644
index 000000000000..b712c7c6c668
--- /dev/null
+++ b/sys-cluster/util-vserver/files/util-vserver-0.30.212-wrapper.patch
@@ -0,0 +1,46 @@
+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/util-vserver-0.30.212.ebuild b/sys-cluster/util-vserver/util-vserver-0.30.212.ebuild
new file mode 100644
index 000000000000..0e1240f8b7c7
--- /dev/null
+++ b/sys-cluster/util-vserver/util-vserver-0.30.212.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2006 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.ebuild,v 1.1 2006/12/09 20:06:34 hollow Exp $
+
+inherit autotools eutils bash-completion
+
+DESCRIPTION="Linux-VServer admin utilities"
+HOMEPAGE="http://www.nongnu.org/util-vserver/"
+SRC_URI="http://ftp.linux-vserver.org/pub/utils/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+
+IUSE=""
+
+DEPEND=">=dev-libs/dietlibc-0.30-r2
+ dev-libs/beecrypt
+ net-firewall/iptables
+ net-misc/vconfig
+ sys-apps/iproute2
+ sys-process/procps
+ =sys-devel/automake-1.9*"
+
+RDEPEND="sys-apps/iproute2
+ net-misc/vconfig
+ net-firewall/iptables
+ dev-libs/beecrypt
+ sys-process/procps"
+
+pkg_setup() {
+ if [[ -z "${VDIRBASE}" ]]; then
+ einfo
+ einfo "You can change the default vserver base directory (/vservers)"
+ einfo "by setting the VDIRBASE environment variable."
+ fi
+
+ : ${VDIRBASE:=/vservers}
+
+ einfo
+ einfo "Using \"${VDIRBASE}\" as vserver base directory"
+ einfo
+
+ myconf="${myconf} --with-vrootdir=${VDIRBASE}"
+
+ # default paths
+ myconf="${myconf} --localstatedir=/var"
+ myconf="${myconf} --with-initrddir=/etc/init.d"
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-wrapper.patch
+}
+
+src_compile() {
+ econf ${myconf} || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "install failed"
+ make DESTDIR="${D}" install-distribution || die "install-distribution failed"
+
+ # keep dirs
+ keepdir /var/run/vservers
+ keepdir /var/run/vservers.rev
+ keepdir /var/run/vshelper
+ keepdir /var/lock/vservers
+ keepdir /var/cache/vservers
+ keepdir "${VDIRBASE}"
+
+ # 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
+
+ dodoc README ChangeLog NEWS AUTHORS THANKS util-vserver.spec
+}
+
+pkg_postinst() {
+ einfo
+ einfo "You have to run the vprocunhide command after every reboot"
+ einfo "in order to setup /proc permissions correctly for vserver"
+ einfo "use. An init script has been installed by this package."
+ einfo "To use it you should add it to a runlevel:"
+ einfo
+ einfo " rc-update add vprocunhide default"
+ einfo
+ ewarn "Since util-vserver-0.30.211 all Gentoo specific wrappers"
+ ewarn "have been merged upstream, and may now have a slightly"
+ ewarn "different syntax, i.e. you have to update scripts that"
+ ewarn "depend on these wrappers (vesync, vemerge, vupdateworld"
+ ewarn "and vdispatch-conf)"
+ ewarn
+ ewarn "Additionally the init scripts have changed and now use"
+ ewarn "upstream scripts as backend. An init script to start"
+ ewarn "virtual servers in the 'default' group/mark has been"
+ ewarn "installed by this ebuild:"
+ ewarn
+ ewarn " rc-update add vservers.default default"
+ ewarn
+ ewarn "To start vservers in other groups/marks, you have to"
+ ewarn "symlink the default init script the same way you do"
+ ewarn "with net.* scripts:"
+ ewarn
+ ewarn " ln -s /etc/init.d/vservers.default /etc/init.d/vservers.<mark>"
+ ewarn
+ ewarn "You should definitly fix up the barrier of your vserver"
+ ewarn "base directory by using the following command in a root shell:"
+ ewarn
+ ewarn " setattr --barrier ${VDIRBASE}"
+ ewarn
+}