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