dev-lang/spidermonkey: amd64 stable wrt bug #718732
[gentoo.git] / app-emulation / simplevirt / simplevirt-0.0_p20181012.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 EGO_VENDOR=(
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"
12 )
13
14 inherit linux-info golang-vcs-snapshot user
15
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"
20
21 DESCRIPTION="Simple virtual machine manager for Linux (QEMU/KVM)"
22 HOMEPAGE="https://github.com/rafaelmartins/simplevirt"
23 SRC_URI="
24         ${ARCHIVE_URI}
25         ${EGO_VENDOR_URI}"
26
27 LICENSE="Apache-2.0 BSD-2 BSD MIT"
28 SLOT="0"
29 KEYWORDS=""
30 IUSE=""
31
32 RDEPEND="
33         virtual/logger
34         app-emulation/qemu"
35
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"
39
40 pkg_setup() {
41         enewgroup simplevirt
42
43         linux-info_pkg_setup
44 }
45
46 src_compile() {
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
50 }
51
52 src_install() {
53         dobin bin/simplevirtctl
54         dosbin bin/simplevirtd
55
56         newinitd "${FILESDIR}/simplevirtd.initd" simplevirtd
57         newconfd "${FILESDIR}/simplevirtd.confd" simplevirtd
58
59         dodoc "src/${EGO_PN}/README.md"
60
61         keepdir /etc/simplevirt
62 }
63
64 src_test() {
65         pushd src/${EGO_PN} > /dev/null || die
66         GOPATH="${S}" go test -v ./pkg/... || die
67         popd > /dev/null || die
68 }
69
70 pkg_postinst() {
71         elog
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"
75         elog
76         elog "systemd is not supported for now."
77         elog
78         elog "To use simplevirtctl as a non-root user, add yourself to the 'simplevirt' group:"
79         elog "  usermod -aG simplevirt youruser"
80         elog
81 }