1 |
commit: 3895236a79563800d89d74f074d0146640d5bf04 |
2 |
Author: Alex Brandt <alunduil <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 11 14:38:04 2015 +0000 |
4 |
Commit: Alex Brandt <alunduil <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 11 14:38:53 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3895236a |
7 |
|
8 |
app-emulation/lxd: add version 0.18 |
9 |
|
10 |
Package-Manager: portage-2.2.23 |
11 |
|
12 |
app-emulation/lxd/Manifest | 1 + |
13 |
app-emulation/lxd/files/lxd-0.18-dont-go-get.patch | 18 +++ |
14 |
.../lxd/files/lxd-0.18-nc-binary-name.patch | 11 ++ |
15 |
app-emulation/lxd/files/lxd-0.18.confd | 27 ++++ |
16 |
app-emulation/lxd/files/lxd-0.18.initd | 32 ++++ |
17 |
app-emulation/lxd/lxd-0.18.ebuild | 166 +++++++++++++++++++++ |
18 |
app-emulation/lxd/metadata.xml | 4 + |
19 |
7 files changed, 259 insertions(+) |
20 |
|
21 |
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest |
22 |
index 6254714..88f5361 100644 |
23 |
--- a/app-emulation/lxd/Manifest |
24 |
+++ b/app-emulation/lxd/Manifest |
25 |
@@ -1,3 +1,4 @@ |
26 |
DIST lxd-0.13.tar.bz2 3336161 SHA256 4228979ea9a856647f75f0230f58cc577c111a287f148787af766ab36c55f756 SHA512 12cd865ef63702674342df23ebb298b6ba39f0d44e9bfe91c643820be06ff30910145388a4daa2d63fbcb53c236e3cd4eb84e3e0bc617c85247322b0024c4920 WHIRLPOOL 82e788e9b35429df308d498955bd0cab06eb7d1a09c0a20bddad78490900b2cb78a44da9970db149ebfda546250a1d5aa2204e5f6f98b81a228310bfee3003a7 |
27 |
DIST lxd-0.14.tar.bz2 2526939 SHA256 c0c51ac5b3d30c7906323eba965011073b412a3c354ce095e46f14df4298c46c SHA512 d3f9eb38cdf71add270c895c1583dab85b0e0dba0d956900628b519881b41582113d6c25d37b9522493de069ad6a43b197ae895aefeb83391337273a4b60953e WHIRLPOOL 2b9c6931b81df7e60b13e35bfcd5272a46fb29377e11f6326616f55bf6c583db7be82d41273369518e9b9e434bee3b30f989b6816cd8dbdd40cc2cc1effac7b4 |
28 |
DIST lxd-0.16.tar.bz2 2660683 SHA256 bbe2b7542af34c93c7509e9638016a420bfc1daf1f1f45a33fa3d379ae10f14f SHA512 856e5ea1920ec3025cbd308a8e2ef656393a149111a38188f749e7d42a41032d762009d85316815c3f18ac0907fa9380758ca48666b13e900c9bbdf809d57f1c WHIRLPOOL f4bbea69073f2cc0dce65e39d88cdf1a0fadd4629b5b42bdee7ab385df459f78a2e36619c40ace687be124fb8d59c0da043cb1a8195630b2d0a051ab53297b89 |
29 |
+DIST lxd-0.18.tar.bz2 2674919 SHA256 cb9c4823fb19ccef4827ee4dc3a105b60d3549b5023f4517d1471487469ea395 SHA512 5bbaae6eef27a0b14f8fee41d113afeea61de5414e5f7ed5011819eb6823a11dff647ac3f9781357304f7c5b04c618d05e4a04197cae6c6e4845cad5476d22ff WHIRLPOOL ca73e587f19491d79b03af2d205ab9f234b5acb1ff1f2d68a05be053cbd1ec89f6b9bc0fc64113980d7f2d6e3c7ece01d7d0c431c08a87b2b0ec555c6ff97914 |
30 |
|
31 |
diff --git a/app-emulation/lxd/files/lxd-0.18-dont-go-get.patch b/app-emulation/lxd/files/lxd-0.18-dont-go-get.patch |
32 |
new file mode 100644 |
33 |
index 0000000..1b229ea |
34 |
--- /dev/null |
35 |
+++ b/app-emulation/lxd/files/lxd-0.18-dont-go-get.patch |
36 |
@@ -0,0 +1,18 @@ |
37 |
+--- Makefile.orig 2015-09-17 20:37:16.481867339 -0500 |
38 |
++++ Makefile 2015-09-17 20:53:27.715800926 -0500 |
39 |
+@@ -12,15 +12,11 @@ |
40 |
+ |
41 |
+ .PHONY: default |
42 |
+ default: |
43 |
+- -go get -t -v -d ./... |
44 |
+- -go get -t -v -d ./... |
45 |
+ go install -v ./... |
46 |
+ @echo "LXD built succesfuly" |
47 |
+ |
48 |
+ .PHONY: client |
49 |
+ client: |
50 |
+- -go get -t -v -d ./... |
51 |
+- -go get -t -v -d ./... |
52 |
+ go install -v ./lxc |
53 |
+ @echo "LXD client built succesfuly" |
54 |
+ |
55 |
|
56 |
diff --git a/app-emulation/lxd/files/lxd-0.18-nc-binary-name.patch b/app-emulation/lxd/files/lxd-0.18-nc-binary-name.patch |
57 |
new file mode 100644 |
58 |
index 0000000..b88b7f7 |
59 |
--- /dev/null |
60 |
+++ b/app-emulation/lxd/files/lxd-0.18-nc-binary-name.patch |
61 |
@@ -0,0 +1,11 @@ |
62 |
+--- lxd/rsync.go.orig 2015-09-17 21:00:29.290772099 -0500 |
63 |
++++ lxd/rsync.go 2015-09-17 21:00:54.737770359 -0500 |
64 |
+@@ -73,7 +73,7 @@ |
65 |
+ * command (i.e. the command to run on --server). However, we're |
66 |
+ * hardcoding that at the other end, so we can just ignore it. |
67 |
+ */ |
68 |
+- rsyncCmd := fmt.Sprintf("sh -c \"nc -U %s\"", f.Name()) |
69 |
++ rsyncCmd := fmt.Sprintf("sh -c \"nc.openbsd -U %s\"", f.Name()) |
70 |
+ cmd := exec.Command("rsync", "-arvP", "--devices", "--partial", path, "localhost:/tmp/foo", "-e", rsyncCmd) |
71 |
+ if err := cmd.Start(); err != nil { |
72 |
+ return nil, nil, err |
73 |
|
74 |
diff --git a/app-emulation/lxd/files/lxd-0.18.confd b/app-emulation/lxd/files/lxd-0.18.confd |
75 |
new file mode 100644 |
76 |
index 0000000..3d55327 |
77 |
--- /dev/null |
78 |
+++ b/app-emulation/lxd/files/lxd-0.18.confd |
79 |
@@ -0,0 +1,27 @@ |
80 |
+# Group which owns the shared socket |
81 |
+LXD_OPTIONS+=" --group lxd" |
82 |
+ |
83 |
+ |
84 |
+ |
85 |
+# Enable cpu profiling into the specified file |
86 |
+#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile" |
87 |
+ |
88 |
+# Enable memory profiling into the specified file |
89 |
+#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile" |
90 |
+ |
91 |
+ |
92 |
+ |
93 |
+# Enables debug mode |
94 |
+#LXD_OPTIONS+=" --debug" |
95 |
+ |
96 |
+# For debugging, print a complete stack trace every n seconds |
97 |
+#LXD_OPTIONS+=" --print-goroutines-every 5" |
98 |
+ |
99 |
+# Enables verbose mode |
100 |
+#LXD_OPTIONS+=" -v" |
101 |
+ |
102 |
+# Logfile to log to |
103 |
+#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log" |
104 |
+ |
105 |
+# Enables syslog logging |
106 |
+#LXD_OPTIONS+=" --syslog" |
107 |
|
108 |
diff --git a/app-emulation/lxd/files/lxd-0.18.initd b/app-emulation/lxd/files/lxd-0.18.initd |
109 |
new file mode 100644 |
110 |
index 0000000..2b75e51 |
111 |
--- /dev/null |
112 |
+++ b/app-emulation/lxd/files/lxd-0.18.initd |
113 |
@@ -0,0 +1,32 @@ |
114 |
+#!/sbin/runscript |
115 |
+# Copyright 1999-2015 Gentoo Foundation |
116 |
+# Distributed under the terms of the GNU General Public License v2 |
117 |
+# $Id$ |
118 |
+ |
119 |
+DAEMON=/usr/sbin/lxd |
120 |
+PIDFILE=/run/lxd.pid |
121 |
+ |
122 |
+depend() { |
123 |
+ need cgmanager |
124 |
+ need net |
125 |
+} |
126 |
+ |
127 |
+start() { |
128 |
+ ebegin "Starting lxd server" |
129 |
+ |
130 |
+ start-stop-daemon --start \ |
131 |
+ --pidfile ${PIDFILE} \ |
132 |
+ --exec ${DAEMON} \ |
133 |
+ --background \ |
134 |
+ --make-pidfile \ |
135 |
+ -- \ |
136 |
+ ${LXD_OPTIONS} |
137 |
+ |
138 |
+ eend $? |
139 |
+} |
140 |
+ |
141 |
+stop() { |
142 |
+ ebegin "Stopping lxd server" |
143 |
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} |
144 |
+ eend $? |
145 |
+} |
146 |
|
147 |
diff --git a/app-emulation/lxd/lxd-0.18.ebuild b/app-emulation/lxd/lxd-0.18.ebuild |
148 |
new file mode 100644 |
149 |
index 0000000..fd53d98 |
150 |
--- /dev/null |
151 |
+++ b/app-emulation/lxd/lxd-0.18.ebuild |
152 |
@@ -0,0 +1,166 @@ |
153 |
+# Copyright 1999-2015 Gentoo Foundation |
154 |
+# Distributed under the terms of the GNU General Public License v2 |
155 |
+# $Id$ |
156 |
+ |
157 |
+EAPI=5 |
158 |
+ |
159 |
+DESCRIPTION="Fast, dense and secure container management" |
160 |
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/" |
161 |
+EGO_PN_PARENT="github.com/lxc" |
162 |
+EGO_PN="${EGO_PN_PARENT}/lxd" |
163 |
+SRC_URI="http://961db08fe45d5f5dd062-b8a7a040508aea6d369676e49b80719d.r29.cf2.rackcdn.com/${P}.tar.bz2" |
164 |
+LICENSE="Apache-2.0" |
165 |
+SLOT="0" |
166 |
+KEYWORDS="~amd64" |
167 |
+ |
168 |
+PLOCALES="de fr ja" |
169 |
+IUSE="btrfs +criu +daemon lvm nls test" |
170 |
+ |
171 |
+# IUSE and PLOCALES must be defined before l10n inherited |
172 |
+inherit bash-completion-r1 eutils golang-build l10n systemd user vcs-snapshot |
173 |
+ |
174 |
+DEPEND=" |
175 |
+ dev-go/go-crypto |
176 |
+ >=dev-lang/go-1.4.2:= |
177 |
+ dev-libs/protobuf |
178 |
+ dev-vcs/git |
179 |
+ nls? ( sys-devel/gettext ) |
180 |
+ test? ( |
181 |
+ app-misc/jq |
182 |
+ dev-db/sqlite |
183 |
+ net-misc/curl |
184 |
+ sys-devel/gettext |
185 |
+ ) |
186 |
+" |
187 |
+ |
188 |
+RDEPEND=" |
189 |
+ daemon? ( |
190 |
+ app-admin/cgmanager |
191 |
+ app-arch/xz-utils |
192 |
+ app-emulation/lxc[cgmanager,seccomp] |
193 |
+ net-analyzer/openbsd-netcat |
194 |
+ net-misc/bridge-utils |
195 |
+ net-misc/rsync[xattr] |
196 |
+ sys-apps/iproute2 |
197 |
+ virtual/acl |
198 |
+ btrfs? ( |
199 |
+ sys-fs/btrfs-progs |
200 |
+ ) |
201 |
+ criu? ( |
202 |
+ sys-process/criu |
203 |
+ ) |
204 |
+ lvm? ( |
205 |
+ sys-fs/lvm2 |
206 |
+ ) |
207 |
+ ) |
208 |
+" |
209 |
+ |
210 |
+# KNOWN ISSUES: |
211 |
+# - Translations may not work. I've been unsuccessful in forcing |
212 |
+# localized output. Anyway, upstream (Canonical) doesn't install the |
213 |
+# message files. |
214 |
+ |
215 |
+# TODO: |
216 |
+# - since 0.15 gccgo is a supported compiler ('make gccgo'). It would |
217 |
+# be preferable for that support to go into the golang-build eclass not |
218 |
+# this package directly. |
219 |
+# - Add apparmor USE. There are some exec calls to apparmor_parser |
220 |
+# - Test build with Go 1.4 & 1.5 |
221 |
+# - integrate "lxd shutdown" into initscript as custom action (default "stop" |
222 |
+# action should _not_ stop containers amirite?) |
223 |
+# "Perform a clean shutdown of LXD and all running containers" |
224 |
+ |
225 |
+src_prepare() { |
226 |
+ cd "${S}/src/${EGO_PN}" |
227 |
+ |
228 |
+ epatch "${FILESDIR}/${P}-dont-go-get.patch" |
229 |
+ |
230 |
+ # Upstream requires the openbsd flavor of netcat (with -U), but |
231 |
+ # Gentoo installs that with a renamed binary |
232 |
+ epatch "${FILESDIR}/${P}-nc-binary-name.patch" |
233 |
+ |
234 |
+ # Warn on unhandled locale changes |
235 |
+ l10n_find_plocales_changes po "" .po |
236 |
+} |
237 |
+ |
238 |
+src_compile() { |
239 |
+ golang-build_src_compile |
240 |
+ |
241 |
+ cd "${S}/src/${EGO_PN}" |
242 |
+ |
243 |
+ if use daemon; then |
244 |
+ # Build binaries |
245 |
+ GOPATH="${S}:$(get_golibdir_gopath)" emake |
246 |
+ else |
247 |
+ # build client tool |
248 |
+ GOPATH="${S}:$(get_golibdir_gopath)" emake client |
249 |
+ fi |
250 |
+ |
251 |
+ use nls && emake build-mo |
252 |
+} |
253 |
+ |
254 |
+src_test() { |
255 |
+ if use daemon; then |
256 |
+ # Go native tests should succeed |
257 |
+ golang-build_src_test |
258 |
+ fi |
259 |
+} |
260 |
+ |
261 |
+src_install() { |
262 |
+ # Installs all src,pkg to /usr/lib/go-gentoo |
263 |
+ golang-build_src_install |
264 |
+ |
265 |
+ cd "${S}" |
266 |
+ dobin bin/lxc |
267 |
+ if use daemon; then |
268 |
+ dobin bin/fuidshift |
269 |
+ |
270 |
+ dosbin bin/lxd |
271 |
+ fi |
272 |
+ |
273 |
+ cd "src/${EGO_PN}" |
274 |
+ |
275 |
+ if use nls; then |
276 |
+ for lingua in ${PLOCALES}; do |
277 |
+ if use linguas_${lingua}; then |
278 |
+ domo po/${lingua}.mo |
279 |
+ fi |
280 |
+ done |
281 |
+ fi |
282 |
+ |
283 |
+ if use daemon; then |
284 |
+ newinitd "${FILESDIR}"/${P}.initd lxd |
285 |
+ newconfd "${FILESDIR}"/${P}.confd lxd |
286 |
+ |
287 |
+ systemd_dounit "${FILESDIR}"/lxd.service |
288 |
+ fi |
289 |
+ |
290 |
+ newbashcomp config/bash/lxc.in lxc |
291 |
+ |
292 |
+ dodoc AUTHORS CONTRIBUTING.md README.md |
293 |
+ |
294 |
+ docinto specs |
295 |
+ dodoc specs/* |
296 |
+} |
297 |
+ |
298 |
+pkg_postinst() { |
299 |
+ einfo |
300 |
+ einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information," |
301 |
+ einfo "including a Quick Start." |
302 |
+ |
303 |
+ # The messaging below only applies to daemon installs |
304 |
+ use daemon || return 0 |
305 |
+ |
306 |
+ # The control socket will be owned by (and writeable by) this group. |
307 |
+ enewgroup lxd |
308 |
+ |
309 |
+ # Ubuntu also defines an lxd user but it appears unused (the daemon |
310 |
+ # must run as root) |
311 |
+ |
312 |
+ if test -n "${REPLACING_VERSIONS}"; then |
313 |
+ einfo |
314 |
+ einfo "If you are upgrading from version 0.14 or older, note that the --tcp" |
315 |
+ einfo "is no longer available in /etc/conf.d/lxd. Instead, configure the" |
316 |
+ einfo "listen address/port by setting the core.https_address server option." |
317 |
+ fi |
318 |
+} |
319 |
|
320 |
diff --git a/app-emulation/lxd/metadata.xml b/app-emulation/lxd/metadata.xml |
321 |
index c49dbec..46d6c90 100644 |
322 |
--- a/app-emulation/lxd/metadata.xml |
323 |
+++ b/app-emulation/lxd/metadata.xml |
324 |
@@ -19,6 +19,10 @@ |
325 |
<remote-id type="github">lxc/lxd</remote-id> |
326 |
</upstream> |
327 |
<use> |
328 |
+ <flag name="btrfs"> |
329 |
+ Add support for managing instance/snapshot |
330 |
+ disk using btrfs subvolumes |
331 |
+ </flag> |
332 |
<flag name="criu"> |
333 |
Add support for live-migrateable containers |
334 |
</flag> |