| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-9999.ebuild,v 1.13 2012/12/13 08:45:38 pinkbyte Exp $
|
| 4 |
|
| 5 |
EAPI="5"
|
| 6 |
|
| 7 |
inherit bash-completion-r1 autotools git-2 toolchain-funcs udev
|
| 8 |
|
| 9 |
DESCRIPTION="OpenVZ ConTainers control utility"
|
| 10 |
HOMEPAGE="http://openvz.org/"
|
| 11 |
EGIT_REPO_URI="git://git.openvz.org/pub/${PN}
|
| 12 |
http://git.openvz.org/pub/${PN}"
|
| 13 |
|
| 14 |
LICENSE="GPL-2"
|
| 15 |
SLOT="0"
|
| 16 |
KEYWORDS=""
|
| 17 |
IUSE="cgroup +ploop"
|
| 18 |
|
| 19 |
RDEPEND="
|
| 20 |
net-firewall/iptables
|
| 21 |
sys-apps/ed
|
| 22 |
>=sys-apps/iproute2-3.3.0
|
| 23 |
sys-fs/vzquota
|
| 24 |
ploop? ( >=sys-cluster/ploop-1.5 )
|
| 25 |
cgroup? ( >=dev-libs/libcgroup-0.37 )
|
| 26 |
"
|
| 27 |
|
| 28 |
DEPEND="${RDEPEND}
|
| 29 |
virtual/pkgconfig"
|
| 30 |
|
| 31 |
src_prepare() {
|
| 32 |
# Set default OSTEMPLATE on gentoo
|
| 33 |
sed -i -e 's:=redhat-:=gentoo-:' etc/dists/default || die 'sed on etc/dists/default failed'
|
| 34 |
# Set proper udev directory
|
| 35 |
sed -i -e "s:/lib/udev:$(udev_get_udevdir):" src/lib/dev.c || die 'sed on src/lib/dev.c failed'
|
| 36 |
eautoreconf
|
| 37 |
}
|
| 38 |
|
| 39 |
src_configure() {
|
| 40 |
econf \
|
| 41 |
--localstatedir=/var \
|
| 42 |
--enable-udev \
|
| 43 |
--enable-bashcomp \
|
| 44 |
--enable-logrotate \
|
| 45 |
$(use_with ploop) \
|
| 46 |
$(use_with cgroup)
|
| 47 |
}
|
| 48 |
|
| 49 |
src_install() {
|
| 50 |
emake DESTDIR="${D}" udevdir="$(udev_get_udevdir)"/rules.d install install-gentoo
|
| 51 |
|
| 52 |
# install the bash-completion script into the right location
|
| 53 |
rm -rf "${ED}"/etc/bash_completion.d
|
| 54 |
newbashcomp etc/bash_completion.d/vzctl.sh ${PN}
|
| 55 |
|
| 56 |
# We need to keep some dirs
|
| 57 |
keepdir /vz/{dump,lock,root,private,template/cache}
|
| 58 |
keepdir /etc/vz/names /var/lib/vzctl/veip
|
| 59 |
}
|
| 60 |
|
| 61 |
pkg_postinst() {
|
| 62 |
ewarn "To avoid loosing network to CTs on iface down/up, please, add the"
|
| 63 |
ewarn "following code to /etc/conf.d/net:"
|
| 64 |
ewarn " postup() {"
|
| 65 |
ewarn " /usr/sbin/vzifup-post \${IFACE}"
|
| 66 |
ewarn " }"
|
| 67 |
|
| 68 |
ewarn "Starting with 3.0.25 there is new vzeventd service to reboot CTs."
|
| 69 |
ewarn "Please, drop /usr/share/vzctl/scripts/vpsnetclean and"
|
| 70 |
ewarn "/usr/share/vzctl/scripts/vpsreboot from crontab and use"
|
| 71 |
ewarn "/etc/init.d/vzeventd."
|
| 72 |
|
| 73 |
if use cgroup; then
|
| 74 |
ewarn "You have chose to use experimental CGROUP feature"
|
| 75 |
ewarn "please do NOT file bugs to Gentoo bugzilla,"
|
| 76 |
ewarn "use upstream bug tracker instead"
|
| 77 |
fi
|
| 78 |
}
|