1 |
commit: d86f8a1382457790853be504333d7172a0139d3b |
2 |
Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jul 1 14:24:55 2019 +0000 |
4 |
Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 1 14:24:55 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d86f8a13 |
7 |
|
8 |
app-emulation/lxd: Bump to 3.14 |
9 |
|
10 |
Signed-off-by: Erik Mackdanz <stasibear <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.67, Repoman-2.3.16 |
12 |
|
13 |
app-emulation/lxd/Manifest | 1 + |
14 |
app-emulation/lxd/lxd-3.14.ebuild | 240 ++++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 241 insertions(+) |
16 |
|
17 |
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest |
18 |
index 03b05f78456..94f485cced0 100644 |
19 |
--- a/app-emulation/lxd/Manifest |
20 |
+++ b/app-emulation/lxd/Manifest |
21 |
@@ -1 +1,2 @@ |
22 |
DIST lxd-3.12.tar.gz 27365315 BLAKE2B 2b371ef4e9703a7a0494ca009b3c04a3051d76ba0bc87566b90871059cce04f80c5d941d639a53762b219f658379bbffb8ed844cee4271bb756aecb2742ce1d0 SHA512 fd56ee2a2114b338cfb8b575775530b34c7dcc978c95f9bc3b0dced91cf7f01558012c357eb3f8220bc6fa6aa5ecaca67d47b300b67c0d193f11c5088ce6330e |
23 |
+DIST lxd-3.14.tar.gz 26141949 BLAKE2B 69004501012c9a873eef77a60df7e5dba25c692224d27b02cd2d2b27533012e71bd7562cb64a17920234746e8be2819bb773365c01422c0b776dd2b7c36b69fe SHA512 3d2d4e61298fc9fde49defad776a398fcccf7639485e810173c9c7f7d939c354a9ad8112a4a631b0850f6eb54435012d289236ff61839416caf95434eb23c8ff |
24 |
|
25 |
diff --git a/app-emulation/lxd/lxd-3.14.ebuild b/app-emulation/lxd/lxd-3.14.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..80bccb3ac76 |
28 |
--- /dev/null |
29 |
+++ b/app-emulation/lxd/lxd-3.14.ebuild |
30 |
@@ -0,0 +1,240 @@ |
31 |
+# Copyright 1999-2019 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=7 |
35 |
+ |
36 |
+DESCRIPTION="Fast, dense and secure container management" |
37 |
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/" |
38 |
+ |
39 |
+LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0" |
40 |
+SLOT="0" |
41 |
+KEYWORDS="~amd64" |
42 |
+ |
43 |
+IUSE="+daemon +ipv6 +dnsmasq nls test tools" |
44 |
+ |
45 |
+inherit autotools bash-completion-r1 linux-info systemd user |
46 |
+ |
47 |
+SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz" |
48 |
+ |
49 |
+DEPEND=" |
50 |
+ dev-lang/tcl |
51 |
+ >=dev-lang/go-1.9.4 |
52 |
+ dev-libs/libuv |
53 |
+ dev-libs/protobuf |
54 |
+ nls? ( sys-devel/gettext ) |
55 |
+ test? ( |
56 |
+ app-misc/jq |
57 |
+ net-misc/curl |
58 |
+ sys-devel/gettext |
59 |
+ ) |
60 |
+" |
61 |
+ |
62 |
+RDEPEND=" |
63 |
+ daemon? ( |
64 |
+ app-arch/xz-utils |
65 |
+ >=app-emulation/lxc-2.0.7[seccomp] |
66 |
+ dev-libs/libuv |
67 |
+ dev-libs/lzo |
68 |
+ dev-util/xdelta:3 |
69 |
+ dnsmasq? ( |
70 |
+ net-dns/dnsmasq[dhcp,ipv6?] |
71 |
+ ) |
72 |
+ net-firewall/ebtables |
73 |
+ net-firewall/iptables[ipv6?] |
74 |
+ net-libs/libnfnetlink |
75 |
+ net-libs/libnsl:0= |
76 |
+ net-misc/rsync[xattr] |
77 |
+ sys-apps/iproute2[ipv6?] |
78 |
+ sys-fs/fuse |
79 |
+ sys-fs/lxcfs |
80 |
+ sys-fs/squashfs-tools |
81 |
+ virtual/acl |
82 |
+ ) |
83 |
+" |
84 |
+ |
85 |
+CONFIG_CHECK=" |
86 |
+ ~BRIDGE |
87 |
+ ~DUMMY |
88 |
+ ~IP6_NF_NAT |
89 |
+ ~IP6_NF_TARGET_MASQUERADE |
90 |
+ ~IPV6 |
91 |
+ ~IP_NF_NAT |
92 |
+ ~IP_NF_TARGET_MASQUERADE |
93 |
+ ~MACVLAN |
94 |
+ ~NETFILTER_XT_MATCH_COMMENT |
95 |
+ ~NET_IPGRE |
96 |
+ ~NET_IPGRE_DEMUX |
97 |
+ ~NET_IPIP |
98 |
+ ~NF_NAT_MASQUERADE_IPV4 |
99 |
+ ~NF_NAT_MASQUERADE_IPV6 |
100 |
+ ~VXLAN |
101 |
+" |
102 |
+ |
103 |
+ERROR_BRIDGE="BRIDGE: needed for network commands" |
104 |
+ERROR_DUMMY="DUMMY: needed for network commands" |
105 |
+ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands" |
106 |
+ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands" |
107 |
+ERROR_IPV6="IPV6: needed for network commands" |
108 |
+ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands" |
109 |
+ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands" |
110 |
+ERROR_MACVLAN="MACVLAN: needed for network commands" |
111 |
+ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands" |
112 |
+ERROR_NET_IPGRE="NET_IPGRE: needed for network commands" |
113 |
+ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands" |
114 |
+ERROR_NET_IPIP="NET_IPIP: needed for network commands" |
115 |
+ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands" |
116 |
+ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands" |
117 |
+ERROR_VXLAN="VXLAN: needed for network commands" |
118 |
+ |
119 |
+EGO_PN="github.com/lxc/lxd" |
120 |
+ |
121 |
+src_prepare() { |
122 |
+ eapply_user |
123 |
+ eapply "${FILESDIR}/de-translation-newline-1.patch" |
124 |
+ |
125 |
+ cd "${S}/dist/dqlite" || die "Can't cd to dqlite dir" |
126 |
+ eautoreconf |
127 |
+} |
128 |
+ |
129 |
+src_configure() { |
130 |
+ export GOPATH="${S}/dist" |
131 |
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir" |
132 |
+ econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd" |
133 |
+ |
134 |
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" |
135 |
+ PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=${EPREFIX}/usr/lib/lxd |
136 |
+} |
137 |
+ |
138 |
+src_compile() { |
139 |
+ export GOPATH="${S}/dist" |
140 |
+ |
141 |
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir" |
142 |
+ emake |
143 |
+ |
144 |
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" |
145 |
+ emake CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite" |
146 |
+ |
147 |
+ # We don't use the Makefile here because it builds targets with the |
148 |
+ # assumption that `pwd` is in a deep gopath namespace, which we're not. |
149 |
+ # It's simpler to manually call "go install" than patching the Makefile. |
150 |
+ cd "${S}" |
151 |
+ go install -v -x ${EGO_PN}/lxc || die "Failed to build the client" |
152 |
+ |
153 |
+ if use daemon; then |
154 |
+ |
155 |
+ # LXD depends on a patched, bundled sqlite with replication |
156 |
+ # capabilities. |
157 |
+ export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/" |
158 |
+ export CGO_LDFLAGS="-L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd" |
159 |
+ export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/" |
160 |
+ |
161 |
+ go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon" |
162 |
+ fi |
163 |
+ |
164 |
+ if use tools; then |
165 |
+ go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift" |
166 |
+ go install -v -x ${EGO_PN}/lxc-to-lxd || die "Failed to build lxc-to-lxd" |
167 |
+ go install -v -x ${EGO_PN}/lxd-benchmark || die "Failed to build lxd-benchmark" |
168 |
+ go install -v -x ${EGO_PN}/lxd-p2c || die "Failed to build lxd-p2c" |
169 |
+ fi |
170 |
+ |
171 |
+ use nls && emake build-mo |
172 |
+} |
173 |
+ |
174 |
+src_test() { |
175 |
+ if use daemon; then |
176 |
+ export GOPATH="${S}/dist" |
177 |
+ # This is mostly a copy/paste from the Makefile's "check" rule, but |
178 |
+ # patching the Makefile to work in a non "fully-qualified" go namespace |
179 |
+ # was more complicated than this modest copy/paste. |
180 |
+ # Also: sorry, for now a network connection is needed to run tests. |
181 |
+ # Will properly bundle test dependencies later. |
182 |
+ go get -v -x github.com/rogpeppe/godeps |
183 |
+ go get -v -x github.com/remyoudompheng/go-misc/deadcode |
184 |
+ go get -v -x github.com/golang/lint/golint |
185 |
+ go test -v ${EGO_PN}/lxd |
186 |
+ else |
187 |
+ einfo "No tests to run for client-only builds" |
188 |
+ fi |
189 |
+} |
190 |
+ |
191 |
+src_install() { |
192 |
+ local bindir="dist/bin" |
193 |
+ dobin ${bindir}/lxc |
194 |
+ if use daemon; then |
195 |
+ |
196 |
+ export GOPATH="${S}/dist" |
197 |
+ cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir" |
198 |
+ emake DESTDIR="${D}" install |
199 |
+ |
200 |
+ cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" |
201 |
+ emake DESTDIR="${D}" install |
202 |
+ |
203 |
+ # Must only install libs |
204 |
+ rm "${D}/usr/bin/sqlite3" || die "Can't remove custom sqlite3 binary" |
205 |
+ rm -r "${D}/usr/include" || die "Can't remove include directory" |
206 |
+ |
207 |
+ cd "${S}" || die "Can't cd to \${S}" |
208 |
+ dosbin ${bindir}/lxd |
209 |
+ fi |
210 |
+ |
211 |
+ if use tools; then |
212 |
+ dobin ${bindir}/fuidshift |
213 |
+ dobin ${bindir}/lxc-to-lxd |
214 |
+ dobin ${bindir}/lxd-benchmark |
215 |
+ dobin ${bindir}/lxd-p2c |
216 |
+ fi |
217 |
+ |
218 |
+ if use nls; then |
219 |
+ domo po/*.mo |
220 |
+ fi |
221 |
+ |
222 |
+ if use daemon; then |
223 |
+ newinitd "${FILESDIR}"/${PN}.initd lxd |
224 |
+ newconfd "${FILESDIR}"/${PN}.confd lxd |
225 |
+ |
226 |
+ systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service |
227 |
+ fi |
228 |
+ |
229 |
+ newbashcomp scripts/bash/lxd-client lxc |
230 |
+ |
231 |
+ dodoc AUTHORS doc/* |
232 |
+} |
233 |
+ |
234 |
+pkg_postinst() { |
235 |
+ elog |
236 |
+ elog "Consult https://wiki.gentoo.org/wiki/LXD for more information," |
237 |
+ elog "including a Quick Start." |
238 |
+ |
239 |
+ # The messaging below only applies to daemon installs |
240 |
+ use daemon || return 0 |
241 |
+ |
242 |
+ # The control socket will be owned by (and writeable by) this group. |
243 |
+ enewgroup lxd |
244 |
+ |
245 |
+ # Ubuntu also defines an lxd user but it appears unused (the daemon |
246 |
+ # must run as root) |
247 |
+ |
248 |
+ elog |
249 |
+ elog "Though not strictly required, some features are enabled at run-time" |
250 |
+ elog "when the relevant helper programs are detected:" |
251 |
+ elog "- sys-apps/apparmor" |
252 |
+ elog "- sys-fs/btrfs-progs" |
253 |
+ elog "- sys-fs/lvm2" |
254 |
+ elog "- sys-fs/zfs" |
255 |
+ elog "- sys-process/criu" |
256 |
+ elog |
257 |
+ elog "Since these features can't be disabled at build-time they are" |
258 |
+ elog "not USE-conditional." |
259 |
+ elog |
260 |
+ elog "Be sure to add your local user to the lxd group." |
261 |
+ elog |
262 |
+ elog "Networks with bridge.mode=fan are unsupported due to requiring" |
263 |
+ elog "a patched kernel and iproute2." |
264 |
+} |
265 |
+ |
266 |
+# TODO: |
267 |
+# - man page, I don't see cobra generating it |
268 |
+# - maybe implement LXD_CLUSTER_UPDATE per |
269 |
+# https://discuss.linuxcontainers.org/t/lxd-3-5-has-been-released/2656 |
270 |
+# EM I'm not convinced it's a good design. |