Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-containers/lxd/
Date: Wed, 17 Aug 2022 06:18:04
Message-Id: 1660717079.5e109607c953a4b24f85acd2a0df55bc14c6e039.juippis@gentoo
1 commit: 5e109607c953a4b24f85acd2a0df55bc14c6e039
2 Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 17 06:16:01 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 17 06:17:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e109607
7
8 app-containers/lxd: add 5.0.1
9
10 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
11
12 app-containers/lxd/Manifest | 2 +
13 app-containers/lxd/lxd-5.0.1.ebuild | 180 ++++++++++++++++++++++++++++++++++++
14 app-containers/lxd/metadata.xml | 17 +++-
15 3 files changed, 195 insertions(+), 4 deletions(-)
16
17 diff --git a/app-containers/lxd/Manifest b/app-containers/lxd/Manifest
18 index ed62839a3b77..8c0c9f43f578 100644
19 --- a/app-containers/lxd/Manifest
20 +++ b/app-containers/lxd/Manifest
21 @@ -1,2 +1,4 @@
22 DIST lxd-5.0.0.tar.gz 17706199 BLAKE2B 5559bdd479e03b43407e58aa240a00dae488cbf799cec39cbe74b636c907d247341132a49b414fa573c5d5d366643d296522efb6d71c1c0f83cc8edc038f1432 SHA512 e74c14a2642ee4ea738629b1da9c4b416f3bdbb26a49c8c920eb0e5e0467236fd610276541af1d481d6b069093cb1c35c705008652ff2cd55d2d15e9b7433696
23 DIST lxd-5.0.0.tar.gz.asc 833 BLAKE2B 7e8fc6f6892294fb8a6384f5767cb74b0a4b941c39da3b097c2196b328fb4f0b1816c46adae0bb343022bd558e77612ab3d93884053c1db5f7c1067c13444fb5 SHA512 d3d583175437cee37b6d7d8d137ab1440dd6ac1c91200616fe68e5f38197f11ab2ed85f1aba06dfb0d32f88153defb2bb3f897601902e66fe0a5eff6042e57c0
24 +DIST lxd-5.0.1.tar.gz 14640923 BLAKE2B 81bdf3301c0eecc719864cd8e18fd886113f83d1980e13ee4d4ccb6641ee4a7e33f0b859a21abd8a0a9956d1c2f3dfa6e7eb1ae454fbb580c23b5558ef51168e SHA512 b04b7329bdeb17ca384cc2d931a1510d5f03521fd247eab93904bbcb6139cc0daf28f9aeb6416268ccf15affdd15b26598f3e280fb5eefe5c59be6918f092bed
25 +DIST lxd-5.0.1.tar.gz.asc 833 BLAKE2B d233c8ebfb5b71f66ff08b4d74861a42bf45ef3e9622d4f113603a7a6c1a29b5aa3422c075ad5250a7d5ab7526a49dd676672d0a73194024af477fa762e02b12 SHA512 bf22f26b6688420e843e9e24eb731a2068eae3d90c77787e0f4a279d4cb7a8a2df38b7e9c8ea79f604c1d54743238cb36474baf018ea6bf72e6f37838b252294
26
27 diff --git a/app-containers/lxd/lxd-5.0.1.ebuild b/app-containers/lxd/lxd-5.0.1.ebuild
28 new file mode 100644
29 index 000000000000..b761f3d0f2b8
30 --- /dev/null
31 +++ b/app-containers/lxd/lxd-5.0.1.ebuild
32 @@ -0,0 +1,180 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
39 +
40 +DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
41 +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd"
42 +SRC_URI="https://linuxcontainers.org/downloads/lxd/${P}.tar.gz
43 + verify-sig? ( https://linuxcontainers.org/downloads/lxd/${P}.tar.gz.asc )"
44 +
45 +LICENSE="Apache-2.0"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~arm64 ~x86"
48 +IUSE="apparmor ipv6 nls verify-sig"
49 +
50 +DEPEND="acct-group/lxd
51 + app-arch/xz-utils
52 + >=app-containers/lxc-3.0.0[apparmor?,seccomp(+)]
53 + dev-db/sqlite:3
54 + dev-libs/dqlite
55 + dev-libs/lzo
56 + dev-libs/raft[lz4]
57 + >=dev-util/xdelta-3.0[lzma(+)]
58 + net-dns/dnsmasq[dhcp,ipv6(+)?]
59 + sys-libs/libcap
60 + virtual/udev"
61 +RDEPEND="${DEPEND}
62 + net-firewall/ebtables
63 + net-firewall/iptables[ipv6(+)?]
64 + sys-apps/iproute2[ipv6(+)?]
65 + sys-fs/fuse:*
66 + >=sys-fs/lxcfs-5.0.0
67 + sys-fs/squashfs-tools[lzma]
68 + virtual/acl"
69 +BDEPEND="dev-lang/go
70 + nls? ( sys-devel/gettext )
71 + verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
72 +
73 +CONFIG_CHECK="
74 + ~CGROUPS
75 + ~IPC_NS
76 + ~NET_NS
77 + ~PID_NS
78 +
79 + ~SECCOMP
80 + ~USER_NS
81 + ~UTS_NS
82 +
83 + ~KVM
84 + ~MACVTAP
85 + ~VHOST_VSOCK
86 +"
87 +
88 +ERROR_IPC_NS="CONFIG_IPC_NS is required."
89 +ERROR_NET_NS="CONFIG_NET_NS is required."
90 +ERROR_PID_NS="CONFIG_PID_NS is required."
91 +ERROR_SECCOMP="CONFIG_SECCOMP is required."
92 +ERROR_UTS_NS="CONFIG_UTS_NS is required."
93 +
94 +WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
95 +WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
96 +WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
97 +
98 +# Go magic.
99 +QA_PREBUILT="/usr/bin/fuidshift
100 + /usr/bin/lxc
101 + /usr/bin/lxc-to-lxd
102 + /usr/bin/lxd-agent
103 + /usr/bin/lxd-benchmark
104 + /usr/bin/lxd-migrate
105 + /usr/sbin/lxd"
106 +
107 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc
108 +
109 +# The testsuite must be run as root.
110 +# make: *** [Makefile:156: check] Error 1
111 +RESTRICT="test"
112 +
113 +GOPATH="${S}/_dist"
114 +
115 +src_prepare() {
116 + export GOPATH="${S}/_dist"
117 +
118 + default
119 +
120 + sed -i \
121 + -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd:g" \
122 + -e "s:make:make ${MAKEOPTS}:g" \
123 + Makefile || die
124 +
125 + # Fix hardcoded ovmf file path, see bug 763180
126 + sed -i \
127 + -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
128 + -e "s:OVMF_VARS.ms.fd:OVMF_VARS.secboot.fd:g" \
129 + doc/environment.md \
130 + lxd/apparmor/instance.go \
131 + lxd/apparmor/instance_qemu.go \
132 + lxd/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
133 +
134 + # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
135 + sed -i \
136 + -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
137 + lxd/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
138 +
139 + cp "${FILESDIR}"/lxd-4.0.9-r1.service "${T}"/lxd.service || die
140 + if use apparmor; then
141 + sed -i \
142 + '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
143 + "${T}"/lxd.service || die
144 + fi
145 +
146 + # Disable -Werror's from go modules.
147 + find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
148 +}
149 +
150 +src_configure() { :; }
151 +
152 +src_compile() {
153 + export GOPATH="${S}/_dist"
154 + export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
155 +
156 + for k in fuidshift lxd-benchmark lxc lxc-to-lxd; do
157 + go install -v -x "${S}/${k}" || die "failed compiling ${k}"
158 + done
159 +
160 + go install -v -x -tags libsqlite3 ${S}/lxd || die "Failed to build the daemon"
161 +
162 + # Needs to be built statically
163 + CGO_ENABLED=0 go install -v -tags netgo "${S}"/lxd-migrate
164 + CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/lxd-agent
165 +
166 + use nls && emake build-mo
167 +}
168 +
169 +src_test() {
170 + emake check
171 +}
172 +
173 +src_install() {
174 + export GOPATH="${S}/_dist"
175 + local bindir="_dist/bin"
176 +
177 + dosbin ${bindir}/lxd
178 +
179 + for l in fuidshift lxd-agent lxd-benchmark lxd-migrate lxc lxc-to-lxd; do
180 + dobin ${bindir}/${l}
181 + done
182 +
183 + newbashcomp scripts/bash/lxd-client lxc
184 +
185 + newconfd "${FILESDIR}"/lxd-4.0.0.confd lxd
186 + newinitd "${FILESDIR}"/lxd-4.0.9.initd lxd
187 +
188 + systemd_dounit "${T}"/lxd.service
189 + systemd_newunit "${FILESDIR}"/lxd-containers-4.0.0.service lxd-containers.service
190 + systemd_newunit "${FILESDIR}"/lxd-4.0.0.socket lxd.socket
191 +
192 + dodoc AUTHORS
193 + dodoc -r doc/*
194 + use nls && domo po/*.mo
195 +}
196 +
197 +pkg_postinst() {
198 + elog
199 + elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
200 + elog "including a Quick Start."
201 + elog "For virtual machine support, see:"
202 + elog "https://wiki.gentoo.org/wiki/LXD#Virtual_machines"
203 + elog
204 + elog "Please run 'lxc-checkconfig' to see all optional kernel features."
205 + elog
206 + optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs]
207 + optfeature "btrfs storage backend" sys-fs/btrfs-progs
208 + optfeature "lvm2 storage backend" sys-fs/lvm2
209 + optfeature "zfs storage backend" sys-fs/zfs
210 + elog
211 + elog "Be sure to add your local user to the lxd group."
212 +}
213
214 diff --git a/app-containers/lxd/metadata.xml b/app-containers/lxd/metadata.xml
215 index dfd11315a93a..a666d3414c49 100644
216 --- a/app-containers/lxd/metadata.xml
217 +++ b/app-containers/lxd/metadata.xml
218 @@ -13,10 +13,19 @@
219 <flag name="apparmor">Enable AppArmor support</flag>
220 </use>
221 <longdescription>
222 - By combining the speed and density of containers with
223 - the security of traditional virtual machines, LXD is
224 - the next-generation of container hypervisor for Linux
225 - from Canonical.
226 + LXD is a modern, secure and powerful system container and virtual machine manager.
227 +
228 + It provides a unified experience for running and managing full Linux systems inside containers
229 + or virtual machines. LXD supplies images for a wide number of Linux distributions and is built
230 + around a very powerful, yet pretty simple, REST API. LXD scales from one instance on a single
231 + machine to a cluster in a full data center rack, making it suitable for running workloads both
232 + for development and in production.
233 +
234 + LXD allows you to easily set up a system that feels like a small private cloud. You can run any
235 + type of workload in an efficient way while keeping your resources optimized.
236 +
237 + You should consider using LXD if you want to containerize different environments or run virtual
238 + machines, or in general run and manage your infrastructure in a cost-effective way.
239 </longdescription>
240 <upstream>
241 <remote-id type="github">lxc/lxd</remote-id>