diff options
-rw-r--r-- | app-emulation/lxd/Manifest | 2 | ||||
-rw-r--r-- | app-emulation/lxd/files/de-translation-newline.patch | 20 | ||||
-rw-r--r-- | app-emulation/lxd/files/ja-translation-newline.patch | 11 | ||||
-rw-r--r-- | app-emulation/lxd/files/lxd.initd.1 | 47 | ||||
-rw-r--r-- | app-emulation/lxd/lxd-3.3.ebuild | 183 | ||||
-rw-r--r-- | app-emulation/lxd/lxd-3.4-r1.ebuild | 233 | ||||
-rw-r--r-- | app-emulation/lxd/lxd-3.4.ebuild | 232 |
7 files changed, 0 insertions, 728 deletions
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest index e2d85aa69e43..57a31c22485b 100644 --- a/app-emulation/lxd/Manifest +++ b/app-emulation/lxd/Manifest @@ -1,3 +1 @@ -DIST lxd-3.3.tar.gz 28414680 BLAKE2B 7f3eecf400761548935e6e3c81d894379cd667ffbe6d8ef67a7dd3ad4f1c13846f524fcefc4cdc306674fb990706bda0b2c4ef390f320c41561fa86cf610586c SHA512 ed5d792c1080f2be7f48f34051fbfa28d138b4ccb5405edb13cd630776ec34312da491a1881f77dddbe1a121e589b44952e73ce1e61f2cba72243f3b8f4c0177 -DIST lxd-3.4.tar.gz 24313641 BLAKE2B 6f2db8a690474d020a0d43366e940760c0886c8af60e17ecc6bf1f9747d8454d09d619b723b1794bec503dda82028f7d81edc2d0c33216cbad9c810f2657198d SHA512 f041878fcfd2b45f594d97e748272d44c517f28e181861a604bef23f858c4bd59cc93ac56c24cce6d353743428b66940f11df268ff9f66e83a5c8f1fb95dc3aa DIST lxd-3.5.tar.gz 28356957 BLAKE2B 44334026ed720cc9d8a16a0752abb102f07b186e9a5946ffce9872734d166a6d477e0dd324002f74c2cca36bc500f7def9ff7f358c7d07792124392ab815e07c SHA512 56f10a75ee2cfb6ed653e2d69dee979b0a661f267bc66ab642e5fc1835d1879e7df600671325973d9772ddc653334531f2420f129c06cdb5a93950083263f366 diff --git a/app-emulation/lxd/files/de-translation-newline.patch b/app-emulation/lxd/files/de-translation-newline.patch deleted file mode 100644 index 9ef55ab2f0ee..000000000000 --- a/app-emulation/lxd/files/de-translation-newline.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- /po/de.po 2018-06-27 19:57:56.759130047 -0500 -+++ /po/de.po 2018-06-27 20:01:09.694634346 -0500 -@@ -65,7 +65,7 @@ - "### type: custom\n" - "### used_by: []\n" - "### config:\n" --"### size: \"61203283968\"" -+"### size: \"61203283968\"\n" - msgstr "" - "### Dies ist eine Darstellung der Eigenschaften eines Abbildes in yaml.\n" - "### Jede Zeile die mit '# beginnt wird ignoriert.\n" -@@ -167,7 +167,7 @@ - "###\n" - "### Each property is represented by a single line:\n" - "### An example would be:\n" --"### description: My custom image" -+"### description: My custom image\n" - msgstr "" - "### Dies ist eine Darstellung der Eigenschaften eines Images in yaml.\n" - "### Jede Zeile die mit '# beginnt wird ignoriert.\n" diff --git a/app-emulation/lxd/files/ja-translation-newline.patch b/app-emulation/lxd/files/ja-translation-newline.patch deleted file mode 100644 index bbda24c6f37e..000000000000 --- a/app-emulation/lxd/files/ja-translation-newline.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- /po/ja.po 2018-05-20 19:42:38.932990198 -0500 -+++ /po/ja.po 2018-05-20 19:42:55.839944861 -0500 -@@ -1380,7 +1380,7 @@ - "イメージのエイリアスを一覧表示します\n" - "\n" - "指定するフィルタはイメージのハッシュ値の一部でもイメージのエイリアスの一部で" --"も構いません。" -+"も構いません。\n" - - #: lxc/image.go:888 - msgid "List images" diff --git a/app-emulation/lxd/files/lxd.initd.1 b/app-emulation/lxd/files/lxd.initd.1 deleted file mode 100644 index b6d3cd4eb264..000000000000 --- a/app-emulation/lxd/files/lxd.initd.1 +++ /dev/null @@ -1,47 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -DAEMON=/usr/sbin/lxd -PIDFILE=/run/lxd.pid - -extra_commands="stopall" - -depend() { - need net - use lxcfs -} - -start() { - ebegin "Starting lxd service" - - start-stop-daemon --start \ - --pidfile ${PIDFILE} \ - --exec ${DAEMON} \ - --background \ - --make-pidfile \ - --env LD_LIBRARY_PATH="/usr/lib/lxd" \ - -- \ - ${LXD_OPTIONS} - - eend $? -} - -stop() { - if [ "$RC_GOINGDOWN" = "YES" ] || [ "$RC_REBOOT" = "YES" ]; then - stopall - else - ebegin "Stopping lxd service (but not containers)" - start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} - eend $? - fi -} - -stopall() { - ebegin "Stopping lxd service and containers" - if "${DAEMON}" shutdown; then - /etc/init.d/lxd zap - rm -f ${PIDFILE} - fi - eend $? -} diff --git a/app-emulation/lxd/lxd-3.3.ebuild b/app-emulation/lxd/lxd-3.3.ebuild deleted file mode 100644 index 393042c8ae5e..000000000000 --- a/app-emulation/lxd/lxd-3.3.ebuild +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# 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" - -inherit bash-completion-r1 linux-info systemd user - -SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz" - -DEPEND=" - >=dev-lang/go-1.9.4 - 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] - dnsmasq? ( - net-dns/dnsmasq[dhcp,ipv6?] - ) - net-misc/rsync[xattr] - sys-apps/iproute2[ipv6?] - 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" - -PATCHES=( - "${FILESDIR}/ja-translation-newline.patch" # https://github.com/lxc/lxd/pull/4572 - "${FILESDIR}/de-translation-newline.patch" -) - -# LXD tarball is packaged with a nice "dist" folder containing all dependencies -# that were vendored by upstream at release time. That saves us the trouble of -# vendoring the dependencies ourselves. This is why there was this drastic drop -# in ebuild complexity compared to pre 3.0.0-r2 ebuilds. -src_compile() { - export GOPATH="${S}/dist" - - # 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. - # - # ABOUT "-tags libsqlite3": we used to link to the system's sqlite3 library - # but since v3.0.0, LXD depends on github.com/CanonicalLtd/dqlite which - # at the time of this writing, depends on patched version of sqlite with - # replication capabilities added. We don't have that patch in dev-db/sqlite. - # Therefore, we let LXD use its own private copy of sqlite. - go install -v -x ${EGO_PN}/lxc || die "Failed to build the client" - - if use daemon; then - go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift" - go install -v -x ${EGO_PN}/lxd || die "Failed to build the daemon" - 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 - dosbin ${bindir}/lxd - dobin ${bindir}/fuidshift - 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 README.md doc/* -} - -pkg_postinst() { - einfo - einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information," - einfo "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) - - einfo - einfo "Though not strictly required, some features are enabled at run-time" - einfo "when the relevant helper programs are detected:" - einfo "- sys-apps/apparmor" - einfo "- sys-fs/btrfs-progs" - einfo "- sys-fs/lvm2" - einfo "- sys-fs/lxcfs" - einfo "- sys-fs/zfs" - einfo "- sys-process/criu" - einfo - einfo "Since these features can't be disabled at build-time they are" - einfo "not USE-conditional." - einfo - einfo "Be sure to add your local user to the lxd group." - einfo - einfo "Networks with bridge.mode=fan are unsupported due to requiring" - einfo "a patched kernel and iproute2." -} diff --git a/app-emulation/lxd/lxd-3.4-r1.ebuild b/app-emulation/lxd/lxd-3.4-r1.ebuild deleted file mode 100644 index 0988eae3ecc5..000000000000 --- a/app-emulation/lxd/lxd-3.4-r1.ebuild +++ /dev/null @@ -1,233 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# 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/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.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" - - # 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 diff --git a/app-emulation/lxd/lxd-3.4.ebuild b/app-emulation/lxd/lxd-3.4.ebuild deleted file mode 100644 index c5ce43a9eb1c..000000000000 --- a/app-emulation/lxd/lxd-3.4.ebuild +++ /dev/null @@ -1,232 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# 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/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/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.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=/usr/lib/lxd - - cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" - PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=/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" - - # 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/" - 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.1 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 |