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, 27 Jul 2018 03:52:20
Message-Id: 1532643773.28d082d1f7a366675651059f7b878afd78f1c67c.stasibear@gentoo
1 commit: 28d082d1f7a366675651059f7b878afd78f1c67c
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 26 22:22:53 2018 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 26 22:22:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28d082d1
7
8 app-emulation/lxd: Bump to 3.3
9
10 Package-Manager: Portage-2.3.43, Repoman-2.3.10
11
12 app-emulation/lxd/Manifest | 1 +
13 app-emulation/lxd/lxd-3.3.ebuild | 183 +++++++++++++++++++++++++++++++++++++++
14 2 files changed, 184 insertions(+)
15
16 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
17 index e4d4728dc2a..a59667370be 100644
18 --- a/app-emulation/lxd/Manifest
19 +++ b/app-emulation/lxd/Manifest
20 @@ -44,3 +44,4 @@ DIST github.com-syndtr-gocapability-db04d3cc01c8b54962a58ec7e491717d06cfcc16.tar
21 DIST lxd-2.21.tar.gz 882352 BLAKE2B 80542bcc03c05667ee0207dfbfd2bf41c5a6ef69178aec06ad62fe3521ed012ed9b82c68c0254e0299e8e1dfd274a0622f32bde730480a950ab6ba15ddae5f4b SHA512 9a8ec3a97e4c861a80311dbdecbf5a485c0af85d6ba6b20680ca17e6ac877de3f27cfdcf0a111ba0db2b7c562dfe2f41336b562b7c13350c4543505b3c17357e
22 DIST lxd-3.1.tar.gz 27979442 BLAKE2B 0b74e3f76a7ab835b042b52b469a6fe11e7077d567e0658d13fab2192fd25d99518d65ba319c981a2e4677319e280cccae26f70ef99e9911264dc028ca5628fd SHA512 61f64d08dd80f7f676f386912f4dfc0d0af38cce0287de7865123b9da667b54ab91d22b76ffe03480e04ae0fbd8dc837d7d519d0e34409377c3d7e6624bf636c
23 DIST lxd-3.2.tar.gz 28183660 BLAKE2B 9aabc9fd0bd66d3b4e0178448a65ca39c69e4e7a14d01309e0e023501de1c17b2b7887a9da5b84fcfde27db3f521cce3451beace9955232da9bd5e5136bc0043 SHA512 82c37e87d75e328a29b1f2876a24fedec43a253bb72f3ea55fa9cdb928d11947eda723a01e758f90ef77ed4492f86ec6dd5f1f88240d05e771d926dfdc9888fb
24 +DIST lxd-3.3.tar.gz 28414680 BLAKE2B 7f3eecf400761548935e6e3c81d894379cd667ffbe6d8ef67a7dd3ad4f1c13846f524fcefc4cdc306674fb990706bda0b2c4ef390f320c41561fa86cf610586c SHA512 ed5d792c1080f2be7f48f34051fbfa28d138b4ccb5405edb13cd630776ec34312da491a1881f77dddbe1a121e589b44952e73ce1e61f2cba72243f3b8f4c0177
25
26 diff --git a/app-emulation/lxd/lxd-3.3.ebuild b/app-emulation/lxd/lxd-3.3.ebuild
27 new file mode 100644
28 index 00000000000..16a412be6a9
29 --- /dev/null
30 +++ b/app-emulation/lxd/lxd-3.3.ebuild
31 @@ -0,0 +1,183 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +DESCRIPTION="Fast, dense and secure container management"
38 +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
39 +
40 +LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0"
41 +SLOT="0"
42 +KEYWORDS="~amd64"
43 +
44 +IUSE="+daemon +ipv6 +dnsmasq nls test"
45 +
46 +inherit bash-completion-r1 linux-info systemd user
47 +
48 +SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz"
49 +
50 +DEPEND="
51 + >=dev-lang/go-1.9.4
52 + dev-libs/protobuf
53 + nls? ( sys-devel/gettext )
54 + test? (
55 + app-misc/jq
56 + net-misc/curl
57 + sys-devel/gettext
58 + )
59 +"
60 +
61 +RDEPEND="
62 + daemon? (
63 + app-arch/xz-utils
64 + >=app-emulation/lxc-2.0.7[seccomp]
65 + dnsmasq? (
66 + net-dns/dnsmasq[dhcp,ipv6?]
67 + )
68 + net-misc/rsync[xattr]
69 + sys-apps/iproute2[ipv6?]
70 + sys-fs/squashfs-tools
71 + virtual/acl
72 + )
73 +"
74 +
75 +CONFIG_CHECK="
76 + ~BRIDGE
77 + ~DUMMY
78 + ~IP6_NF_NAT
79 + ~IP6_NF_TARGET_MASQUERADE
80 + ~IPV6
81 + ~IP_NF_NAT
82 + ~IP_NF_TARGET_MASQUERADE
83 + ~MACVLAN
84 + ~NETFILTER_XT_MATCH_COMMENT
85 + ~NET_IPGRE
86 + ~NET_IPGRE_DEMUX
87 + ~NET_IPIP
88 + ~NF_NAT_MASQUERADE_IPV4
89 + ~NF_NAT_MASQUERADE_IPV6
90 + ~VXLAN
91 +"
92 +
93 +ERROR_BRIDGE="BRIDGE: needed for network commands"
94 +ERROR_DUMMY="DUMMY: needed for network commands"
95 +ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands"
96 +ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands"
97 +ERROR_IPV6="IPV6: needed for network commands"
98 +ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands"
99 +ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands"
100 +ERROR_MACVLAN="MACVLAN: needed for network commands"
101 +ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands"
102 +ERROR_NET_IPGRE="NET_IPGRE: needed for network commands"
103 +ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands"
104 +ERROR_NET_IPIP="NET_IPIP: needed for network commands"
105 +ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands"
106 +ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands"
107 +ERROR_VXLAN="VXLAN: needed for network commands"
108 +
109 +EGO_PN="github.com/lxc/lxd"
110 +
111 +PATCHES=(
112 + "${FILESDIR}/ja-translation-newline.patch" # https://github.com/lxc/lxd/pull/4572
113 + "${FILESDIR}/de-translation-newline.patch"
114 +)
115 +
116 +# LXD tarball is packaged with a nice "dist" folder containing all dependencies
117 +# that were vendored by upstream at release time. That saves us the trouble of
118 +# vendoring the dependencies ourselves. This is why there was this drastic drop
119 +# in ebuild complexity compared to pre 3.0.0-r2 ebuilds.
120 +src_compile() {
121 + export GOPATH="${S}/dist"
122 +
123 + # We don't use the Makefile here because it builds targets with the
124 + # assumption that `pwd` is in a deep gopath namespace, which we're not.
125 + # It's simpler to manually call "go install" than patching the Makefile.
126 + #
127 + # ABOUT "-tags libsqlite3": we used to link to the system's sqlite3 library
128 + # but since v3.0.0, LXD depends on github.com/CanonicalLtd/dqlite which
129 + # at the time of this writing, depends on patched version of sqlite with
130 + # replication capabilities added. We don't have that patch in dev-db/sqlite.
131 + # Therefore, we let LXD use its own private copy of sqlite.
132 + go install -v -x ${EGO_PN}/lxc || die "Failed to build the client"
133 +
134 + if use daemon; then
135 + go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift"
136 + go install -v -x ${EGO_PN}/lxd || die "Failed to build the daemon"
137 + fi
138 +
139 + use nls && emake build-mo
140 +}
141 +
142 +src_test() {
143 + if use daemon; then
144 + export GOPATH="${S}/dist"
145 + # This is mostly a copy/paste from the Makefile's "check" rule, but
146 + # patching the Makefile to work in a non "fully-qualified" go namespace
147 + # was more complicated than this modest copy/paste.
148 + # Also: sorry, for now a network connection is needed to run tests.
149 + # Will properly bundle test dependencies later.
150 + go get -v -x github.com/rogpeppe/godeps
151 + go get -v -x github.com/remyoudompheng/go-misc/deadcode
152 + go get -v -x github.com/golang/lint/golint
153 + go test -v ${EGO_PN}/lxd
154 + else
155 + einfo "No tests to run for client-only builds"
156 + fi
157 +}
158 +
159 +src_install() {
160 + local bindir="dist/bin"
161 + dobin ${bindir}/lxc
162 + if use daemon; then
163 + dosbin ${bindir}/lxd
164 + dobin ${bindir}/fuidshift
165 + fi
166 +
167 + if use nls; then
168 + domo po/*.mo
169 + fi
170 +
171 + if use daemon; then
172 + newinitd "${FILESDIR}"/${PN}.initd lxd
173 + newconfd "${FILESDIR}"/${PN}.confd.1 lxd
174 +
175 + systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
176 + fi
177 +
178 + newbashcomp scripts/bash/lxd-client lxc
179 +
180 + dodoc AUTHORS README.md doc/*
181 +}
182 +
183 +pkg_postinst() {
184 + einfo
185 + einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
186 + einfo "including a Quick Start."
187 +
188 + # The messaging below only applies to daemon installs
189 + use daemon || return 0
190 +
191 + # The control socket will be owned by (and writeable by) this group.
192 + enewgroup lxd
193 +
194 + # Ubuntu also defines an lxd user but it appears unused (the daemon
195 + # must run as root)
196 +
197 + einfo
198 + einfo "Though not strictly required, some features are enabled at run-time"
199 + einfo "when the relevant helper programs are detected:"
200 + einfo "- sys-apps/apparmor"
201 + einfo "- sys-fs/btrfs-progs"
202 + einfo "- sys-fs/lvm2"
203 + einfo "- sys-fs/lxcfs"
204 + einfo "- sys-fs/zfs"
205 + einfo "- sys-process/criu"
206 + einfo
207 + einfo "Since these features can't be disabled at build-time they are"
208 + einfo "not USE-conditional."
209 + einfo
210 + einfo "Be sure to add your local user to the lxd group."
211 + einfo
212 + einfo "Networks with bridge.mode=fan are unsupported due to requiring"
213 + einfo "a patched kernel and iproute2."
214 +}