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: Tue, 02 Apr 2019 04:15:14
Message-Id: 1554178491.ce76e4d27be1c2f95fdd90e1701da16ff6fd841b.stasibear@gentoo
1 commit: ce76e4d27be1c2f95fdd90e1701da16ff6fd841b
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 2 04:14:51 2019 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 2 04:14:51 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce76e4d2
7
8 app-emulation/lxd: Bump to 3.11
9
10 Signed-off-by: Erik Mackdanz <stasibear <AT> gentoo.org>
11 Package-Manager: Portage-2.3.62, Repoman-2.3.12
12
13 app-emulation/lxd/Manifest | 1 +
14 app-emulation/lxd/lxd-3.11.ebuild | 241 ++++++++++++++++++++++++++++++++++++++
15 2 files changed, 242 insertions(+)
16
17 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
18 index f2ee48a0546..d48b9ba3565 100644
19 --- a/app-emulation/lxd/Manifest
20 +++ b/app-emulation/lxd/Manifest
21 @@ -1 +1,2 @@
22 DIST lxd-3.10.tar.gz 27057432 BLAKE2B b5a5c3cd4f1045419c806510aab21c3bcde8c8687ede808b1b832e2a0caba0ff3af5d79367141b29e84c0bd3bcf6958d917bc813700220e238cd21933963009b SHA512 25ed7675af7b6861d754607b19485e329ae344befac06fe33f326e34030755359bea6f574c414849b85f034533fd5dccb95a326ae0ad9e44b8ea366f7ee44d04
23 +DIST lxd-3.11.tar.gz 27281796 BLAKE2B 640944cd929b69b7c6f935b7e3587e05b77ec71da8f20b988b831b837f86706b3cb3a81676f4ae456bf06594ea74e9ab44b87d22ddaa78209d4a0f6cbbba3483 SHA512 182a2fd6b69c8228760c26498d77f46c6bdda899018e1ab4470f2382202250582c66fc11f4c2d8d86598f19e3a62a1027dfe190342611c4a819a27ce6e39e78e
24
25 diff --git a/app-emulation/lxd/lxd-3.11.ebuild b/app-emulation/lxd/lxd-3.11.ebuild
26 new file mode 100644
27 index 00000000000..988a505aa24
28 --- /dev/null
29 +++ b/app-emulation/lxd/lxd-3.11.ebuild
30 @@ -0,0 +1,241 @@
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 + eapply "${FILESDIR}/ptbr-translation-newline.patch"
125 +
126 + cd "${S}/dist/dqlite" || die "Can't cd to dqlite dir"
127 + eautoreconf
128 +}
129 +
130 +src_configure() {
131 + export GOPATH="${S}/dist"
132 + cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
133 + econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd"
134 +
135 + cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
136 + PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=${EPREFIX}/usr/lib/lxd
137 +}
138 +
139 +src_compile() {
140 + export GOPATH="${S}/dist"
141 +
142 + cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
143 + emake
144 +
145 + cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
146 + emake CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite"
147 +
148 + # We don't use the Makefile here because it builds targets with the
149 + # assumption that `pwd` is in a deep gopath namespace, which we're not.
150 + # It's simpler to manually call "go install" than patching the Makefile.
151 + cd "${S}"
152 + go install -v -x ${EGO_PN}/lxc || die "Failed to build the client"
153 +
154 + if use daemon; then
155 +
156 + # LXD depends on a patched, bundled sqlite with replication
157 + # capabilities.
158 + export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/"
159 + export CGO_LDFLAGS="-L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd"
160 + export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/"
161 +
162 + go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon"
163 + fi
164 +
165 + if use tools; then
166 + go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift"
167 + go install -v -x ${EGO_PN}/lxc-to-lxd || die "Failed to build lxc-to-lxd"
168 + go install -v -x ${EGO_PN}/lxd-benchmark || die "Failed to build lxd-benchmark"
169 + go install -v -x ${EGO_PN}/lxd-p2c || die "Failed to build lxd-p2c"
170 + fi
171 +
172 + use nls && emake build-mo
173 +}
174 +
175 +src_test() {
176 + if use daemon; then
177 + export GOPATH="${S}/dist"
178 + # This is mostly a copy/paste from the Makefile's "check" rule, but
179 + # patching the Makefile to work in a non "fully-qualified" go namespace
180 + # was more complicated than this modest copy/paste.
181 + # Also: sorry, for now a network connection is needed to run tests.
182 + # Will properly bundle test dependencies later.
183 + go get -v -x github.com/rogpeppe/godeps
184 + go get -v -x github.com/remyoudompheng/go-misc/deadcode
185 + go get -v -x github.com/golang/lint/golint
186 + go test -v ${EGO_PN}/lxd
187 + else
188 + einfo "No tests to run for client-only builds"
189 + fi
190 +}
191 +
192 +src_install() {
193 + local bindir="dist/bin"
194 + dobin ${bindir}/lxc
195 + if use daemon; then
196 +
197 + export GOPATH="${S}/dist"
198 + cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir"
199 + emake DESTDIR="${D}" install
200 +
201 + cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir"
202 + emake DESTDIR="${D}" install
203 +
204 + # Must only install libs
205 + rm "${D}/usr/bin/sqlite3" || die "Can't remove custom sqlite3 binary"
206 + rm -r "${D}/usr/include" || die "Can't remove include directory"
207 +
208 + cd "${S}" || die "Can't cd to \${S}"
209 + dosbin ${bindir}/lxd
210 + fi
211 +
212 + if use tools; then
213 + dobin ${bindir}/fuidshift
214 + dobin ${bindir}/lxc-to-lxd
215 + dobin ${bindir}/lxd-benchmark
216 + dobin ${bindir}/lxd-p2c
217 + fi
218 +
219 + if use nls; then
220 + domo po/*.mo
221 + fi
222 +
223 + if use daemon; then
224 + newinitd "${FILESDIR}"/${PN}.initd lxd
225 + newconfd "${FILESDIR}"/${PN}.confd lxd
226 +
227 + systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
228 + fi
229 +
230 + newbashcomp scripts/bash/lxd-client lxc
231 +
232 + dodoc AUTHORS doc/*
233 +}
234 +
235 +pkg_postinst() {
236 + elog
237 + elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
238 + elog "including a Quick Start."
239 +
240 + # The messaging below only applies to daemon installs
241 + use daemon || return 0
242 +
243 + # The control socket will be owned by (and writeable by) this group.
244 + enewgroup lxd
245 +
246 + # Ubuntu also defines an lxd user but it appears unused (the daemon
247 + # must run as root)
248 +
249 + elog
250 + elog "Though not strictly required, some features are enabled at run-time"
251 + elog "when the relevant helper programs are detected:"
252 + elog "- sys-apps/apparmor"
253 + elog "- sys-fs/btrfs-progs"
254 + elog "- sys-fs/lvm2"
255 + elog "- sys-fs/zfs"
256 + elog "- sys-process/criu"
257 + elog
258 + elog "Since these features can't be disabled at build-time they are"
259 + elog "not USE-conditional."
260 + elog
261 + elog "Be sure to add your local user to the lxd group."
262 + elog
263 + elog "Networks with bridge.mode=fan are unsupported due to requiring"
264 + elog "a patched kernel and iproute2."
265 +}
266 +
267 +# TODO:
268 +# - man page, I don't see cobra generating it
269 +# - maybe implement LXD_CLUSTER_UPDATE per
270 +# https://discuss.linuxcontainers.org/t/lxd-3-5-has-been-released/2656
271 +# EM I'm not convinced it's a good design.