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