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/files/, app-emulation/lxd/
Date: Mon, 25 Jan 2016 00:07:32
Message-Id: 1453680470.8e819fd7ae98168a28cfb9adfc759a13a13e195e.stasibear@gentoo
1 commit: 8e819fd7ae98168a28cfb9adfc759a13a13e195e
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 25 00:07:18 2016 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 25 00:07:50 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e819fd7
7
8 app-emulation/lxd: bump to 0.27
9
10 Package-Manager: portage-2.2.26
11
12 app-emulation/lxd/Manifest | 1 +
13 app-emulation/lxd/files/lxd-0.27-dont-go-get.patch | 20 +++
14 .../lxd/files/lxd-0.27-nc-binary-name.patch | 11 ++
15 app-emulation/lxd/files/lxd-0.27.confd | 27 ++++
16 app-emulation/lxd/files/lxd-0.27.initd | 50 +++++++
17 app-emulation/lxd/lxd-0.27.ebuild | 157 +++++++++++++++++++++
18 6 files changed, 266 insertions(+)
19
20 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
21 index 6711b5b..8a6cfa6 100644
22 --- a/app-emulation/lxd/Manifest
23 +++ b/app-emulation/lxd/Manifest
24 @@ -1,3 +1,4 @@
25 DIST lxd-0.24.tar.bz2 1973022 SHA256 e3851bded0f2639e4aec9c63797135bfa3b27def17123c8e506c784b1ab4c99a SHA512 e7593136fd1fb13542a8415d964ff3bab8bcc7f7a7d806874e7c21fd9d96652aa5716a9d3318cea3d849a19aa96b40bfea27f4edd528c8307efaeeac88971f2e WHIRLPOOL 69b6722a25c9e75e533436a37951dc893cbf3d3c0f5d31b3ccc2cf0a7dede9cf16c53e68562348ab9bf9e621421030b826df21e5fb32df8a496127601fa5d898
26 DIST lxd-0.25.tar.bz2 1983043 SHA256 1cfdf1a5e8638060e2368e9e5cf8763406857309f08c4668fa0756e85ba7b89e SHA512 001e52826a3bbe00121115ddace14b3f552321f16e97700763ff6dd23b5babd3c1393cbc9b9b263b6a18c31e49c30d612e3d7153d4987644689989be0be50d00 WHIRLPOOL 496f3f19c50c1ee79ba8b5625cf34b6f57683f4066a09b3edc2cbd017cc5ebc2cc7ac9e569c94bcba0d699c6efb722b79ae43541e0dfddc2fb8d877131519b06
27 DIST lxd-0.26.tar.bz2 1985288 SHA256 71079140946e3e66563cc3025c3e4f756fd45cc413af1d5396c56a608427d0aa SHA512 25aa73274b03163698646fe2f49c2401ae93a9b90be46f0ba0414521bc920e68c61db7e6617d75a19675e22a705afd5d3220e24a518e30819daf3dc75670b900 WHIRLPOOL d59471f02744efbe3d3dbb1ae32dcf17141f8414a1614535451e75c5422928d3c5d54dceebcf0d829f7395ae3cb49bf424ff7999d1e32b9384a3f81b3d3ab01e
28 +DIST lxd-0.27.tar.bz2 2247266 SHA256 290d05a792f2f146b302d500eadd3168822ed99aecb4ea96762570580f29910a SHA512 37d5fef677a943dc7e84c73836aa1d4e5f0353c165aa33cefcd87dcd1fdae574760e74fb290404182badfee96e04ef929a81d6633d2c0f91c458ccd19996b9c3 WHIRLPOOL d1d0c0fad0e604f41482c133f4425461546599aded2e948d5c58f7698eba963746ac8c3c3085ffbd244b0169cedb26ad8ec5d85babea6aa9a7688ee6ce342589
29
30 diff --git a/app-emulation/lxd/files/lxd-0.27-dont-go-get.patch b/app-emulation/lxd/files/lxd-0.27-dont-go-get.patch
31 new file mode 100644
32 index 0000000..9964af6
33 --- /dev/null
34 +++ b/app-emulation/lxd/files/lxd-0.27-dont-go-get.patch
35 @@ -0,0 +1,20 @@
36 +--- Makefile.orig 2015-12-28 19:23:28.425122306 -0600
37 ++++ Makefile 2015-12-28 19:25:09.482123654 -0600
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 ./...
46 + @echo "LXD built succesfuly"
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 ./lxc
54 + @echo "LXD client built succesfuly"
55 +
56
57 diff --git a/app-emulation/lxd/files/lxd-0.27-nc-binary-name.patch b/app-emulation/lxd/files/lxd-0.27-nc-binary-name.patch
58 new file mode 100644
59 index 0000000..7373b66
60 --- /dev/null
61 +++ b/app-emulation/lxd/files/lxd-0.27-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-0.27.confd b/app-emulation/lxd/files/lxd-0.27.confd
76 new file mode 100644
77 index 0000000..3d55327
78 --- /dev/null
79 +++ b/app-emulation/lxd/files/lxd-0.27.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-0.27.initd b/app-emulation/lxd/files/lxd-0.27.initd
110 new file mode 100644
111 index 0000000..ec23258
112 --- /dev/null
113 +++ b/app-emulation/lxd/files/lxd-0.27.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-0.27.ebuild b/app-emulation/lxd/lxd-0.27.ebuild
167 new file mode 100644
168 index 0000000..ba679e3
169 --- /dev/null
170 +++ b/app-emulation/lxd/lxd-0.27.ebuild
171 @@ -0,0 +1,157 @@
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 + # Warn on unhandled locale changes
243 + l10n_find_plocales_changes po "" .po
244 +}
245 +
246 +src_compile() {
247 + golang-build_src_compile
248 +
249 + cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir"
250 +
251 + if use daemon; then
252 + # Build binaries
253 + GOPATH="${S}:$(get_golibdir_gopath)" emake
254 + else
255 + # build client tool
256 + GOPATH="${S}:$(get_golibdir_gopath)" emake client
257 + fi
258 +
259 + use nls && emake build-mo
260 +}
261 +
262 +src_test() {
263 + if use daemon; then
264 + # Go native tests should succeed
265 + golang-build_src_test
266 + fi
267 +}
268 +
269 +src_install() {
270 + # Installs all src,pkg to /usr/lib/go-gentoo
271 + golang-build_src_install
272 +
273 + cd "${S}"
274 + dobin bin/lxc
275 + use daemon && dosbin bin/lxd
276 +
277 + cd "src/${EGO_PN}"
278 +
279 + if use nls; then
280 + for lingua in ${PLOCALES}; do
281 + if use linguas_${lingua}; then
282 + domo po/${lingua}.mo
283 + fi
284 + done
285 + fi
286 +
287 + if use daemon; then
288 + newinitd "${FILESDIR}"/${P}.initd lxd
289 + newconfd "${FILESDIR}"/${P}.confd lxd
290 +
291 + systemd_dounit "${FILESDIR}"/lxd.service
292 + fi
293 +
294 + newbashcomp config/bash/lxd-client lxc
295 +
296 + dodoc AUTHORS CONTRIBUTING.md README.md
297 +
298 + docinto specs
299 + dodoc specs/*
300 +}
301 +
302 +pkg_postinst() {
303 + einfo
304 + einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
305 + einfo "including a Quick Start."
306 +
307 + # The messaging below only applies to daemon installs
308 + use daemon || return 0
309 +
310 + # The control socket will be owned by (and writeable by) this group.
311 + enewgroup lxd
312 +
313 + # Ubuntu also defines an lxd user but it appears unused (the daemon
314 + # must run as root)
315 +
316 + einfo
317 + einfo "Though not strictly required, some features are enabled at run-time"
318 + einfo "when the relevant helper programs are detected:"
319 + einfo "- sys-apps/apparmor"
320 + einfo "- sys-fs/btrfs-progs"
321 + einfo "- sys-fs/lvm2"
322 + einfo "- sys-fs/lxcfs"
323 + einfo "- sys-fs/zfs"
324 + einfo "- sys-process/criu"
325 + einfo
326 + einfo "Since these features can't be disabled at build-time they are"
327 + einfo "not USE-conditional."
328 +}