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/, app-emulation/lxd/files/
Date: Sun, 01 Jul 2018 17:11:01
Message-Id: 1530465039.7161056c6d309856b19fc23ede5e9995ec8ea910.stasibear@gentoo
1 commit: 7161056c6d309856b19fc23ede5e9995ec8ea910
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 29 23:11:10 2018 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 1 17:10:39 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7161056c
7
8 app-emulation/lxd: Bump to version 3.2
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 app-emulation/lxd/Manifest | 1 +
13 .../lxd/files/de-translation-newline.patch | 20 +++
14 app-emulation/lxd/lxd-3.2.ebuild | 181 +++++++++++++++++++++
15 3 files changed, 202 insertions(+)
16
17 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
18 index 653ac15bf85..4e3d4b1ae5d 100644
19 --- a/app-emulation/lxd/Manifest
20 +++ b/app-emulation/lxd/Manifest
21 @@ -97,3 +97,4 @@ DIST github.com-syndtr-gocapability-db04d3cc01c8b54962a58ec7e491717d06cfcc16.tar
22 DIST lxd-2.21.tar.gz 882352 BLAKE2B 80542bcc03c05667ee0207dfbfd2bf41c5a6ef69178aec06ad62fe3521ed012ed9b82c68c0254e0299e8e1dfd274a0622f32bde730480a950ab6ba15ddae5f4b SHA512 9a8ec3a97e4c861a80311dbdecbf5a485c0af85d6ba6b20680ca17e6ac877de3f27cfdcf0a111ba0db2b7c562dfe2f41336b562b7c13350c4543505b3c17357e
23 DIST lxd-3.0.0.tar.gz 1152282 BLAKE2B e84808c626064ba6985c08119905510c2a9659edca09887a55bfe006eaba4a624215d48978e18ab642f34e54e58fc1d2e04303c9db73c332df8c5d29568fb779 SHA512 b4de839d26080f2b14b1f6f04a92b000e1abaa0712377528b87ca79e01b9c46b7b6c7f7ce5365f37f7a0ae8a2459bcdc6010fcb2a238d78e34d090750ae070f3
24 DIST lxd-3.1.tar.gz 27979442 BLAKE2B 0b74e3f76a7ab835b042b52b469a6fe11e7077d567e0658d13fab2192fd25d99518d65ba319c981a2e4677319e280cccae26f70ef99e9911264dc028ca5628fd SHA512 61f64d08dd80f7f676f386912f4dfc0d0af38cce0287de7865123b9da667b54ab91d22b76ffe03480e04ae0fbd8dc837d7d519d0e34409377c3d7e6624bf636c
25 +DIST lxd-3.2.tar.gz 28183660 BLAKE2B 9aabc9fd0bd66d3b4e0178448a65ca39c69e4e7a14d01309e0e023501de1c17b2b7887a9da5b84fcfde27db3f521cce3451beace9955232da9bd5e5136bc0043 SHA512 82c37e87d75e328a29b1f2876a24fedec43a253bb72f3ea55fa9cdb928d11947eda723a01e758f90ef77ed4492f86ec6dd5f1f88240d05e771d926dfdc9888fb
26
27 diff --git a/app-emulation/lxd/files/de-translation-newline.patch b/app-emulation/lxd/files/de-translation-newline.patch
28 new file mode 100644
29 index 00000000000..9ef55ab2f0e
30 --- /dev/null
31 +++ b/app-emulation/lxd/files/de-translation-newline.patch
32 @@ -0,0 +1,20 @@
33 +--- /po/de.po 2018-06-27 19:57:56.759130047 -0500
34 ++++ /po/de.po 2018-06-27 20:01:09.694634346 -0500
35 +@@ -65,7 +65,7 @@
36 + "### type: custom\n"
37 + "### used_by: []\n"
38 + "### config:\n"
39 +-"### size: \"61203283968\""
40 ++"### size: \"61203283968\"\n"
41 + msgstr ""
42 + "### Dies ist eine Darstellung der Eigenschaften eines Abbildes in yaml.\n"
43 + "### Jede Zeile die mit '# beginnt wird ignoriert.\n"
44 +@@ -167,7 +167,7 @@
45 + "###\n"
46 + "### Each property is represented by a single line:\n"
47 + "### An example would be:\n"
48 +-"### description: My custom image"
49 ++"### description: My custom image\n"
50 + msgstr ""
51 + "### Dies ist eine Darstellung der Eigenschaften eines Images in yaml.\n"
52 + "### Jede Zeile die mit '# beginnt wird ignoriert.\n"
53
54 diff --git a/app-emulation/lxd/lxd-3.2.ebuild b/app-emulation/lxd/lxd-3.2.ebuild
55 new file mode 100644
56 index 00000000000..1f0f3db33a2
57 --- /dev/null
58 +++ b/app-emulation/lxd/lxd-3.2.ebuild
59 @@ -0,0 +1,181 @@
60 +# Copyright 1999-2018 Gentoo Foundation
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=6
64 +
65 +DESCRIPTION="Fast, dense and secure container management"
66 +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
67 +
68 +LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0"
69 +SLOT="0"
70 +KEYWORDS="~amd64"
71 +
72 +IUSE="+daemon +ipv6 +dnsmasq nls test"
73 +
74 +inherit bash-completion-r1 linux-info systemd user
75 +
76 +SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz"
77 +
78 +DEPEND="
79 + >=dev-lang/go-1.9.4
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 + dnsmasq? (
94 + net-dns/dnsmasq[dhcp,ipv6?]
95 + )
96 + net-misc/rsync[xattr]
97 + sys-apps/iproute2[ipv6?]
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 +PATCHES=(
140 + "${FILESDIR}/ja-translation-newline.patch" # https://github.com/lxc/lxd/pull/4572
141 + "${FILESDIR}/de-translation-newline.patch"
142 +)
143 +
144 +# LXD tarball is packaged with a nice "dist" folder containing all dependencies
145 +# that were vendored by upstream at release time. That saves us the trouble of
146 +# vendoring the dependencies ourselves. This is why there was this drastic drop
147 +# in ebuild complexity compared to pre 3.0.0-r2 ebuilds.
148 +src_compile() {
149 + export GOPATH="${S}/dist"
150 +
151 + # We don't use the Makefile here because it builds targets with the
152 + # assumption that `pwd` is in a deep gopath namespace, which we're not.
153 + # It's simpler to manually call "go install" than patching the Makefile.
154 + #
155 + # ABOUT "-tags libsqlite3": we used to link to the system's sqlite3 library
156 + # but since v3.0.0, LXD depends on github.com/CanonicalLtd/dqlite which
157 + # at the time of this writing, depends on patched version of sqlite with
158 + # replication capabilities added. We don't have that patch in dev-db/sqlite.
159 + # Therefore, we let LXD use its own private copy of sqlite.
160 + go install -v -x ${EGO_PN}/lxc || die "Failed to build the client"
161 +
162 + if use daemon; then
163 + go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift"
164 + go install -v -x ${EGO_PN}/lxd || die "Failed to build the daemon"
165 + fi
166 +
167 + use nls && emake build-mo
168 +}
169 +
170 +src_test() {
171 + if use daemon; then
172 + export GOPATH="${S}/dist"
173 + # This is mostly a copy/paste from the Makefile's "check" rule, but
174 + # patching the Makefile to work in a non "fully-qualified" go namespace
175 + # was more complicated than this modest copy/paste.
176 + # Also: sorry, for now a network connection is needed to run tests.
177 + # Will properly bundle test dependencies later.
178 + go get -v -x github.com/rogpeppe/godeps
179 + go get -v -x github.com/remyoudompheng/go-misc/deadcode
180 + go get -v -x github.com/golang/lint/golint
181 + go test -v ${EGO_PN}/lxd
182 + else
183 + einfo "No tests to run for client-only builds"
184 + fi
185 +}
186 +
187 +src_install() {
188 + local bindir="dist/bin"
189 + dobin ${bindir}/lxc
190 + if use daemon; then
191 + dosbin ${bindir}/lxd
192 + dobin ${bindir}/fuidshift
193 + fi
194 +
195 + if use nls; then
196 + domo po/*.mo
197 + fi
198 +
199 + if use daemon; then
200 + newinitd "${FILESDIR}"/${PN}.initd lxd
201 + newconfd "${FILESDIR}"/${PN}.confd.1 lxd
202 +
203 + systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
204 + fi
205 +
206 + newbashcomp scripts/bash/lxd-client lxc
207 +
208 + dodoc AUTHORS README.md doc/*
209 +}
210 +
211 +pkg_postinst() {
212 + einfo
213 + einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
214 + einfo "including a Quick Start."
215 +
216 + # The messaging below only applies to daemon installs
217 + use daemon || return 0
218 +
219 + # The control socket will be owned by (and writeable by) this group.
220 + enewgroup lxd
221 +
222 + # Ubuntu also defines an lxd user but it appears unused (the daemon
223 + # must run as root)
224 +
225 + einfo
226 + einfo "Though not strictly required, some features are enabled at run-time"
227 + einfo "when the relevant helper programs are detected:"
228 + einfo "- sys-apps/apparmor"
229 + einfo "- sys-fs/btrfs-progs"
230 + einfo "- sys-fs/lvm2"
231 + einfo "- sys-fs/lxcfs"
232 + einfo "- sys-fs/zfs"
233 + einfo "- sys-process/criu"
234 + einfo
235 + einfo "Since these features can't be disabled at build-time they are"
236 + einfo "not USE-conditional."
237 + einfo
238 + einfo "Networks with bridge.mode=fan are unsupported due to requiring"
239 + einfo "a patched kernel and iproute2."
240 +}