1 |
commit: 31abbad829524ad9b08457dae4236ad3168f65b1 |
2 |
Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 3 04:04:07 2017 +0000 |
4 |
Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 3 04:04:07 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31abbad8 |
7 |
|
8 |
app-emulation/lxd: Bump to 2.7 |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
app-emulation/lxd/Manifest | 1 + |
13 |
app-emulation/lxd/files/lxd-2.7-dont-go-get.patch | 22 +++ |
14 |
app-emulation/lxd/files/lxd-2.7.confd | 27 +++ |
15 |
app-emulation/lxd/files/lxd-2.7.initd | 50 ++++++ |
16 |
app-emulation/lxd/lxd-2.7.ebuild | 199 ++++++++++++++++++++++ |
17 |
5 files changed, 299 insertions(+) |
18 |
|
19 |
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest |
20 |
index cb63251..edd2aef 100644 |
21 |
--- a/app-emulation/lxd/Manifest |
22 |
+++ b/app-emulation/lxd/Manifest |
23 |
@@ -2,3 +2,4 @@ DIST lxd-2.2.tar.bz2 2234844 SHA256 c76b8698a9266afa5e4aec3ccaa283226cc52232e10a |
24 |
DIST lxd-2.3.tar.bz2 2248758 SHA256 cd746b3f9682e50b7973e6175a5b48b999748face9e4b515491773ade9d754c4 SHA512 746ea9c2e9266a8482a62fc9e9fdb83f0713b0094e1b52957c5bf2fbd00f4bf1d7a0978086ab123d60ac02bd0dd1f00d46801959ced3b01308170dd7911c7bdc WHIRLPOOL f899e78bd3082ddd46dab5d09d83fe23a23aabbee09488f48ef2ff4a9f3bc41878ecb50b4223235c12962b01468c7b0124c0ae54e60d452f224824cbc89d144e |
25 |
DIST lxd-2.4.1.tar.bz2 2257768 SHA256 4a02c74819870be5df71227f90be4bc1b7cb90784c115c9f96a6174c8d4dcf75 SHA512 84ce4911a55d495f809a4174061577eceba0b3cd0381170a23fea91651049e43ec809494bf885b315b2d5fde7cda19ee29eed71259b88d3a789fd87c26aac3db WHIRLPOOL 70a2eb3c6b239e9d8682005134ae5c8e991b2f331685b971e1e8d09173aec8c34848527c9f893af0f937384d0f33f7a9e626f8063a00e2fa450331acf00ad7fe |
26 |
DIST lxd-2.5.tar.bz2 2267313 SHA256 d87ac77ec6f47cd3e3417a78b0c315dac367bc89c532cf1784d80b31e57cfc8d SHA512 c023f2b9ccd958560eead23806cb60a04371a3721420f5c0d65e55cf2d7647d6690677619c4f8fa91573545817a1444d9d61f6a2b6ca8c3870136911cb1fbce9 WHIRLPOOL e4702e2597c5fe88ffa5139b829146ea474959799910bed79db617d9486da73d9de77c1ad398c1112d04109a858e5684f2c676bfe9fd4d68cf5081fbc0f6ae7a |
27 |
+DIST lxd-2.7.tar.bz2 2309735 SHA256 2681a77888e19ed95ea0bd562dee9d03d703d01d25ab8cb8e80eb6c6a5f115ed SHA512 53a34e96a1478bd73f5b12988a10162fc4d93554cfd66a38a82879662e63a6d34cbdba432dea6e45733cb66f3b40b46146c4be2d38a66eb3d553f8157104b212 WHIRLPOOL 7fd13e545c632ee16b96f172948509838bcd85fe3541bd014168acb978811827367d86461eb68579fd6aaf3311a87f960057f207eb9b5a6b908a0aac81a5004d |
28 |
|
29 |
diff --git a/app-emulation/lxd/files/lxd-2.7-dont-go-get.patch b/app-emulation/lxd/files/lxd-2.7-dont-go-get.patch |
30 |
new file mode 100644 |
31 |
index 00000000..9402de5 |
32 |
--- /dev/null |
33 |
+++ b/app-emulation/lxd/files/lxd-2.7-dont-go-get.patch |
34 |
@@ -0,0 +1,22 @@ |
35 |
+--- /Makefile.orig 2016-07-11 23:34:40.299664675 +0000 |
36 |
++++ /Makefile 2016-07-11 23:37:00.816018727 +0000 |
37 |
+@@ -12,19 +12,11 @@ |
38 |
+ |
39 |
+ .PHONY: default |
40 |
+ default: |
41 |
+- # Must a few times due to go get race |
42 |
+- -go get -t -v -d ./... |
43 |
+- -go get -t -v -d ./... |
44 |
+- -go get -t -v -d ./... |
45 |
+ go install -v $(DEBUG) ./... |
46 |
+ @echo "LXD built successfully" |
47 |
+ |
48 |
+ .PHONY: client |
49 |
+ client: |
50 |
+- # Must a few times due to go get race |
51 |
+- -go get -t -v -d ./... |
52 |
+- -go get -t -v -d ./... |
53 |
+- -go get -t -v -d ./... |
54 |
+ go install -v $(DEBUG) ./lxc |
55 |
+ @echo "LXD client built successfully" |
56 |
+ |
57 |
|
58 |
diff --git a/app-emulation/lxd/files/lxd-2.7.confd b/app-emulation/lxd/files/lxd-2.7.confd |
59 |
new file mode 100644 |
60 |
index 00000000..3d55327 |
61 |
--- /dev/null |
62 |
+++ b/app-emulation/lxd/files/lxd-2.7.confd |
63 |
@@ -0,0 +1,27 @@ |
64 |
+# Group which owns the shared socket |
65 |
+LXD_OPTIONS+=" --group lxd" |
66 |
+ |
67 |
+ |
68 |
+ |
69 |
+# Enable cpu profiling into the specified file |
70 |
+#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile" |
71 |
+ |
72 |
+# Enable memory profiling into the specified file |
73 |
+#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile" |
74 |
+ |
75 |
+ |
76 |
+ |
77 |
+# Enables debug mode |
78 |
+#LXD_OPTIONS+=" --debug" |
79 |
+ |
80 |
+# For debugging, print a complete stack trace every n seconds |
81 |
+#LXD_OPTIONS+=" --print-goroutines-every 5" |
82 |
+ |
83 |
+# Enables verbose mode |
84 |
+#LXD_OPTIONS+=" -v" |
85 |
+ |
86 |
+# Logfile to log to |
87 |
+#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log" |
88 |
+ |
89 |
+# Enables syslog logging |
90 |
+#LXD_OPTIONS+=" --syslog" |
91 |
|
92 |
diff --git a/app-emulation/lxd/files/lxd-2.7.initd b/app-emulation/lxd/files/lxd-2.7.initd |
93 |
new file mode 100644 |
94 |
index 00000000..98b89bd |
95 |
--- /dev/null |
96 |
+++ b/app-emulation/lxd/files/lxd-2.7.initd |
97 |
@@ -0,0 +1,50 @@ |
98 |
+#!/sbin/openrc-run |
99 |
+# Copyright 1999-2017 Gentoo Foundation |
100 |
+# Distributed under the terms of the GNU General Public License v2 |
101 |
+# $Id$ |
102 |
+ |
103 |
+DAEMON=/usr/sbin/lxd |
104 |
+PIDFILE=/run/lxd.pid |
105 |
+ |
106 |
+extra_commands="stopall" |
107 |
+ |
108 |
+depend() { |
109 |
+ need net |
110 |
+ use lxcfs |
111 |
+ |
112 |
+ # remove with 2.0 release |
113 |
+ need cgmanager |
114 |
+} |
115 |
+ |
116 |
+start() { |
117 |
+ ebegin "Starting lxd server" |
118 |
+ |
119 |
+ start-stop-daemon --start \ |
120 |
+ --pidfile ${PIDFILE} \ |
121 |
+ --exec ${DAEMON} \ |
122 |
+ --background \ |
123 |
+ --make-pidfile \ |
124 |
+ -- \ |
125 |
+ ${LXD_OPTIONS} |
126 |
+ |
127 |
+ eend $? |
128 |
+} |
129 |
+ |
130 |
+stop() { |
131 |
+ if [[ $RC_GOINGDOWN = YES ]] || [[ $RC_REBOOT = YES ]]; then |
132 |
+ stopall |
133 |
+ else |
134 |
+ ebegin "Stopping lxd service (but not containers)" |
135 |
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} |
136 |
+ eend $? |
137 |
+ fi |
138 |
+} |
139 |
+ |
140 |
+stopall() { |
141 |
+ ebegin "Stopping lxd service and containers" |
142 |
+ if "${DAEMON}" shutdown; then |
143 |
+ /etc/init.d/lxd zap |
144 |
+ rm -f ${PIDFILE} |
145 |
+ fi |
146 |
+ eend $? |
147 |
+} |
148 |
|
149 |
diff --git a/app-emulation/lxd/lxd-2.7.ebuild b/app-emulation/lxd/lxd-2.7.ebuild |
150 |
new file mode 100644 |
151 |
index 00000000..edad0e2 |
152 |
--- /dev/null |
153 |
+++ b/app-emulation/lxd/lxd-2.7.ebuild |
154 |
@@ -0,0 +1,199 @@ |
155 |
+# Copyright 1999-2017 Gentoo Foundation |
156 |
+# Distributed under the terms of the GNU General Public License v2 |
157 |
+# $Id$ |
158 |
+ |
159 |
+EAPI=6 |
160 |
+ |
161 |
+DESCRIPTION="Fast, dense and secure container management" |
162 |
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/" |
163 |
+EGO_PN_PARENT="github.com/lxc" |
164 |
+EGO_PN="${EGO_PN_PARENT}/lxd" |
165 |
+ |
166 |
+# The source is repackaged using a script at: |
167 |
+# https://dev.gentoo.org/~stasibear/lxd_repackage.py |
168 |
+# This is necessary because go's native package management assumes |
169 |
+# that a build starts with checking out many git repositories, often |
170 |
+# from HEAD. This provides no way to build the same code repeatably, |
171 |
+# and anyway portage requires that fetching is only done from SRC_URI. |
172 |
+# The only sane alternative I've seen is in the consul ebuild, which |
173 |
+# is more transparent but raises other questions. |
174 |
+SRC_URI="https://dev.gentoo.org/~stasibear/distfiles/${P}.tar.bz2" |
175 |
+ |
176 |
+LICENSE="Apache-2.0" |
177 |
+SLOT="0" |
178 |
+KEYWORDS="~amd64" |
179 |
+ |
180 |
+PLOCALES="de fr ja" |
181 |
+IUSE="+daemon nls test" |
182 |
+ |
183 |
+# IUSE and PLOCALES must be defined before l10n inherited |
184 |
+inherit bash-completion-r1 golang-build l10n linux-info systemd user vcs-snapshot |
185 |
+ |
186 |
+DEPEND=" |
187 |
+ >=dev-lang/go-1.7.1 |
188 |
+ dev-go/go-crypto |
189 |
+ dev-go/go-net |
190 |
+ dev-libs/protobuf |
191 |
+ nls? ( sys-devel/gettext ) |
192 |
+ test? ( |
193 |
+ app-misc/jq |
194 |
+ dev-db/sqlite |
195 |
+ net-misc/curl |
196 |
+ sys-devel/gettext |
197 |
+ ) |
198 |
+" |
199 |
+ |
200 |
+RDEPEND=" |
201 |
+ daemon? ( |
202 |
+ app-admin/cgmanager |
203 |
+ app-arch/xz-utils |
204 |
+ app-emulation/lxc[cgmanager,seccomp] |
205 |
+ net-dns/dnsmasq[dhcp,ipv6] |
206 |
+ net-misc/rsync[xattr] |
207 |
+ sys-apps/iproute2[ipv6] |
208 |
+ sys-fs/squashfs-tools |
209 |
+ virtual/acl |
210 |
+ ) |
211 |
+" |
212 |
+ |
213 |
+CONFIG_CHECK=" |
214 |
+ ~BRIDGE |
215 |
+ ~DUMMY |
216 |
+ ~IP6_NF_NAT |
217 |
+ ~IP6_NF_TARGET_MASQUERADE |
218 |
+ ~IPV6 |
219 |
+ ~IP_NF_NAT |
220 |
+ ~IP_NF_TARGET_MASQUERADE |
221 |
+ ~MACVLAN |
222 |
+ ~NETFILTER_XT_MATCH_COMMENT |
223 |
+ ~NET_IPGRE |
224 |
+ ~NET_IPGRE_DEMUX |
225 |
+ ~NET_IPIP |
226 |
+ ~NF_NAT_MASQUERADE_IPV4 |
227 |
+ ~NF_NAT_MASQUERADE_IPV6 |
228 |
+ ~VXLAN |
229 |
+" |
230 |
+ |
231 |
+ERROR_BRIDGE="BRIDGE: needed for network commands" |
232 |
+ERROR_DUMMY="DUMMY: needed for network commands" |
233 |
+ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands" |
234 |
+ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands" |
235 |
+ERROR_IPV6="IPV6: needed for network commands" |
236 |
+ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands" |
237 |
+ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands" |
238 |
+ERROR_MACVLAN="MACVLAN: needed for network commands" |
239 |
+ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands" |
240 |
+ERROR_NET_IPGRE="NET_IPGRE: needed for network commands" |
241 |
+ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands" |
242 |
+ERROR_NET_IPIP="NET_IPIP: needed for network commands" |
243 |
+ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands" |
244 |
+ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands" |
245 |
+ERROR_VXLAN="VXLAN: needed for network commands" |
246 |
+ |
247 |
+PATCHES=("${FILESDIR}/${P}-dont-go-get.patch") |
248 |
+ |
249 |
+# KNOWN ISSUES: |
250 |
+# - Translations may not work. I've been unsuccessful in forcing |
251 |
+# localized output. Anyway, upstream (Canonical) doesn't install the |
252 |
+# message files. |
253 |
+ |
254 |
+src_prepare() { |
255 |
+ cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir" |
256 |
+ |
257 |
+ default_src_prepare |
258 |
+ |
259 |
+ tmpgoroot="${T}/goroot" |
260 |
+ mkdir -p "$tmpgoroot" || die "Failed to create temporary GOROOT" |
261 |
+ cp -sR "$(get_golibdir_gopath)"/* "${tmpgoroot}" || die "Failed to copy files to temporary GOROOT" |
262 |
+ |
263 |
+ # Warn on unhandled locale changes |
264 |
+ l10n_find_plocales_changes po "" .po |
265 |
+} |
266 |
+ |
267 |
+src_compile() { |
268 |
+ golang-build_src_compile |
269 |
+ |
270 |
+ cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir" |
271 |
+ |
272 |
+ tmpgoroot="${T}/goroot" |
273 |
+ if use daemon; then |
274 |
+ # Build binaries |
275 |
+ GOPATH="${S}:${tmpgoroot}" emake |
276 |
+ else |
277 |
+ # build client tool |
278 |
+ GOPATH="${S}:${tmpgoroot}" emake client |
279 |
+ fi |
280 |
+ |
281 |
+ use nls && emake build-mo |
282 |
+} |
283 |
+ |
284 |
+src_test() { |
285 |
+ if use daemon; then |
286 |
+ # Go native tests should succeed |
287 |
+ golang-build_src_test |
288 |
+ fi |
289 |
+} |
290 |
+ |
291 |
+src_install() { |
292 |
+ # Installs all src,pkg to /usr/lib/go-gentoo |
293 |
+ golang-build_src_install |
294 |
+ |
295 |
+ cd "${S}" |
296 |
+ dobin bin/lxc |
297 |
+ if use daemon; then |
298 |
+ dosbin bin/lxd |
299 |
+ dobin bin/fuidshift |
300 |
+ fi |
301 |
+ |
302 |
+ cd "src/${EGO_PN}" |
303 |
+ |
304 |
+ if use nls; then |
305 |
+ for lingua in ${PLOCALES}; do |
306 |
+ if use linguas_${lingua}; then |
307 |
+ domo po/${lingua}.mo |
308 |
+ fi |
309 |
+ done |
310 |
+ fi |
311 |
+ |
312 |
+ if use daemon; then |
313 |
+ newinitd "${FILESDIR}"/${P}.initd lxd |
314 |
+ newconfd "${FILESDIR}"/${P}.confd lxd |
315 |
+ |
316 |
+ systemd_dounit "${FILESDIR}"/lxd.service |
317 |
+ fi |
318 |
+ |
319 |
+ newbashcomp config/bash/lxd-client lxc |
320 |
+ |
321 |
+ dodoc AUTHORS CONTRIBUTING.md README.md doc/* |
322 |
+} |
323 |
+ |
324 |
+pkg_postinst() { |
325 |
+ einfo |
326 |
+ einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information," |
327 |
+ einfo "including a Quick Start." |
328 |
+ |
329 |
+ # The messaging below only applies to daemon installs |
330 |
+ use daemon || return 0 |
331 |
+ |
332 |
+ # The control socket will be owned by (and writeable by) this group. |
333 |
+ enewgroup lxd |
334 |
+ |
335 |
+ # Ubuntu also defines an lxd user but it appears unused (the daemon |
336 |
+ # must run as root) |
337 |
+ |
338 |
+ einfo |
339 |
+ einfo "Though not strictly required, some features are enabled at run-time" |
340 |
+ einfo "when the relevant helper programs are detected:" |
341 |
+ einfo "- sys-apps/apparmor" |
342 |
+ einfo "- sys-fs/btrfs-progs" |
343 |
+ einfo "- sys-fs/lvm2" |
344 |
+ einfo "- sys-fs/lxcfs" |
345 |
+ einfo "- sys-fs/zfs" |
346 |
+ einfo "- sys-process/criu" |
347 |
+ einfo |
348 |
+ einfo "Since these features can't be disabled at build-time they are" |
349 |
+ einfo "not USE-conditional." |
350 |
+ einfo |
351 |
+ einfo "Networks with bridge.mode=fan are unsupported due to requiring" |
352 |
+ einfo "a patched kernel and iproute2." |
353 |
+} |