| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/util-vserver-0.30.216_pre3011.ebuild,v 1.1 2012/02/17 10:13:52 hollow Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils bash-completion-r1
|
| 8 |
|
| 9 |
MY_P=${P/_/-}
|
| 10 |
S="${WORKDIR}"/${MY_P}
|
| 11 |
|
| 12 |
DESCRIPTION="Linux-VServer admin utilities"
|
| 13 |
HOMEPAGE="http://www.nongnu.org/util-vserver/"
|
| 14 |
SRC_URI="http://people.linux-vserver.org/~dhozac/t/uv-testing/${MY_P}.tar.bz2"
|
| 15 |
|
| 16 |
LICENSE="GPL-2"
|
| 17 |
SLOT="0"
|
| 18 |
KEYWORDS="~alpha amd64 ~sparc x86"
|
| 19 |
|
| 20 |
IUSE=""
|
| 21 |
|
| 22 |
CDEPEND="dev-libs/beecrypt
|
| 23 |
net-firewall/iptables
|
| 24 |
net-misc/vconfig
|
| 25 |
sys-apps/iproute2
|
| 26 |
|| ( >=sys-apps/coreutils-6.10-r1 sys-apps/mktemp )"
|
| 27 |
|
| 28 |
DEPEND=">=dev-libs/dietlibc-0.33_pre20110403
|
| 29 |
${CDEPEND}"
|
| 30 |
|
| 31 |
RDEPEND="${CDEPEND}"
|
| 32 |
|
| 33 |
pkg_setup() {
|
| 34 |
if [[ -z "${VDIRBASE}" ]]; then
|
| 35 |
einfo
|
| 36 |
einfo "You can change the default vserver base directory (/vservers)"
|
| 37 |
einfo "by setting the VDIRBASE environment variable."
|
| 38 |
fi
|
| 39 |
|
| 40 |
: ${VDIRBASE:=/vservers}
|
| 41 |
|
| 42 |
einfo
|
| 43 |
einfo "Using \"${VDIRBASE}\" as vserver base directory"
|
| 44 |
einfo
|
| 45 |
}
|
| 46 |
|
| 47 |
src_test() {
|
| 48 |
# do not use $D from portage by accident (#297982)
|
| 49 |
sed -i -e 's/^\$D //' "${S}"/src/testsuite/vunify-test.sh
|
| 50 |
default
|
| 51 |
}
|
| 52 |
|
| 53 |
src_configure() {
|
| 54 |
econf --with-vrootdir=${VDIRBASE} \
|
| 55 |
--with-initscripts=gentoo \
|
| 56 |
--localstatedir=/var
|
| 57 |
}
|
| 58 |
|
| 59 |
src_compile() {
|
| 60 |
emake || die "emake failed!"
|
| 61 |
}
|
| 62 |
|
| 63 |
src_install() {
|
| 64 |
make DESTDIR="${D}" install install-distribution \
|
| 65 |
|| die "make install failed!"
|
| 66 |
|
| 67 |
# keep dirs
|
| 68 |
keepdir /var/run/vservers
|
| 69 |
keepdir /var/run/vservers.rev
|
| 70 |
keepdir /var/run/vshelper
|
| 71 |
keepdir /var/lock/vservers
|
| 72 |
keepdir /var/cache/vservers
|
| 73 |
keepdir "${VDIRBASE}"
|
| 74 |
keepdir "${VDIRBASE}"/.pkg
|
| 75 |
|
| 76 |
# bash-completion
|
| 77 |
newbashcomp "${FILESDIR}"/bash_completion ${PN}
|
| 78 |
|
| 79 |
dodoc README ChangeLog NEWS AUTHORS THANKS util-vserver.spec
|
| 80 |
}
|
| 81 |
|
| 82 |
pkg_postinst() {
|
| 83 |
# Create VDIRBASE in postinst, so it is (a) not unmerged and (b) also
|
| 84 |
# present when merging.
|
| 85 |
|
| 86 |
mkdir -p "${VDIRBASE}"
|
| 87 |
setattr --barrier "${VDIRBASE}"
|
| 88 |
|
| 89 |
rm /etc/vservers/.defaults/vdirbase
|
| 90 |
ln -sf "${VDIRBASE}" /etc/vservers/.defaults/vdirbase
|
| 91 |
|
| 92 |
elog
|
| 93 |
elog "You have to run the vprocunhide command after every reboot"
|
| 94 |
elog "in order to setup /proc permissions correctly for vserver"
|
| 95 |
elog "use. An init script has been installed by this package."
|
| 96 |
elog "To use it you should add it to a runlevel:"
|
| 97 |
elog
|
| 98 |
elog " rc-update add vprocunhide default"
|
| 99 |
elog
|
| 100 |
}
|