autotools.eclass: Merge "support AM_GNU_GETTEXT_REQUIRE_VERSION"
[gentoo.git] / sys-cluster / vzctl / vzctl-4.9.4.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit base bash-completion-r1 eutils toolchain-funcs udev
8
9 DESCRIPTION="OpenVZ ConTainers control utility"
10 HOMEPAGE="http://openvz.org/"
11 SRC_URI="http://download.openvz.org/utils/${PN}/${PV}/src/${P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc64 ~x86 -amd64-fbsd -sparc-fbsd -x86-fbsd"
16 IUSE="+ploop +vzmigrate"
17
18 RDEPEND="net-firewall/iptables
19                 sys-apps/ed
20                 >=sys-apps/iproute2-3.3.0
21                 >=sys-fs/vzquota-3.1
22                 ploop? (
23                         >=sys-cluster/ploop-1.13
24                         sys-block/parted
25                         sys-fs/quota
26                         dev-libs/libxml2
27                         )
28                 >=dev-libs/libcgroup-0.38
29                 vzmigrate? (
30                 net-misc/openssh
31                 net-misc/rsync[xattr,acl]
32                 app-arch/tar[xattr,acl]
33                 net-misc/bridge-utils
34                 virtual/awk
35                         )
36                 virtual/udev
37                 sys-apps/attr
38                 "
39
40 DEPEND="${RDEPEND}
41         virtual/pkgconfig
42         "
43
44 src_prepare() {
45
46         # Set default OSTEMPLATE on gentoo
47         sed -i -e 's:=redhat-:=gentoo-:' etc/dists/default || die 'sed on etc/dists/default failed'
48         # Set proper udev directory
49         sed -i -e "s:/lib/udev:$(get_udevdir):" src/lib/dev.c || die 'sed on src/lib/dev.c failed'
50 }
51
52 src_configure() {
53
54         econf \
55                 --localstatedir=/var \
56                 --enable-udev \
57                 --enable-bashcomp \
58                 --enable-logrotate \
59                 --with-vz \
60                 $(use_with ploop) \
61                 --with-cgroup
62 }
63
64 src_install() {
65
66         emake DESTDIR="${D}" udevdir="$(get_udevdir)"/rules.d install install-gentoo
67
68         # install the bash-completion script into the right location
69         rm -rf "${ED}"/etc/bash_completion.d
70         newbashcomp etc/bash_completion.d/vzctl.sh ${PN}
71
72         # We need to keep some dirs
73         keepdir /vz/{dump,lock,root,private,template/cache}
74         keepdir /etc/vz/names /var/lib/vzctl/veip
75 }
76
77 pkg_postinst() {
78         einfo "This vzctl release required kernel above 2.6.32.92"
79
80         einfo "If you have checkpoint suspend/restore feature in vanilla kernel"
81         einfo "please install "sys-process/criu" "
82         einfo "This is experimental and not stable ( in gentoo ) now"
83
84         einfo "if you have work with  .xz compressed template, please install app-arch/xz-utils"
85         einfo "if you have check signature downloaded template - install gpg "
86 }