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