Gentoo Archives: gentoo-commits

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