summaryrefslogtreecommitdiff
path: root/app-emulation/lxd
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/lxd')
-rw-r--r--app-emulation/lxd/Manifest4
-rw-r--r--app-emulation/lxd/lxd-3.5-r1.ebuild237
-rw-r--r--app-emulation/lxd/lxd-3.6-r1.ebuild238
-rw-r--r--app-emulation/lxd/lxd-3.7.ebuild238
4 files changed, 717 insertions, 0 deletions
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
index 4ed3690c9389..4a47fd35e73f 100644
--- a/app-emulation/lxd/Manifest
+++ b/app-emulation/lxd/Manifest
@@ -5,6 +5,10 @@ AUX lxd.service 174 BLAKE2B 8686d57a79fbc3a9ec2e1a3197012599a5d6b81b62188e779cdb
AUX ptbr-translation-newline.patch 599 BLAKE2B a60e323bfcbdde55bb82f930165a56f0806975370ea090d30a2f40057445b7552b1ff368aac4518e3539f2a4f9b66bd474498f7797002c9bf92d0d837cb72246 SHA512 07c7682ac24b138da10e1a24da02b0cf6144d911200d89ae74d4a03c16fd2a75a22f5956902d071fb93ae1b9b74aacd4ad98e98764678881e19773ab64561581
DIST lxd-3.5.tar.gz 28356957 BLAKE2B 44334026ed720cc9d8a16a0752abb102f07b186e9a5946ffce9872734d166a6d477e0dd324002f74c2cca36bc500f7def9ff7f358c7d07792124392ab815e07c SHA512 56f10a75ee2cfb6ed653e2d69dee979b0a661f267bc66ab642e5fc1835d1879e7df600671325973d9772ddc653334531f2420f129c06cdb5a93950083263f366
DIST lxd-3.6.tar.gz 25777268 BLAKE2B f2c3f20108f5990b1e086d1f5db53cbd476d0613f97f60a29dd66d3779486aef10f9eebf514853960d5606a108aea2e7c89365207130e8345ede70ed5b22806e SHA512 7b1982b81cfee56185bc0929b7bd9f1eb705c1ae83f11fa6f9aa2c9f8fc9aa5c705112121b41e5ed3791aa2ab41be26d7f8fb0a78951bab382b77ae9ae95a793
+DIST lxd-3.7.tar.gz 26321652 BLAKE2B ce7faab689ffe3950aa6f57a0fd2601f231ad26fc7fb09f02300f9c2226deda0876183fe2a4a14cc982c3c2a829acc1785e5e6e030f4dbeaf03a8fbba83e4cfc SHA512 a485c26ea04e6686a9fdac2219535e866f1906ff9a8e25fcd954d061a4cfc1585c4fa81b00247c34f571dbfb7f382be3e7208e3da72a4e281b714715a4f145fb
+EBUILD lxd-3.5-r1.ebuild 6722 BLAKE2B af416a64616255df93a724f2964e34f10f60d28c04094ad18441ddfd0820c1a90bc2234c125730d1e16a8926b4ca870c3fb555ffe251e60d592c91063f062b65 SHA512 52b79973f542c55fc86d28fa28bbf82ef77c6d6162fe96184f215aba72f9e4caa202fb2a7f630e113f60067ab867cfdb0857175a3d91f6b613c2c70099446694
EBUILD lxd-3.5.ebuild 6692 BLAKE2B b7a5c1465e9d8d3f95d942663e552d8e1a998070d487a326b73690fd481764e17a33df64e673e710c53d76060e93fbd2950228436c121d9e07bd4a3206a6e33a SHA512 d41fdaeece4c14d8e40333500b9540debf4f11fc6a2c564350c23d27af404f04d254c5698fce8e2fd9335c53f2d0d69372208c4316f4bbd607914975fcea9cb8
+EBUILD lxd-3.6-r1.ebuild 6774 BLAKE2B 9ff0ba0be0f774c308b73e85423a8bc25889c161db96341d689adfbf5fcb9c7395b0d6fb5898a55e78ccf98363c7fef435955d46f3435fa1f6eb28e91b55998b SHA512 c1b0d28b58c01ddde55fbf7b87c3ff9ac3306429d9b79741c19d11acaf4c4cce8407676b3e66ba8ff1cc1d521a6fdcf26485637a0429c0a7f6326bad91f5c319
EBUILD lxd-3.6.ebuild 6746 BLAKE2B 6c7cd1c212bdc647be0ffd015361a4da86879fc117753271cba159c743c36f37bead7abaa0a3e8c4dc88d97d35acc9885b587a55bab9a3f84a56adbfca3b5027 SHA512 f9db429e7ec132a9921c7b754a130f10648ec3ffdc347993af73e349fb94fe1168721ac6949d4b9123bdaf200f854e7405db027583405f92b89b8647eef0bb20
+EBUILD lxd-3.7.ebuild 6775 BLAKE2B 32c9dd064696dbe9c96417125a5f661a0d639c4cad4e63494d1c01a58519e8b66549a89a7b87eeaf604d8c7b2768709a9ce4521e2170df42b2c9c1549997b609 SHA512 853409de423140fb89ac53336129aa8051d4a3b129441b84b2f66d404f1364c5ea6731ce66149407e48b55e204b854597f4f99c45db156dcd1851f9d9e2c9553
MISC metadata.xml 1033 BLAKE2B d50b256487cc43a6d9e529edaafedb5f7f4eb1bb3ec4a8eb5f8ad892f865652e6dc100fe699a5b07a55cbfb5f32ed8127cbc2e9e68befc2a37f4e1d24afbfc78 SHA512 82684b99e51f524ed8201eb2439c4aaadd1a6403287be2febc908c16290f412930fe415d6a1a7e3712b9fbf64111991b01bc74beab07a745c78e4072698aa81c
diff --git a/app-emulation/lxd/lxd-3.5-r1.ebuild b/app-emulation/lxd/lxd-3.5-r1.ebuild
new file mode 100644
index 000000000000..ee1fd2d1183d
--- /dev/null
+++ b/app-emulation/lxd/lxd-3.5-r1.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Fast, dense and secure container management"
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
+
+LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="+daemon +ipv6 +dnsmasq nls test tools"
+
+inherit autotools bash-completion-r1 linux-info systemd user
+
+SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz"
+
+DEPEND="
+ dev-lang/tcl
+ >=dev-lang/go-1.9.4
+ dev-libs/libuv
+ dev-libs/protobuf
+ nls? ( sys-devel/gettext )
+ test? (
+ app-misc/jq
+ net-misc/curl
+ sys-devel/gettext
+ )
+"
+
+RDEPEND="
+ daemon? (
+ app-arch/xz-utils
+ >=app-emulation/lxc-2.0.7[seccomp]
+ dev-libs/libuv
+ dev-libs/lzo
+ dev-util/xdelta:3
+ dnsmasq? (
+ net-dns/dnsmasq[dhcp,ipv6?]
+ )
+ net-firewall/ebtables
+ net-firewall/iptables[ipv6?]
+ net-libs/libnfnetlink
+ net-misc/rsync[xattr]
+ sys-apps/iproute2[ipv6?]
+ sys-fs/fuse
+ sys-fs/lxcfs
+ sys-fs/squashfs-tools
+ virtual/acl
+ )
+"
+
+CONFIG_CHECK="
+ ~BRIDGE
+ ~DUMMY
+ ~IP6_NF_NAT
+ ~IP6_NF_TARGET_MASQUERADE
+ ~IPV6
+ ~IP_NF_NAT
+ ~IP_NF_TARGET_MASQUERADE
+ ~MACVLAN
+ ~NETFILTER_XT_MATCH_COMMENT
+ ~NET_IPGRE
+ ~NET_IPGRE_DEMUX
+ ~NET_IPIP
+ ~NF_NAT_MASQUERADE_IPV4
+ ~NF_NAT_MASQUERADE_IPV6
+ ~VXLAN
+"
+
+ERROR_BRIDGE="BRIDGE: needed for network commands"
+ERROR_DUMMY="DUMMY: needed for network commands"
+ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands"
+ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands"
+ERROR_IPV6="IPV6: needed for network commands"
+ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands"
+ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands"
+ERROR_MACVLAN="MACVLAN: needed for network commands"
+ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands"
+ERROR_NET_IPGRE="NET_IPGRE: needed for network commands"
+ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands"
+ERROR_NET_IPIP="NET_IPIP: needed for network commands"
+ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands"
+ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands"
+ERROR_VXLAN="VXLAN: needed for network commands"
+
+EGO_PN="github.com/lxc/lxd"
+
+src_prepare() {
+ eapply_user
+ eapply "${FILESDIR}/de-translation-newline-1.patch"
+
+ cd "${S}/dist/dqlite" || die "Can't cd to dqlite dir"
+ eautoreconf
+}
+
+src_configure() {
+ export GOPATH="${S}/dist"
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd"
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=${EPREFIX}/usr/lib/lxd
+}
+
+src_compile() {
+ export GOPATH="${S}/dist"
+
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ emake
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ emake CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite"
+
+ # We don't use the Makefile here because it builds targets with the
+ # assumption that `pwd` is in a deep gopath namespace, which we're not.
+ # It's simpler to manually call "go install" than patching the Makefile.
+ cd "${S}"
+ go install -v -x ${EGO_PN}/lxc || die "Failed to build the client"
+
+ if use daemon; then
+
+ # LXD depends on a patched, bundled sqlite with replication
+ # capabilities.
+ export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/"
+ export CGO_LDFLAGS="-L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd"
+ export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/"
+
+ go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon"
+ fi
+
+ if use tools; then
+ go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift"
+ go install -v -x ${EGO_PN}/lxc-to-lxd || die "Failed to build lxc-to-lxd"
+ go install -v -x ${EGO_PN}/lxd-benchmark || die "Failed to build lxd-benchmark"
+ fi
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ if use daemon; then
+ export GOPATH="${S}/dist"
+ # This is mostly a copy/paste from the Makefile's "check" rule, but
+ # patching the Makefile to work in a non "fully-qualified" go namespace
+ # was more complicated than this modest copy/paste.
+ # Also: sorry, for now a network connection is needed to run tests.
+ # Will properly bundle test dependencies later.
+ go get -v -x github.com/rogpeppe/godeps
+ go get -v -x github.com/remyoudompheng/go-misc/deadcode
+ go get -v -x github.com/golang/lint/golint
+ go test -v ${EGO_PN}/lxd
+ else
+ einfo "No tests to run for client-only builds"
+ fi
+}
+
+src_install() {
+ local bindir="dist/bin"
+ dobin ${bindir}/lxc
+ if use daemon; then
+
+ export GOPATH="${S}/dist"
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ emake DESTDIR="${D}" install
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ emake DESTDIR="${D}" install
+
+ # Must only install libs
+ rm "${D}/usr/bin/sqlite3" || die "Can't remove custom sqlite3 binary"
+ rm -r "${D}/usr/include" || die "Can't remove include directory"
+
+ cd "${S}" || die "Can't cd to \${S}"
+ dosbin ${bindir}/lxd
+ fi
+
+ if use tools; then
+ dobin ${bindir}/fuidshift
+ dobin ${bindir}/lxc-to-lxd
+ dobin ${bindir}/lxd-benchmark
+ fi
+
+ if use nls; then
+ domo po/*.mo
+ fi
+
+ if use daemon; then
+ newinitd "${FILESDIR}"/${PN}.initd lxd
+ newconfd "${FILESDIR}"/${PN}.confd lxd
+
+ systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
+ fi
+
+ newbashcomp scripts/bash/lxd-client lxc
+
+ dodoc AUTHORS doc/*
+}
+
+pkg_postinst() {
+ elog
+ elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
+ elog "including a Quick Start."
+
+ # The messaging below only applies to daemon installs
+ use daemon || return 0
+
+ # The control socket will be owned by (and writeable by) this group.
+ enewgroup lxd
+
+ # Ubuntu also defines an lxd user but it appears unused (the daemon
+ # must run as root)
+
+ elog
+ elog "Though not strictly required, some features are enabled at run-time"
+ elog "when the relevant helper programs are detected:"
+ elog "- sys-apps/apparmor"
+ elog "- sys-fs/btrfs-progs"
+ elog "- sys-fs/lvm2"
+ elog "- sys-fs/zfs"
+ elog "- sys-process/criu"
+ elog
+ elog "Since these features can't be disabled at build-time they are"
+ elog "not USE-conditional."
+ elog
+ elog "Be sure to add your local user to the lxd group."
+ elog
+ elog "Networks with bridge.mode=fan are unsupported due to requiring"
+ elog "a patched kernel and iproute2."
+}
+
+# TODO:
+# - man page, I don't see cobra generating it
+# - maybe implement LXD_CLUSTER_UPDATE per
+# https://discuss.linuxcontainers.org/t/lxd-3-5-has-been-released/2656
+# EM I'm not convinced it's a good design.
diff --git a/app-emulation/lxd/lxd-3.6-r1.ebuild b/app-emulation/lxd/lxd-3.6-r1.ebuild
new file mode 100644
index 000000000000..7f3ceabdddf2
--- /dev/null
+++ b/app-emulation/lxd/lxd-3.6-r1.ebuild
@@ -0,0 +1,238 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Fast, dense and secure container management"
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
+
+LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0"
+SLOT="0"
+KEYWORDS="amd64"
+
+IUSE="+daemon +ipv6 +dnsmasq nls test tools"
+
+inherit autotools bash-completion-r1 linux-info systemd user
+
+SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz"
+
+DEPEND="
+ dev-lang/tcl
+ >=dev-lang/go-1.9.4
+ dev-libs/libuv
+ dev-libs/protobuf
+ nls? ( sys-devel/gettext )
+ test? (
+ app-misc/jq
+ net-misc/curl
+ sys-devel/gettext
+ )
+"
+
+RDEPEND="
+ daemon? (
+ app-arch/xz-utils
+ >=app-emulation/lxc-2.0.7[seccomp]
+ dev-libs/libuv
+ dev-libs/lzo
+ dev-util/xdelta:3
+ dnsmasq? (
+ net-dns/dnsmasq[dhcp,ipv6?]
+ )
+ net-firewall/ebtables
+ net-firewall/iptables[ipv6?]
+ net-libs/libnfnetlink
+ net-misc/rsync[xattr]
+ sys-apps/iproute2[ipv6?]
+ sys-fs/fuse
+ sys-fs/lxcfs
+ sys-fs/squashfs-tools
+ virtual/acl
+ )
+"
+
+CONFIG_CHECK="
+ ~BRIDGE
+ ~DUMMY
+ ~IP6_NF_NAT
+ ~IP6_NF_TARGET_MASQUERADE
+ ~IPV6
+ ~IP_NF_NAT
+ ~IP_NF_TARGET_MASQUERADE
+ ~MACVLAN
+ ~NETFILTER_XT_MATCH_COMMENT
+ ~NET_IPGRE
+ ~NET_IPGRE_DEMUX
+ ~NET_IPIP
+ ~NF_NAT_MASQUERADE_IPV4
+ ~NF_NAT_MASQUERADE_IPV6
+ ~VXLAN
+"
+
+ERROR_BRIDGE="BRIDGE: needed for network commands"
+ERROR_DUMMY="DUMMY: needed for network commands"
+ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands"
+ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands"
+ERROR_IPV6="IPV6: needed for network commands"
+ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands"
+ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands"
+ERROR_MACVLAN="MACVLAN: needed for network commands"
+ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands"
+ERROR_NET_IPGRE="NET_IPGRE: needed for network commands"
+ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands"
+ERROR_NET_IPIP="NET_IPIP: needed for network commands"
+ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands"
+ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands"
+ERROR_VXLAN="VXLAN: needed for network commands"
+
+EGO_PN="github.com/lxc/lxd"
+
+src_prepare() {
+ eapply_user
+ eapply "${FILESDIR}/de-translation-newline-1.patch"
+ eapply "${FILESDIR}/ptbr-translation-newline.patch"
+
+ cd "${S}/dist/dqlite" || die "Can't cd to dqlite dir"
+ eautoreconf
+}
+
+src_configure() {
+ export GOPATH="${S}/dist"
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd"
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=${EPREFIX}/usr/lib/lxd
+}
+
+src_compile() {
+ export GOPATH="${S}/dist"
+
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ emake
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ emake CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite"
+
+ # We don't use the Makefile here because it builds targets with the
+ # assumption that `pwd` is in a deep gopath namespace, which we're not.
+ # It's simpler to manually call "go install" than patching the Makefile.
+ cd "${S}"
+ go install -v -x ${EGO_PN}/lxc || die "Failed to build the client"
+
+ if use daemon; then
+
+ # LXD depends on a patched, bundled sqlite with replication
+ # capabilities.
+ export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/"
+ export CGO_LDFLAGS="-L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd"
+ export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/"
+
+ go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon"
+ fi
+
+ if use tools; then
+ go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift"
+ go install -v -x ${EGO_PN}/lxc-to-lxd || die "Failed to build lxc-to-lxd"
+ go install -v -x ${EGO_PN}/lxd-benchmark || die "Failed to build lxd-benchmark"
+ fi
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ if use daemon; then
+ export GOPATH="${S}/dist"
+ # This is mostly a copy/paste from the Makefile's "check" rule, but
+ # patching the Makefile to work in a non "fully-qualified" go namespace
+ # was more complicated than this modest copy/paste.
+ # Also: sorry, for now a network connection is needed to run tests.
+ # Will properly bundle test dependencies later.
+ go get -v -x github.com/rogpeppe/godeps
+ go get -v -x github.com/remyoudompheng/go-misc/deadcode
+ go get -v -x github.com/golang/lint/golint
+ go test -v ${EGO_PN}/lxd
+ else
+ einfo "No tests to run for client-only builds"
+ fi
+}
+
+src_install() {
+ local bindir="dist/bin"
+ dobin ${bindir}/lxc
+ if use daemon; then
+
+ export GOPATH="${S}/dist"
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ emake DESTDIR="${D}" install
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ emake DESTDIR="${D}" install
+
+ # Must only install libs
+ rm "${D}/usr/bin/sqlite3" || die "Can't remove custom sqlite3 binary"
+ rm -r "${D}/usr/include" || die "Can't remove include directory"
+
+ cd "${S}" || die "Can't cd to \${S}"
+ dosbin ${bindir}/lxd
+ fi
+
+ if use tools; then
+ dobin ${bindir}/fuidshift
+ dobin ${bindir}/lxc-to-lxd
+ dobin ${bindir}/lxd-benchmark
+ fi
+
+ if use nls; then
+ domo po/*.mo
+ fi
+
+ if use daemon; then
+ newinitd "${FILESDIR}"/${PN}.initd lxd
+ newconfd "${FILESDIR}"/${PN}.confd lxd
+
+ systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
+ fi
+
+ newbashcomp scripts/bash/lxd-client lxc
+
+ dodoc AUTHORS doc/*
+}
+
+pkg_postinst() {
+ elog
+ elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
+ elog "including a Quick Start."
+
+ # The messaging below only applies to daemon installs
+ use daemon || return 0
+
+ # The control socket will be owned by (and writeable by) this group.
+ enewgroup lxd
+
+ # Ubuntu also defines an lxd user but it appears unused (the daemon
+ # must run as root)
+
+ elog
+ elog "Though not strictly required, some features are enabled at run-time"
+ elog "when the relevant helper programs are detected:"
+ elog "- sys-apps/apparmor"
+ elog "- sys-fs/btrfs-progs"
+ elog "- sys-fs/lvm2"
+ elog "- sys-fs/zfs"
+ elog "- sys-process/criu"
+ elog
+ elog "Since these features can't be disabled at build-time they are"
+ elog "not USE-conditional."
+ elog
+ elog "Be sure to add your local user to the lxd group."
+ elog
+ elog "Networks with bridge.mode=fan are unsupported due to requiring"
+ elog "a patched kernel and iproute2."
+}
+
+# TODO:
+# - man page, I don't see cobra generating it
+# - maybe implement LXD_CLUSTER_UPDATE per
+# https://discuss.linuxcontainers.org/t/lxd-3-5-has-been-released/2656
+# EM I'm not convinced it's a good design.
diff --git a/app-emulation/lxd/lxd-3.7.ebuild b/app-emulation/lxd/lxd-3.7.ebuild
new file mode 100644
index 000000000000..250ea1346d70
--- /dev/null
+++ b/app-emulation/lxd/lxd-3.7.ebuild
@@ -0,0 +1,238 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Fast, dense and secure container management"
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
+
+LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="+daemon +ipv6 +dnsmasq nls test tools"
+
+inherit autotools bash-completion-r1 linux-info systemd user
+
+SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz"
+
+DEPEND="
+ dev-lang/tcl
+ >=dev-lang/go-1.9.4
+ dev-libs/libuv
+ dev-libs/protobuf
+ nls? ( sys-devel/gettext )
+ test? (
+ app-misc/jq
+ net-misc/curl
+ sys-devel/gettext
+ )
+"
+
+RDEPEND="
+ daemon? (
+ app-arch/xz-utils
+ >=app-emulation/lxc-2.0.7[seccomp]
+ dev-libs/libuv
+ dev-libs/lzo
+ dev-util/xdelta:3
+ dnsmasq? (
+ net-dns/dnsmasq[dhcp,ipv6?]
+ )
+ net-firewall/ebtables
+ net-firewall/iptables[ipv6?]
+ net-libs/libnfnetlink
+ net-misc/rsync[xattr]
+ sys-apps/iproute2[ipv6?]
+ sys-fs/fuse
+ sys-fs/lxcfs
+ sys-fs/squashfs-tools
+ virtual/acl
+ )
+"
+
+CONFIG_CHECK="
+ ~BRIDGE
+ ~DUMMY
+ ~IP6_NF_NAT
+ ~IP6_NF_TARGET_MASQUERADE
+ ~IPV6
+ ~IP_NF_NAT
+ ~IP_NF_TARGET_MASQUERADE
+ ~MACVLAN
+ ~NETFILTER_XT_MATCH_COMMENT
+ ~NET_IPGRE
+ ~NET_IPGRE_DEMUX
+ ~NET_IPIP
+ ~NF_NAT_MASQUERADE_IPV4
+ ~NF_NAT_MASQUERADE_IPV6
+ ~VXLAN
+"
+
+ERROR_BRIDGE="BRIDGE: needed for network commands"
+ERROR_DUMMY="DUMMY: needed for network commands"
+ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands"
+ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands"
+ERROR_IPV6="IPV6: needed for network commands"
+ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands"
+ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands"
+ERROR_MACVLAN="MACVLAN: needed for network commands"
+ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands"
+ERROR_NET_IPGRE="NET_IPGRE: needed for network commands"
+ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands"
+ERROR_NET_IPIP="NET_IPIP: needed for network commands"
+ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands"
+ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands"
+ERROR_VXLAN="VXLAN: needed for network commands"
+
+EGO_PN="github.com/lxc/lxd"
+
+src_prepare() {
+ eapply_user
+ eapply "${FILESDIR}/de-translation-newline-1.patch"
+ eapply "${FILESDIR}/ptbr-translation-newline.patch"
+
+ cd "${S}/dist/dqlite" || die "Can't cd to dqlite dir"
+ eautoreconf
+}
+
+src_configure() {
+ export GOPATH="${S}/dist"
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd"
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=${EPREFIX}/usr/lib/lxd
+}
+
+src_compile() {
+ export GOPATH="${S}/dist"
+
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ emake
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ emake CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite"
+
+ # We don't use the Makefile here because it builds targets with the
+ # assumption that `pwd` is in a deep gopath namespace, which we're not.
+ # It's simpler to manually call "go install" than patching the Makefile.
+ cd "${S}"
+ go install -v -x ${EGO_PN}/lxc || die "Failed to build the client"
+
+ if use daemon; then
+
+ # LXD depends on a patched, bundled sqlite with replication
+ # capabilities.
+ export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/"
+ export CGO_LDFLAGS="-L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd"
+ export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/"
+
+ go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon"
+ fi
+
+ if use tools; then
+ go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift"
+ go install -v -x ${EGO_PN}/lxc-to-lxd || die "Failed to build lxc-to-lxd"
+ go install -v -x ${EGO_PN}/lxd-benchmark || die "Failed to build lxd-benchmark"
+ fi
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ if use daemon; then
+ export GOPATH="${S}/dist"
+ # This is mostly a copy/paste from the Makefile's "check" rule, but
+ # patching the Makefile to work in a non "fully-qualified" go namespace
+ # was more complicated than this modest copy/paste.
+ # Also: sorry, for now a network connection is needed to run tests.
+ # Will properly bundle test dependencies later.
+ go get -v -x github.com/rogpeppe/godeps
+ go get -v -x github.com/remyoudompheng/go-misc/deadcode
+ go get -v -x github.com/golang/lint/golint
+ go test -v ${EGO_PN}/lxd
+ else
+ einfo "No tests to run for client-only builds"
+ fi
+}
+
+src_install() {
+ local bindir="dist/bin"
+ dobin ${bindir}/lxc
+ if use daemon; then
+
+ export GOPATH="${S}/dist"
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
+ emake DESTDIR="${D}" install
+
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
+ emake DESTDIR="${D}" install
+
+ # Must only install libs
+ rm "${D}/usr/bin/sqlite3" || die "Can't remove custom sqlite3 binary"
+ rm -r "${D}/usr/include" || die "Can't remove include directory"
+
+ cd "${S}" || die "Can't cd to \${S}"
+ dosbin ${bindir}/lxd
+ fi
+
+ if use tools; then
+ dobin ${bindir}/fuidshift
+ dobin ${bindir}/lxc-to-lxd
+ dobin ${bindir}/lxd-benchmark
+ fi
+
+ if use nls; then
+ domo po/*.mo
+ fi
+
+ if use daemon; then
+ newinitd "${FILESDIR}"/${PN}.initd lxd
+ newconfd "${FILESDIR}"/${PN}.confd lxd
+
+ systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
+ fi
+
+ newbashcomp scripts/bash/lxd-client lxc
+
+ dodoc AUTHORS doc/*
+}
+
+pkg_postinst() {
+ elog
+ elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
+ elog "including a Quick Start."
+
+ # The messaging below only applies to daemon installs
+ use daemon || return 0
+
+ # The control socket will be owned by (and writeable by) this group.
+ enewgroup lxd
+
+ # Ubuntu also defines an lxd user but it appears unused (the daemon
+ # must run as root)
+
+ elog
+ elog "Though not strictly required, some features are enabled at run-time"
+ elog "when the relevant helper programs are detected:"
+ elog "- sys-apps/apparmor"
+ elog "- sys-fs/btrfs-progs"
+ elog "- sys-fs/lvm2"
+ elog "- sys-fs/zfs"
+ elog "- sys-process/criu"
+ elog
+ elog "Since these features can't be disabled at build-time they are"
+ elog "not USE-conditional."
+ elog
+ elog "Be sure to add your local user to the lxd group."
+ elog
+ elog "Networks with bridge.mode=fan are unsupported due to requiring"
+ elog "a patched kernel and iproute2."
+}
+
+# TODO:
+# - man page, I don't see cobra generating it
+# - maybe implement LXD_CLUSTER_UPDATE per
+# https://discuss.linuxcontainers.org/t/lxd-3-5-has-been-released/2656
+# EM I'm not convinced it's a good design.