summaryrefslogtreecommitdiff
blob: 3e51048ba77dc2c48d97aadc7d7e62d234e063a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit autotools eutils subversion

DESCRIPTION="Linux-VServer Control Daemon."
HOMEPAGE="http://svn.linux-vserver.org/projects/vcd/"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="client server"

DEPEND="dev-libs/confuse
		=dev-libs/lucid-svn-9999
		=sys-libs/libvserver-svn-9999
		>=dev-libs/xmlrpc-c-1.05
		server? ( >=dev-db/sqlite-3 )"
RDEPEND="${DEPEND}
		=sys-cluster/vwrappers-svn-9999"

ESVN_REPO_URI="http://svn.linux-vserver.org/svn/vcd/trunk"
ESVN_BOOTSTRAP="make -f Makefile.svn"

pkg_setup() {
	if built_with_use dev-libs/xmlrpc-c threads ; then
		eerror "You have threads support enabled in XMLRPC-C."
		eerror "This is likely to cause problems in ${PN}."
		eerror "Please remove the 'threads' USE flag from XMLRPC-C!"
		die "No threads support possible"
	fi

	if ! built_with_use dev-libs/xmlrpc-c curl &&
	   ! built_with_use dev-libs/xmlrpc-c libwww ; then
		eerror "No client transport found in XMLRPC-C!"
		eerror "Please enable the 'curl' or 'libwww' USE flags in XMLRPC-C."
		die "No client transport found"
	fi

	einfo
	einfo "You can set your vserver base directory using the VSERVERDIR"
	einfo "environment variable."
	einfo
	einfo "Using ${VSERVERDIR:=/vservers} as vserver base directory"
	einfo
}

src_compile() {
	econf --with-vserverdir="${VSERVERDIR}" \
		$(use_enable client) \
		$(use_enable server) \
		|| die "econf failed"

	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"

	if use server ; then
		keepdir "${VSERVERDIR}"
		keepdir /var/lib/vcd
		newinitd "${FILESDIR}/vcd-initd" vcd || die "Inserting init.d-file failed"
	fi

	dodoc README ChangeLog AUTHORS
}