1 |
commit: 590f0288cf5613f3d2cec07d41bac83f6894bf1a |
2 |
Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 19 03:12:29 2016 +0000 |
4 |
Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 19 03:13:18 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=590f0288 |
7 |
|
8 |
app-emulation/lxd: bump to 2.0.0_beta3 |
9 |
|
10 |
Package-Manager: portage-2.2.27 |
11 |
|
12 |
app-emulation/lxd/Manifest | 1 + |
13 |
.../lxd/files/lxd-2.0.0_beta3-dont-go-get.patch | 20 +++ |
14 |
.../lxd/files/lxd-2.0.0_beta3-nc-binary-name.patch | 11 ++ |
15 |
app-emulation/lxd/files/lxd-2.0.0_beta3.confd | 27 ++++ |
16 |
app-emulation/lxd/files/lxd-2.0.0_beta3.initd | 50 +++++++ |
17 |
app-emulation/lxd/lxd-2.0.0_beta3.ebuild | 162 +++++++++++++++++++++ |
18 |
6 files changed, 271 insertions(+) |
19 |
|
20 |
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest |
21 |
index d68b9fb..961359e 100644 |
22 |
--- a/app-emulation/lxd/Manifest |
23 |
+++ b/app-emulation/lxd/Manifest |
24 |
@@ -1,3 +1,4 @@ |
25 |
DIST lxd-0.26.tar.bz2 1985288 SHA256 71079140946e3e66563cc3025c3e4f756fd45cc413af1d5396c56a608427d0aa SHA512 25aa73274b03163698646fe2f49c2401ae93a9b90be46f0ba0414521bc920e68c61db7e6617d75a19675e22a705afd5d3220e24a518e30819daf3dc75670b900 WHIRLPOOL d59471f02744efbe3d3dbb1ae32dcf17141f8414a1614535451e75c5422928d3c5d54dceebcf0d829f7395ae3cb49bf424ff7999d1e32b9384a3f81b3d3ab01e |
26 |
DIST lxd-0.27.tar.bz2 2247266 SHA256 290d05a792f2f146b302d500eadd3168822ed99aecb4ea96762570580f29910a SHA512 37d5fef677a943dc7e84c73836aa1d4e5f0353c165aa33cefcd87dcd1fdae574760e74fb290404182badfee96e04ef929a81d6633d2c0f91c458ccd19996b9c3 WHIRLPOOL d1d0c0fad0e604f41482c133f4425461546599aded2e948d5c58f7698eba963746ac8c3c3085ffbd244b0169cedb26ad8ec5d85babea6aa9a7688ee6ce342589 |
27 |
DIST lxd-2.0.0_beta1.tar.bz2 2253384 SHA256 443d8004aea80a9295eeb28c81b930947163b5af5e7c5ec15e6123938268bd6c SHA512 21cc90e18173f832f7aa2f39762ba1c47ac54dbb947519302075d10f8c55cce766d436cb7f9ec96cb2fe538952b801398ce3b1320d878e8835d58e4fb3b81c86 WHIRLPOOL 85a11976fbf74f8b408c75aa7abf645d3e27eed3f82021fbcb7b2d8db95cc986fdf2cd6a38ef8749857027b380382e66678fb1f1656274159dbc2531c3860761 |
28 |
+DIST lxd-2.0.0_beta3.tar.bz2 2283443 SHA256 a3bdf6c081ebed01fcd1ae92a6d3ebf2e7d6ffea606fe3cb83559366e7dc90aa SHA512 3f80c1236ac9a92a350b4221478dd69eb2693672d73859738b691b9462155d0a907de90deab9950980500ab0faa5ec815bc6191cedf2d34d3757757f585570ec WHIRLPOOL 6d425c26ef37bc65871cf08946f0a80e5b9a3e01da5edd07605e94a2b418e6d2163ee90210c4439350000c35a18efa97102dcbab90ccd1577d6164b5b2e271b4 |
29 |
|
30 |
diff --git a/app-emulation/lxd/files/lxd-2.0.0_beta3-dont-go-get.patch b/app-emulation/lxd/files/lxd-2.0.0_beta3-dont-go-get.patch |
31 |
new file mode 100644 |
32 |
index 0000000..d2e622e |
33 |
--- /dev/null |
34 |
+++ b/app-emulation/lxd/files/lxd-2.0.0_beta3-dont-go-get.patch |
35 |
@@ -0,0 +1,20 @@ |
36 |
+--- Makefile.orig 2016-02-19 00:16:40.720102639 +0000 |
37 |
++++ Makefile 2016-02-19 00:18:10.886096473 +0000 |
38 |
+@@ -12,17 +12,11 @@ |
39 |
+ |
40 |
+ .PHONY: default |
41 |
+ default: |
42 |
+- # Must run twice due to go get race |
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 run twice due to go get race |
51 |
+- -go get -t -v -d ./... |
52 |
+- -go get -t -v -d ./... |
53 |
+ go install -v $(DEBUG) ./lxc |
54 |
+ @echo "LXD client built successfully" |
55 |
+ |
56 |
|
57 |
diff --git a/app-emulation/lxd/files/lxd-2.0.0_beta3-nc-binary-name.patch b/app-emulation/lxd/files/lxd-2.0.0_beta3-nc-binary-name.patch |
58 |
new file mode 100644 |
59 |
index 0000000..7373b66 |
60 |
--- /dev/null |
61 |
+++ b/app-emulation/lxd/files/lxd-2.0.0_beta3-nc-binary-name.patch |
62 |
@@ -0,0 +1,11 @@ |
63 |
+--- lxd/rsync.go.orig 2015-11-11 20:54:37.402700202 -0600 |
64 |
++++ lxd/rsync.go 2015-11-11 20:55:06.704698199 -0600 |
65 |
+@@ -91,7 +91,7 @@ |
66 |
+ * command (i.e. the command to run on --server). However, we're |
67 |
+ * hardcoding that at the other end, so we can just ignore it. |
68 |
+ */ |
69 |
+- rsyncCmd := fmt.Sprintf("sh -c \"nc -U %s\"", f.Name()) |
70 |
++ rsyncCmd := fmt.Sprintf("sh -c \"nc.openbsd -U %s\"", f.Name()) |
71 |
+ cmd := exec.Command( |
72 |
+ "rsync", |
73 |
+ "-arvP", |
74 |
|
75 |
diff --git a/app-emulation/lxd/files/lxd-2.0.0_beta3.confd b/app-emulation/lxd/files/lxd-2.0.0_beta3.confd |
76 |
new file mode 100644 |
77 |
index 0000000..3d55327 |
78 |
--- /dev/null |
79 |
+++ b/app-emulation/lxd/files/lxd-2.0.0_beta3.confd |
80 |
@@ -0,0 +1,27 @@ |
81 |
+# Group which owns the shared socket |
82 |
+LXD_OPTIONS+=" --group lxd" |
83 |
+ |
84 |
+ |
85 |
+ |
86 |
+# Enable cpu profiling into the specified file |
87 |
+#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile" |
88 |
+ |
89 |
+# Enable memory profiling into the specified file |
90 |
+#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile" |
91 |
+ |
92 |
+ |
93 |
+ |
94 |
+# Enables debug mode |
95 |
+#LXD_OPTIONS+=" --debug" |
96 |
+ |
97 |
+# For debugging, print a complete stack trace every n seconds |
98 |
+#LXD_OPTIONS+=" --print-goroutines-every 5" |
99 |
+ |
100 |
+# Enables verbose mode |
101 |
+#LXD_OPTIONS+=" -v" |
102 |
+ |
103 |
+# Logfile to log to |
104 |
+#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log" |
105 |
+ |
106 |
+# Enables syslog logging |
107 |
+#LXD_OPTIONS+=" --syslog" |
108 |
|
109 |
diff --git a/app-emulation/lxd/files/lxd-2.0.0_beta3.initd b/app-emulation/lxd/files/lxd-2.0.0_beta3.initd |
110 |
new file mode 100644 |
111 |
index 0000000..ec23258 |
112 |
--- /dev/null |
113 |
+++ b/app-emulation/lxd/files/lxd-2.0.0_beta3.initd |
114 |
@@ -0,0 +1,50 @@ |
115 |
+#!/sbin/runscript |
116 |
+# Copyright 1999-2015 Gentoo Foundation |
117 |
+# Distributed under the terms of the GNU General Public License v2 |
118 |
+# $Id$ |
119 |
+ |
120 |
+DAEMON=/usr/sbin/lxd |
121 |
+PIDFILE=/run/lxd.pid |
122 |
+ |
123 |
+extra_commands="stopall" |
124 |
+ |
125 |
+depend() { |
126 |
+ need net |
127 |
+ use lxcfs |
128 |
+ |
129 |
+ # remove with 2.0 release |
130 |
+ need cgmanager |
131 |
+} |
132 |
+ |
133 |
+start() { |
134 |
+ ebegin "Starting lxd server" |
135 |
+ |
136 |
+ start-stop-daemon --start \ |
137 |
+ --pidfile ${PIDFILE} \ |
138 |
+ --exec ${DAEMON} \ |
139 |
+ --background \ |
140 |
+ --make-pidfile \ |
141 |
+ -- \ |
142 |
+ ${LXD_OPTIONS} |
143 |
+ |
144 |
+ eend $? |
145 |
+} |
146 |
+ |
147 |
+stop() { |
148 |
+ if [[ $RC_GOINGDOWN = YES ]] || [[ $RC_REBOOT = YES ]]; then |
149 |
+ stopall |
150 |
+ else |
151 |
+ ebegin "Stopping lxd service (but not containers)" |
152 |
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} |
153 |
+ eend $? |
154 |
+ fi |
155 |
+} |
156 |
+ |
157 |
+stopall() { |
158 |
+ ebegin "Stopping lxd service and containers" |
159 |
+ if "${DAEMON}" shutdown; then |
160 |
+ /etc/init.d/lxd zap |
161 |
+ rm -f ${PIDFILE} |
162 |
+ fi |
163 |
+ eend $? |
164 |
+} |
165 |
|
166 |
diff --git a/app-emulation/lxd/lxd-2.0.0_beta3.ebuild b/app-emulation/lxd/lxd-2.0.0_beta3.ebuild |
167 |
new file mode 100644 |
168 |
index 0000000..f57f3fb |
169 |
--- /dev/null |
170 |
+++ b/app-emulation/lxd/lxd-2.0.0_beta3.ebuild |
171 |
@@ -0,0 +1,162 @@ |
172 |
+# Copyright 1999-2016 Gentoo Foundation |
173 |
+# Distributed under the terms of the GNU General Public License v2 |
174 |
+# $Id$ |
175 |
+ |
176 |
+EAPI=5 |
177 |
+ |
178 |
+DESCRIPTION="Fast, dense and secure container management" |
179 |
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/" |
180 |
+EGO_PN_PARENT="github.com/lxc" |
181 |
+EGO_PN="${EGO_PN_PARENT}/lxd" |
182 |
+SRC_URI="https://dev.gentoo.org/~stasibear/distfiles/${P}.tar.bz2" |
183 |
+LICENSE="Apache-2.0" |
184 |
+SLOT="0" |
185 |
+KEYWORDS="~amd64" |
186 |
+ |
187 |
+PLOCALES="de fr ja" |
188 |
+IUSE="+daemon nls test" |
189 |
+ |
190 |
+# IUSE and PLOCALES must be defined before l10n inherited |
191 |
+inherit bash-completion-r1 eutils golang-build l10n systemd user vcs-snapshot |
192 |
+ |
193 |
+# The compiler is forced in golang-base: |
194 |
+# DEPEND=">=dev-lang/go-1.4.2:=" |
195 |
+# ... so the dep is omitted here (and I disagree with := in this case) |
196 |
+ |
197 |
+DEPEND=" |
198 |
+ dev-go/go-crypto |
199 |
+ dev-libs/protobuf |
200 |
+ dev-vcs/git |
201 |
+ nls? ( sys-devel/gettext ) |
202 |
+ test? ( |
203 |
+ app-misc/jq |
204 |
+ dev-db/sqlite |
205 |
+ net-misc/curl |
206 |
+ sys-devel/gettext |
207 |
+ ) |
208 |
+" |
209 |
+ |
210 |
+RDEPEND=" |
211 |
+ daemon? ( |
212 |
+ app-admin/cgmanager |
213 |
+ app-arch/xz-utils |
214 |
+ app-emulation/lxc[cgmanager,seccomp] |
215 |
+ net-analyzer/openbsd-netcat |
216 |
+ net-misc/bridge-utils |
217 |
+ net-misc/rsync[xattr] |
218 |
+ sys-apps/iproute2 |
219 |
+ virtual/acl |
220 |
+ ) |
221 |
+" |
222 |
+ |
223 |
+# KNOWN ISSUES: |
224 |
+# - Translations may not work. I've been unsuccessful in forcing |
225 |
+# localized output. Anyway, upstream (Canonical) doesn't install the |
226 |
+# message files. |
227 |
+ |
228 |
+# TODO: |
229 |
+# - since 0.15 gccgo is a supported compiler ('make gccgo'). It would |
230 |
+# be preferable for that support to go into the golang-build eclass not |
231 |
+# this package directly. |
232 |
+ |
233 |
+src_prepare() { |
234 |
+ cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir" |
235 |
+ |
236 |
+ epatch "${FILESDIR}/${P}-dont-go-get.patch" |
237 |
+ |
238 |
+ # Upstream requires the openbsd flavor of netcat (with -U), but |
239 |
+ # Gentoo installs that with a renamed binary |
240 |
+ epatch "${FILESDIR}/${P}-nc-binary-name.patch" |
241 |
+ |
242 |
+ tmpgoroot="${T}/goroot" |
243 |
+ mkdir -p "$tmpgoroot" || die "Failed to create temporary GOROOT" |
244 |
+ cp -sR "$(get_golibdir_gopath)"/* "${tmpgoroot}" || die "Failed to copy files to temporary GOROOT" |
245 |
+ |
246 |
+ # Warn on unhandled locale changes |
247 |
+ l10n_find_plocales_changes po "" .po |
248 |
+} |
249 |
+ |
250 |
+src_compile() { |
251 |
+ golang-build_src_compile |
252 |
+ |
253 |
+ cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir" |
254 |
+ |
255 |
+ tmpgoroot="${T}/goroot" |
256 |
+ if use daemon; then |
257 |
+ # Build binaries |
258 |
+ GOPATH="${S}:${tmpgoroot}" emake |
259 |
+ else |
260 |
+ # build client tool |
261 |
+ GOPATH="${S}:${tmpgoroot}" emake client |
262 |
+ fi |
263 |
+ |
264 |
+ use nls && emake build-mo |
265 |
+} |
266 |
+ |
267 |
+src_test() { |
268 |
+ if use daemon; then |
269 |
+ # Go native tests should succeed |
270 |
+ golang-build_src_test |
271 |
+ fi |
272 |
+} |
273 |
+ |
274 |
+src_install() { |
275 |
+ # Installs all src,pkg to /usr/lib/go-gentoo |
276 |
+ golang-build_src_install |
277 |
+ |
278 |
+ cd "${S}" |
279 |
+ dobin bin/lxc |
280 |
+ use daemon && dosbin bin/lxd |
281 |
+ |
282 |
+ cd "src/${EGO_PN}" |
283 |
+ |
284 |
+ if use nls; then |
285 |
+ for lingua in ${PLOCALES}; do |
286 |
+ if use linguas_${lingua}; then |
287 |
+ domo po/${lingua}.mo |
288 |
+ fi |
289 |
+ done |
290 |
+ fi |
291 |
+ |
292 |
+ if use daemon; then |
293 |
+ newinitd "${FILESDIR}"/${P}.initd lxd |
294 |
+ newconfd "${FILESDIR}"/${P}.confd lxd |
295 |
+ |
296 |
+ systemd_dounit "${FILESDIR}"/lxd.service |
297 |
+ fi |
298 |
+ |
299 |
+ newbashcomp config/bash/lxd-client lxc |
300 |
+ |
301 |
+ dodoc AUTHORS CONTRIBUTING.md README.md |
302 |
+ |
303 |
+ docinto specs |
304 |
+ dodoc specs/* |
305 |
+} |
306 |
+ |
307 |
+pkg_postinst() { |
308 |
+ einfo |
309 |
+ einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information," |
310 |
+ einfo "including a Quick Start." |
311 |
+ |
312 |
+ # The messaging below only applies to daemon installs |
313 |
+ use daemon || return 0 |
314 |
+ |
315 |
+ # The control socket will be owned by (and writeable by) this group. |
316 |
+ enewgroup lxd |
317 |
+ |
318 |
+ # Ubuntu also defines an lxd user but it appears unused (the daemon |
319 |
+ # must run as root) |
320 |
+ |
321 |
+ einfo |
322 |
+ einfo "Though not strictly required, some features are enabled at run-time" |
323 |
+ einfo "when the relevant helper programs are detected:" |
324 |
+ einfo "- sys-apps/apparmor" |
325 |
+ einfo "- sys-fs/btrfs-progs" |
326 |
+ einfo "- sys-fs/lvm2" |
327 |
+ einfo "- sys-fs/lxcfs" |
328 |
+ einfo "- sys-fs/zfs" |
329 |
+ einfo "- sys-process/criu" |
330 |
+ einfo |
331 |
+ einfo "Since these features can't be disabled at build-time they are" |
332 |
+ einfo "not USE-conditional." |
333 |
+} |