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-emulation/lxd/
Date: Sat, 01 May 2021 05:38:59
Message-Id: 1619847527.5d05a7c3f79a987247f5e43260a299eccab75c06.juippis@gentoo
1 commit: 5d05a7c3f79a987247f5e43260a299eccab75c06
2 Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 1 05:37:09 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sat May 1 05:38:47 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d05a7c3
7
8 app-emulation/lxd: bump to 4.0.6
9
10 - build lxd-agent statically, #752480
11
12 Bug: https://bugs.gentoo.org/752480
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 app-emulation/lxd/Manifest | 2 +
16 app-emulation/lxd/lxd-4.0.6.ebuild | 156 +++++++++++++++++++++++++++++++++++++
17 2 files changed, 158 insertions(+)
18
19 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
20 index 45ccce6f37d..c92c906912e 100644
21 --- a/app-emulation/lxd/Manifest
22 +++ b/app-emulation/lxd/Manifest
23 @@ -1,2 +1,4 @@
24 DIST lxd-4.0.5.tar.gz 14659330 BLAKE2B 4d61885a94946d3a6018324512ea318716cb9c1bc5f40be4eb62f71ad6a0eb993cda0ef917fbefb3949c0d47a6217245cc62e0ced3abfbcf47f6d8375a7d85d0 SHA512 8b9e6742dc3383fb31dce33d9f8ffe7a0ea661d274f6c3ac710f58d4d5b90b596881386571564ec0cd8f027da43eaa3948dd675d6fa07f1095405f4cc05f1211
25 DIST lxd-4.0.5.tar.gz.asc 833 BLAKE2B f5b2ead748973831ec7ba7be00c34d26b16a6b168fb88a25f07126eeab5c812cab72609acc443e9bb541ff64849952bf66f8ee207083836a2aab905f1373c1e0 SHA512 b59edaf88cd8ab34271eb0ebb52270ede1509351596449b1b955eaba70a50f6f18fdc95fcc933deca3fe545b9aa45bfda3b7aa6553a8b4f2cedc8d1a6b3a5946
26 +DIST lxd-4.0.6.tar.gz 15353779 BLAKE2B f699e91c53b407e5a0e47fe40b133d6216754b1e5c5829ee68993468565f2080c12cbcbf8373d6da16ca94a3648ec51b874e66ff589be09dc95f2382d18f3e12 SHA512 58efaac50dbcbb3cf0e7aa1b3b43085beae4546dfcd081720b049c2b88bf120b9a74e7db1238bbdd8cc2449e039b076ece3734e8f46f3ddbdc70aaae8b326963
27 +DIST lxd-4.0.6.tar.gz.asc 833 BLAKE2B 6d1756b130a944a98e62d809c45129178bfc39158c71e09319cdaff7461b14bda467e44a781bb5c15d40afdae4d3ec86f98919738a8c169d3fff910d8e9fe58a SHA512 6c59bd8ec9bf0d9bd90c8ab2970cf6928c0bef3736631ea2a56ebc464f33940366d35925ddfc4104c13fa0fd4e1bea42796e0a2eb82a8bf395957829f938c7db
28
29 diff --git a/app-emulation/lxd/lxd-4.0.6.ebuild b/app-emulation/lxd/lxd-4.0.6.ebuild
30 new file mode 100644
31 index 00000000000..bfa426ef05e
32 --- /dev/null
33 +++ b/app-emulation/lxd/lxd-4.0.6.ebuild
34 @@ -0,0 +1,156 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +inherit autotools bash-completion-r1 linux-info optfeature systemd verify-sig
41 +
42 +DESCRIPTION="Fast, dense and secure container management"
43 +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd"
44 +SRC_URI="https://linuxcontainers.org/downloads/lxd/${P}.tar.gz
45 + verify-sig? ( https://linuxcontainers.org/downloads/lxd/${P}.tar.gz.asc )"
46 +
47 +LICENSE="Apache-2.0"
48 +SLOT="0"
49 +KEYWORDS="~amd64"
50 +IUSE="apparmor ipv6 nls verify-sig"
51 +
52 +DEPEND="app-arch/xz-utils
53 + >=app-emulation/lxc-3.0.0[apparmor?,seccomp(+)]
54 + dev-libs/dqlite
55 + dev-libs/lzo
56 + dev-libs/raft
57 + net-dns/dnsmasq[dhcp,ipv6?]"
58 +RDEPEND="${DEPEND}
59 + acct-group/lxd
60 + net-firewall/ebtables
61 + net-firewall/iptables[ipv6?]
62 + sys-apps/iproute2[ipv6?]
63 + sys-fs/fuse:*
64 + sys-fs/lxcfs
65 + sys-fs/squashfs-tools[lzma]
66 + virtual/acl"
67 +BDEPEND="dev-lang/go
68 + nls? ( sys-devel/gettext )
69 + verify-sig? ( app-crypt/openpgp-keys-linuxcontainers )"
70 +
71 +CONFIG_CHECK="
72 + ~CGROUPS
73 + ~IPC_NS
74 + ~NET_NS
75 + ~PID_NS
76 +
77 + ~SECCOMP
78 + ~USER_NS
79 + ~UTS_NS
80 +"
81 +
82 +ERROR_IPC_NS="CONFIG_IPC_NS is required."
83 +ERROR_NET_NS="CONFIG_NET_NS is required."
84 +ERROR_PID_NS="CONFIG_PID_NS is required."
85 +ERROR_SECCOMP="CONFIG_SECCOMP is required."
86 +ERROR_UTS_NS="CONFIG_UTS_NS is required."
87 +
88 +# Go magic.
89 +QA_PREBUILT="/usr/bin/fuidshift
90 + /usr/bin/lxc
91 + /usr/bin/lxc-to-lxd
92 + /usr/bin/lxd-agent
93 + /usr/bin/lxd-benchmark
94 + /usr/bin/lxd-p2c
95 + /usr/sbin/lxd"
96 +
97 +EGO_PN="github.com/lxc/lxd"
98 +GOPATH="${S}/_dist" # this seems to reset every now and then, though
99 +
100 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc
101 +
102 +src_prepare() {
103 + default
104 +
105 + export GOPATH="${S}/_dist"
106 +
107 + sed -i \
108 + -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd:g" \
109 + -e "s:make:make ${MAKEOPTS}:g" \
110 + Makefile || die
111 +
112 + # Fix hardcoded ovmf file path, see bug 763180
113 + sed -i \
114 + -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
115 + -e "s:OVMF_VARS.ms.fd:OVMF_VARS.secboot.fd:g" \
116 + doc/environment.md \
117 + lxd/apparmor/instance_qemu.go \
118 + lxd/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
119 +}
120 +
121 +src_configure() { :; }
122 +
123 +src_compile() {
124 + export GOPATH="${S}/_dist"
125 + export GO111MODULE=auto
126 +
127 + cd "${S}" || die
128 +
129 + for k in fuidshift lxd-benchmark lxc lxc-to-lxd; do
130 + go install -v -x "${EGO_PN}/${k}" || die "failed compiling ${k}"
131 + done
132 +
133 + go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon"
134 +
135 + # Needs to be built statically
136 + CGO_ENABLED=0 go install -v -tags netgo "${EGO_PN}"/lxd-p2c
137 + CGO_ENABLED=0 go install -v -tags agent,netgo "${EGO_PN}"/lxd-agent
138 +
139 + use nls && emake build-mo
140 +}
141 +
142 +src_test() {
143 + export GO111MODULE=auto
144 + export GOPATH="${S}/_dist"
145 + go test -v ${EGO_PN}/lxd || die
146 +}
147 +
148 +src_install() {
149 + local bindir="_dist/bin"
150 + export GOPATH="${S}/_dist"
151 +
152 + dosbin ${bindir}/lxd
153 +
154 + for l in fuidshift lxd-agent lxd-benchmark lxd-p2c lxc lxc-to-lxd; do
155 + dobin ${bindir}/${l}
156 + done
157 +
158 + cd "${S}" || die
159 +
160 + newbashcomp scripts/bash/lxd-client lxc
161 +
162 + newconfd "${FILESDIR}"/lxd-4.0.0.confd lxd
163 + newinitd "${FILESDIR}"/lxd-4.0.0.initd lxd
164 +
165 + if use apparmor; then
166 + systemd_newunit "${FILESDIR}"/lxd-4.0.0_apparmor.service lxd.service
167 + else
168 + systemd_newunit "${FILESDIR}"/lxd-4.0.0.service lxd.service
169 + fi
170 +
171 + systemd_newunit "${FILESDIR}"/lxd-containers-4.0.0.service lxd-containers.service
172 + systemd_newunit "${FILESDIR}"/lxd-4.0.0.socket lxd.socket
173 +
174 + dodoc AUTHORS doc/*
175 + use nls && domo po/*.mo
176 +}
177 +
178 +pkg_postinst() {
179 + elog
180 + elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
181 + elog "including a Quick Start."
182 + elog
183 + elog "Please run 'lxc-checkconfig' to see all optional kernel features."
184 + elog
185 + optfeature "btrfs storage backend" sys-fs/btrfs-progs
186 + optfeature "lvm2 storage backend" sys-fs/lvm2
187 + optfeature "zfs storage backend" sys-fs/zfs
188 + elog
189 + elog "Be sure to add your local user to the lxd group."
190 +}