1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 "github.com/inconshreveable/mousetrap v1.0.0"
8 "github.com/spf13/cobra v0.0.3"
9 "github.com/spf13/pflag v1.0.2"
10 "gopkg.in/check.v1 20d25e2804050c1cd24a7eea1e7a6447dd0e74ec github.com/go-check/check"
11 "gopkg.in/yaml.v2 v2.2.1 github.com/go-yaml/yaml"
14 inherit linux-info golang-vcs-snapshot user
16 EGO_PN="github.com/rafaelmartins/simplevirt"
17 GIT_COMMIT="78d29d8fa11ce72af5f897430af7bb7d2947a32f"
18 GIT_VERSION="0.0.26-78d2"
19 ARCHIVE_URI="https://${EGO_PN}/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
21 DESCRIPTION="Simple virtual machine manager for Linux (QEMU/KVM)"
22 HOMEPAGE="https://github.com/rafaelmartins/simplevirt"
27 LICENSE="Apache-2.0 BSD-2 BSD MIT"
36 CONFIG_CHECK="~TUN ~BRIDGE"
37 ERROR_TUN="CONFIG_TUN: Universal TUN/TAP driver required to setup bridge networking"
38 ERROR_BRIDGE="CONFIG_BRIDGE: 802.1d Ethernet Bridging required to setup bridge networking"
47 pushd src/${EGO_PN} > /dev/null || die
48 GOPATH="${S}" go install -v -ldflags "-X ${EGO_PN}.Version=${GIT_VERSION}" ./cmd/... || die
49 popd > /dev/null || die
53 dobin bin/simplevirtctl
54 dosbin bin/simplevirtd
56 newinitd "${FILESDIR}/simplevirtd.initd" simplevirtd
57 newconfd "${FILESDIR}/simplevirtd.confd" simplevirtd
59 dodoc "src/${EGO_PN}/README.md"
61 keepdir /etc/simplevirt
65 pushd src/${EGO_PN} > /dev/null || die
66 GOPATH="${S}" go test -v ./pkg/... || die
67 popd > /dev/null || die
72 elog "To use simplevirt, the simplevirtd daemon must be running as root."
73 elog "To automatically start the daemon at boot, add it to the default runlevel:"
74 elog " rc-update add simplevirtd default"
76 elog "systemd is not supported for now."
78 elog "To use simplevirtctl as a non-root user, add yourself to the 'simplevirt' group:"
79 elog " usermod -aG simplevirt youruser"