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