From 1fe49f5b3e13481832866b6b1600741bf3a1f024 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 10 Jan 2023 18:21:11 +0000 Subject: gentoo auto-resync : 10:01:2023 - 18:21:10 --- app-containers/lxd/Manifest | 3 +- ...0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch | 27 +++ app-containers/lxd/lxd-5.0.1-r4.ebuild | 215 -------------------- app-containers/lxd/lxd-5.0.1-r5.ebuild | 216 +++++++++++++++++++++ 4 files changed, 245 insertions(+), 216 deletions(-) create mode 100644 app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch delete mode 100644 app-containers/lxd/lxd-5.0.1-r4.ebuild create mode 100644 app-containers/lxd/lxd-5.0.1-r5.ebuild (limited to 'app-containers/lxd') diff --git a/app-containers/lxd/Manifest b/app-containers/lxd/Manifest index 2785b4fce9b4..abe06f944d73 100644 --- a/app-containers/lxd/Manifest +++ b/app-containers/lxd/Manifest @@ -2,6 +2,7 @@ AUX lxd-4.0.0.confd 582 BLAKE2B 88ce8ec99eb50174bffea7d3b8bddc67b50fe6677d54df11 AUX lxd-4.0.0.socket 197 BLAKE2B 8c0d2dee71c14ee5f34b2bd0804adfa06ab3ae2a73bcf8d122184434c42b7f91f66fe610bddda93c458e0f171b505fe79a4f268d8243aabdf226f47e95027e71 SHA512 d70dc867b2e92b69928c83fc5feca4e387808adbc267b9fe4ecf0c8befdf3ca13366b229c6eefcb5667e51405fb0aa4e6bb8f59a0b5b5fb3895c46b4aaab0661 AUX lxd-4.0.9-r1.service 612 BLAKE2B e44029b6f615afc0daf8abfccd7d2e472291d9b1f8530b64f5c9b7d96aeda605a0dd0ec9b74f0a79f68992a45607e4362a7c30c711b34ac106b9377610f97ad6 SHA512 68800d9952e865eeffe1c05ecf111c49e6b137c6f7af7c7b02daf180c3a794a670ddbe7140e97d187f1b9a803ca84e132303808ed8b6ae49760246c01d7c60d4 AUX lxd-4.0.9.initd 1333 BLAKE2B 72a27d38527b4f0dcca3b111ae0d112bd128cf83ff6261561c5a3bf1c619a2e36672b5eb06ff643660d3cee05a545991ed565be257a56452cbd498a202e1b197 SHA512 933a09e72dbf3bbab8e2148549b6bc08ac0caf2088bd44c3e378ac6041fa861845bfae351c83fcd0920655ceb29ea6ca8023163c52a2fb7499c9bf2958d4dc86 +AUX lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch 1169 BLAKE2B a590a4f958270509fa2787837992f5a0c16e689713fea13f15c120902a822b6e662b1658cabc4ba4b4c0d1d9fe5feab73a077f2ac751383e9408c436bbc599b1 SHA512 0fb90748070d8376e62af3dec5ae793b0b6e8c678c226eafce014e978a4e16c4fbcb30a1a98ce8ca1b67436ca603f0531522da1905fbbb79824222a3241806a5 AUX lxd-5.0.2-r1.initd 1710 BLAKE2B a9597d32e88502f521f3ae784e4f653ab6d3ab144537b27f5e9b84eb36e5688b13d74968c865153d6e442f77a67b5794fb429705bea8b40cdef00768102de55b SHA512 73ea4aaee39061565524a378b9317bee4b850f0c28ae3f8a47e905b9dffc4452e71736880391bb74b88ea70bda12874699a1eff56400ac9d7949738f3aa3ebce AUX lxd-containers-4.0.0.service 322 BLAKE2B a38cffd4b5809946abdac858564dcab2c2967c295d671df0d315d790df1849e25f0bc052e20cd0d9e4c23403289050b4538f5a52437ab8ae9ca3b40c6a9a1571 SHA512 a55f2c1a367c5c3c5eb6880e01893977de18c6e9463949236ee3247715fbf53641bbe1b69404362dd6cb6ba2a30ac6539fd362b21059e529dc4dac4ec5ca6718 DIST lxd-5.0.1.tar.gz 14640923 BLAKE2B 81bdf3301c0eecc719864cd8e18fd886113f83d1980e13ee4d4ccb6641ee4a7e33f0b859a21abd8a0a9956d1c2f3dfa6e7eb1ae454fbb580c23b5558ef51168e SHA512 b04b7329bdeb17ca384cc2d931a1510d5f03521fd247eab93904bbcb6139cc0daf28f9aeb6416268ccf15affdd15b26598f3e280fb5eefe5c59be6918f092bed @@ -9,5 +10,5 @@ DIST lxd-5.0.1.tar.gz.asc 833 BLAKE2B d233c8ebfb5b71f66ff08b4d74861a42bf45ef3e96 DIST lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch 882 BLAKE2B 4c4cb8b19709939c0c14ed87e5d9c917ac967471400de07c14ea049c0a8aae9a2ed0e3755d554cb1077ee7c607fcdc71431d57a55becd0a46c1f177bc9b33aed SHA512 266788186ca9aabda4ad0fe5fa47ef3acfa31bee64c742c011c58a39f4da833f768e8bb71ec81b57af8d4f124d733f2c22ab33f9ee1bc4ecbd21f5bbbae1f6e7 DIST lxd-5.8-add-tcp-keepalives-to-exec-channels.patch 15702 BLAKE2B ee834b86284e36f87ad3e54df04eb2968dc0fefdf81b116bd640e611ac4ca2eb93763ed2c2f3cfd1e9473da1a3e66bd90858eb4bab08a47f86306a0903a19e6e SHA512 5e7c56f5ffbc8cecb27c6916abbbf4bb3d268c0936b9fdb2b80b4b306c911bdcf782059290243988feb49c9209e55de9ea168ea7041636bf9ae1b7d88ff541c9 EBUILD lxd-5.0.1-r2.ebuild 5268 BLAKE2B b0d0d8601fe9dfda083f98078aa404e04cc4c82098583bc3b8bcee76b4f46f1eadd097a05ffb62111ab929a42f3af2377de9302f3acaeeca5056d85ef460715f SHA512 540ef775bc0558a59dad52220d1f8d9de6f0dd4aa57eff7e18beefefc2263651d9edf5fb0e993d724b4e03145f0250efa074cfb11d0e5e9997dcd5b968a2997c -EBUILD lxd-5.0.1-r4.ebuild 6167 BLAKE2B 4c333bb05d113db43b7c9b9917ff96737599fe9a36492e777339a47eeee86efa07baf9736dbbd4f9f19179939da6b3fb196cf29b607bc72a6535fe673d6f2a0f SHA512 04c20b5b7c0095f60f0cc1b49e98336426de6fad703432167882020829660ab696c6c9a004c5b881036927f3ce6cb116e517afcf026df647ef388b47e33d743f +EBUILD lxd-5.0.1-r5.ebuild 6235 BLAKE2B 95efb03e4ad618bd92d6a22311a135a9a096bb0742a15a3191254620f05604ae5e10fddc97883e06d6dabfa4972fa62899751e23a98f53d3235733f37ddd2ec2 SHA512 6d39152adabe406e568d39e6a3d696e4d3f554d66b063a4827f596ebc6e034f346a086faaedbc6de7a3e7a94c01b9d412533e81e1d5f1671e2fb75074ba52d61 MISC metadata.xml 1403 BLAKE2B 4bff140bc9282b41631293b9cc28a5f85bec2b0f923c762c6572e75b752aba113632747142bd3b3a87322ce8d2ba10fd15afe3f1a7c1384e49c408ca176f267d SHA512 38fb2faa661a8473d0221117299baea01c06f46e5fbf5bd7e32f26b7d0a433ab35c5e0e5dde42c7478b7118489d619fdacca29b3a9b0e89cf432c5bccd3ffba3 diff --git a/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch b/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch new file mode 100644 index 000000000000..c6cf6c97b013 --- /dev/null +++ b/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch @@ -0,0 +1,27 @@ +From 37779fd75dbcd02fab03a8327a1ec7a6f3273371 Mon Sep 17 00:00:00 2001 +From: Thomas Parrott +Date: Wed, 4 Jan 2023 09:59:37 +0000 +Subject: [PATCH] lxd/storage/drivers/driver/btrfs/utils: Fix getQGroup to + suport BTRFS >= 6.0.1 + +Fixes #11210 + +Signed-off-by: Thomas Parrott +--- + lxd/storage/drivers/driver_btrfs_utils.go | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lxd/storage/drivers/driver_btrfs_utils.go b/lxd/storage/drivers/driver_btrfs_utils.go +index 8f0846d2fc9f..e1468e4b1a59 100644 +--- a/lxd/storage/drivers/driver_btrfs_utils.go ++++ b/lxd/storage/drivers/driver_btrfs_utils.go +@@ -247,7 +247,8 @@ func (d *btrfs) getQGroup(path string) (string, int64, error) { + var qgroup string + usage := int64(-1) + for _, line := range strings.Split(output, "\n") { +- if line == "" || strings.HasPrefix(line, "qgroupid") || strings.HasPrefix(line, "---") { ++ // Use case-insensitive field title match because BTRFS tooling changed casing between versions. ++ if line == "" || strings.HasPrefix(strings.ToLower(line), "qgroupid") || strings.HasPrefix(line, "-") { + continue + } + diff --git a/app-containers/lxd/lxd-5.0.1-r4.ebuild b/app-containers/lxd/lxd-5.0.1-r4.ebuild deleted file mode 100644 index 9f824c73165d..000000000000 --- a/app-containers/lxd/lxd-5.0.1-r4.ebuild +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig - -DESCRIPTION="Modern, secure and powerful system container and virtual machine manager" -HOMEPAGE="https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd" -SRC_URI="https://linuxcontainers.org/downloads/lxd/${P}.tar.gz - https://github.com/lxc/lxd/commit/d55a590ea50a75c3cb2ea67894be8253074d6093.patch -> lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch - https://patch-diff.githubusercontent.com/raw/lxc/lxd/pull/11011.patch -> lxd-5.8-add-tcp-keepalives-to-exec-channels.patch - verify-sig? ( https://linuxcontainers.org/downloads/lxd/${P}.tar.gz.asc )" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" -IUSE="apparmor nls" - -DEPEND="acct-group/lxd - app-arch/xz-utils - >=app-containers/lxc-3.0.0[apparmor?,seccomp(+)] - dev-db/sqlite:3 - dev-libs/dqlite:= - dev-libs/lzo - dev-libs/raft[lz4] - >=dev-util/xdelta-3.0[lzma(+)] - net-dns/dnsmasq[dhcp,ipv6(+)] - sys-libs/libcap - virtual/udev" -RDEPEND="${DEPEND} - net-firewall/ebtables - net-firewall/iptables[ipv6(+)] - sys-apps/iproute2[ipv6(+)] - sys-fs/fuse:* - >=sys-fs/lxcfs-5.0.0 - sys-fs/squashfs-tools[lzma] - virtual/acl" -BDEPEND="dev-lang/go - nls? ( sys-devel/gettext ) - verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )" - -CONFIG_CHECK=" - ~CGROUPS - ~IPC_NS - ~NET_NS - ~PID_NS - - ~SECCOMP - ~USER_NS - ~UTS_NS - - ~KVM - ~MACVTAP - ~VHOST_VSOCK -" - -ERROR_IPC_NS="CONFIG_IPC_NS is required." -ERROR_NET_NS="CONFIG_NET_NS is required." -ERROR_PID_NS="CONFIG_PID_NS is required." -ERROR_SECCOMP="CONFIG_SECCOMP is required." -ERROR_UTS_NS="CONFIG_UTS_NS is required." - -WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines." -WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines." -WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines." - -# Go magic. -QA_PREBUILT="/usr/bin/fuidshift - /usr/bin/lxc - /usr/bin/lxc-to-lxd - /usr/bin/lxd-agent - /usr/bin/lxd-benchmark - /usr/bin/lxd-migrate - /usr/sbin/lxd" - -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc - -# The testsuite must be run as root. -# make: *** [Makefile:156: check] Error 1 -RESTRICT="test" - -GOPATH="${S}/_dist" - -PATCHES=( "${DISTDIR}"/lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch - "${DISTDIR}"/lxd-5.8-add-tcp-keepalives-to-exec-channels.patch ) - -src_unpack() { - if use verify-sig; then - verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - export GOPATH="${S}/_dist" - - default - - sed -i \ - -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd:g" \ - -e "s:make:make ${MAKEOPTS}:g" \ - Makefile || die - - # Fix hardcoded ovmf file path, see bug 763180 - sed -i \ - -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \ - -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \ - doc/environment.md \ - lxd/apparmor/instance.go \ - lxd/apparmor/instance_qemu.go \ - lxd/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths." - - # Fix hardcoded virtfs-proxy-helper file path, see bug 798924 - sed -i \ - -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \ - lxd/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path." - - cp "${FILESDIR}"/lxd-4.0.9-r1.service "${T}"/lxd.service || die - if use apparmor; then - sed -i \ - '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \ - "${T}"/lxd.service || die - fi - - # Disable -Werror's from go modules. - find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die -} - -src_configure() { :; } - -src_compile() { - export GOPATH="${S}/_dist" - export CGO_LDFLAGS_ALLOW="-Wl,-z,now" - - for k in fuidshift lxd-benchmark lxc lxc-to-lxd; do - go install -v -x "${S}/${k}" || die "failed compiling ${k}" - done - - go install -v -x -tags libsqlite3 "${S}"/lxd || die "Failed to build the daemon" - - # Needs to be built statically - CGO_ENABLED=0 go install -v -tags netgo "${S}"/lxd-migrate - CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/lxd-agent - - use nls && emake build-mo -} - -src_test() { - emake check -} - -src_install() { - export GOPATH="${S}/_dist" - local bindir="_dist/bin" - - dosbin ${bindir}/lxd - - for l in fuidshift lxd-agent lxd-benchmark lxd-migrate lxc lxc-to-lxd; do - dobin ${bindir}/${l} - done - - newbashcomp scripts/bash/lxd-client lxc - - newconfd "${FILESDIR}"/lxd-4.0.0.confd lxd - newinitd "${FILESDIR}"/lxd-5.0.2-r1.initd lxd - - systemd_dounit "${T}"/lxd.service - systemd_newunit "${FILESDIR}"/lxd-containers-4.0.0.service lxd-containers.service - systemd_newunit "${FILESDIR}"/lxd-4.0.0.socket lxd.socket - - dodoc AUTHORS - dodoc -r doc/* - use nls && domo po/*.mo -} - -pkg_postinst() { - elog - elog "Consult https://wiki.gentoo.org/wiki/LXD for more information," - elog "including a Quick Start." - elog "For virtual machine support, see:" - elog "https://wiki.gentoo.org/wiki/LXD#Virtual_machines" - elog - elog "Please run 'lxc-checkconfig' to see all optional kernel features." - elog - optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs] - optfeature "btrfs storage backend" sys-fs/btrfs-progs - optfeature "lvm2 storage backend" sys-fs/lvm2 - optfeature "zfs storage backend" sys-fs/zfs - elog - elog "Be sure to add your local user to the lxd group." - - if [[ ${REPLACING_VERSIONS} ]] && - ver_test ${REPLACING_VERSIONS} -lt 5.0.1 && - has_version app-emulation/qemu[spice,usbredir,virtfs]; then - ewarn "" - ewarn "You're updating from <5.0.1. Due to incompatible API updates in the lxd-agent" - ewarn "product, you'll have to restart any running virtual machines before they work" - ewarn "properly." - ewarn "" - ewarn "Run: 'lxc restart your-vm' after the update for your vm's managed by lxd." - ewarn "" - fi - - if [[ ${REPLACING_VERSIONS} ]] && - has_version "sys-apps/openrc"; then - elog "" - elog "The new init.d script will attempt to mount " - elog " /sys/fs/cgroup/systemd" - elog "by default, which is needed to run systemd containers with openrc host." - elog "See the /etc/init.d/lxd file for requirements." - elog "" - fi -} diff --git a/app-containers/lxd/lxd-5.0.1-r5.ebuild b/app-containers/lxd/lxd-5.0.1-r5.ebuild new file mode 100644 index 000000000000..86323cc0f95d --- /dev/null +++ b/app-containers/lxd/lxd-5.0.1-r5.ebuild @@ -0,0 +1,216 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig + +DESCRIPTION="Modern, secure and powerful system container and virtual machine manager" +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd" +SRC_URI="https://linuxcontainers.org/downloads/lxd/${P}.tar.gz + https://github.com/lxc/lxd/commit/d55a590ea50a75c3cb2ea67894be8253074d6093.patch -> lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch + https://patch-diff.githubusercontent.com/raw/lxc/lxd/pull/11011.patch -> lxd-5.8-add-tcp-keepalives-to-exec-channels.patch + verify-sig? ( https://linuxcontainers.org/downloads/lxd/${P}.tar.gz.asc )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64 ~arm64 ~x86" +IUSE="apparmor nls" + +DEPEND="acct-group/lxd + app-arch/xz-utils + >=app-containers/lxc-3.0.0[apparmor?,seccomp(+)] + dev-db/sqlite:3 + dev-libs/dqlite:= + dev-libs/lzo + dev-libs/raft[lz4] + >=dev-util/xdelta-3.0[lzma(+)] + net-dns/dnsmasq[dhcp,ipv6(+)] + sys-libs/libcap + virtual/udev" +RDEPEND="${DEPEND} + net-firewall/ebtables + net-firewall/iptables[ipv6(+)] + sys-apps/iproute2[ipv6(+)] + sys-fs/fuse:* + >=sys-fs/lxcfs-5.0.0 + sys-fs/squashfs-tools[lzma] + virtual/acl" +BDEPEND="dev-lang/go + nls? ( sys-devel/gettext ) + verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )" + +CONFIG_CHECK=" + ~CGROUPS + ~IPC_NS + ~NET_NS + ~PID_NS + + ~SECCOMP + ~USER_NS + ~UTS_NS + + ~KVM + ~MACVTAP + ~VHOST_VSOCK +" + +ERROR_IPC_NS="CONFIG_IPC_NS is required." +ERROR_NET_NS="CONFIG_NET_NS is required." +ERROR_PID_NS="CONFIG_PID_NS is required." +ERROR_SECCOMP="CONFIG_SECCOMP is required." +ERROR_UTS_NS="CONFIG_UTS_NS is required." + +WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines." +WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines." +WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines." + +# Go magic. +QA_PREBUILT="/usr/bin/fuidshift + /usr/bin/lxc + /usr/bin/lxc-to-lxd + /usr/bin/lxd-agent + /usr/bin/lxd-benchmark + /usr/bin/lxd-migrate + /usr/sbin/lxd" + +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc + +# The testsuite must be run as root. +# make: *** [Makefile:156: check] Error 1 +RESTRICT="test" + +GOPATH="${S}/_dist" + +PATCHES=( "${DISTDIR}"/lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch + "${DISTDIR}"/lxd-5.8-add-tcp-keepalives-to-exec-channels.patch + "${FILESDIR}"/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch ) + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} + fi + + default +} + +src_prepare() { + export GOPATH="${S}/_dist" + + default + + sed -i \ + -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd:g" \ + -e "s:make:make ${MAKEOPTS}:g" \ + Makefile || die + + # Fix hardcoded ovmf file path, see bug 763180 + sed -i \ + -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \ + -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \ + doc/environment.md \ + lxd/apparmor/instance.go \ + lxd/apparmor/instance_qemu.go \ + lxd/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths." + + # Fix hardcoded virtfs-proxy-helper file path, see bug 798924 + sed -i \ + -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \ + lxd/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path." + + cp "${FILESDIR}"/lxd-4.0.9-r1.service "${T}"/lxd.service || die + if use apparmor; then + sed -i \ + '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \ + "${T}"/lxd.service || die + fi + + # Disable -Werror's from go modules. + find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die +} + +src_configure() { :; } + +src_compile() { + export GOPATH="${S}/_dist" + export CGO_LDFLAGS_ALLOW="-Wl,-z,now" + + for k in fuidshift lxd-benchmark lxc lxc-to-lxd; do + go install -v -x "${S}/${k}" || die "failed compiling ${k}" + done + + go install -v -x -tags libsqlite3 "${S}"/lxd || die "Failed to build the daemon" + + # Needs to be built statically + CGO_ENABLED=0 go install -v -tags netgo "${S}"/lxd-migrate + CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/lxd-agent + + use nls && emake build-mo +} + +src_test() { + emake check +} + +src_install() { + export GOPATH="${S}/_dist" + local bindir="_dist/bin" + + dosbin ${bindir}/lxd + + for l in fuidshift lxd-agent lxd-benchmark lxd-migrate lxc lxc-to-lxd; do + dobin ${bindir}/${l} + done + + newbashcomp scripts/bash/lxd-client lxc + + newconfd "${FILESDIR}"/lxd-4.0.0.confd lxd + newinitd "${FILESDIR}"/lxd-5.0.2-r1.initd lxd + + systemd_dounit "${T}"/lxd.service + systemd_newunit "${FILESDIR}"/lxd-containers-4.0.0.service lxd-containers.service + systemd_newunit "${FILESDIR}"/lxd-4.0.0.socket lxd.socket + + dodoc AUTHORS + dodoc -r doc/* + use nls && domo po/*.mo +} + +pkg_postinst() { + elog + elog "Consult https://wiki.gentoo.org/wiki/LXD for more information," + elog "including a Quick Start." + elog "For virtual machine support, see:" + elog "https://wiki.gentoo.org/wiki/LXD#Virtual_machines" + elog + elog "Please run 'lxc-checkconfig' to see all optional kernel features." + elog + optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs] + optfeature "btrfs storage backend" sys-fs/btrfs-progs + optfeature "lvm2 storage backend" sys-fs/lvm2 + optfeature "zfs storage backend" sys-fs/zfs + elog + elog "Be sure to add your local user to the lxd group." + + if [[ ${REPLACING_VERSIONS} ]] && + ver_test ${REPLACING_VERSIONS} -lt 5.0.1 && + has_version app-emulation/qemu[spice,usbredir,virtfs]; then + ewarn "" + ewarn "You're updating from <5.0.1. Due to incompatible API updates in the lxd-agent" + ewarn "product, you'll have to restart any running virtual machines before they work" + ewarn "properly." + ewarn "" + ewarn "Run: 'lxc restart your-vm' after the update for your vm's managed by lxd." + ewarn "" + fi + + if [[ ${REPLACING_VERSIONS} ]] && + has_version "sys-apps/openrc"; then + elog "" + elog "The new init.d script will attempt to mount " + elog " /sys/fs/cgroup/systemd" + elog "by default, which is needed to run systemd containers with openrc host." + elog "See the /etc/init.d/lxd file for requirements." + elog "" + fi +} -- cgit v1.2.3