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/, app-emulation/lxd/files/
Date: Tue, 29 Dec 2015 01:39:18
Message-Id: 1451353196.a1c15211641f24b83b7b22d748c4ffe3f75d71c6.stasibear@gentoo
1 commit: a1c15211641f24b83b7b22d748c4ffe3f75d71c6
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 29 01:39:56 2015 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 29 01:39:56 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1c15211
7
8 app-emulation/lxd: bump to 0.25
9
10 Package-Manager: portage-2.2.26
11
12 app-emulation/lxd/Manifest | 1 +
13 app-emulation/lxd/files/lxd-0.25-dont-go-get.patch | 20 +++
14 .../lxd/files/lxd-0.25-nc-binary-name.patch | 11 ++
15 app-emulation/lxd/files/lxd-0.25.confd | 27 ++++
16 app-emulation/lxd/files/lxd-0.25.initd | 50 +++++++
17 app-emulation/lxd/lxd-0.25.ebuild | 157 +++++++++++++++++++++
18 6 files changed, 266 insertions(+)
19
20 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
21 index 43dc501..e9f110b 100644
22 --- a/app-emulation/lxd/Manifest
23 +++ b/app-emulation/lxd/Manifest
24 @@ -1,3 +1,4 @@
25 DIST lxd-0.22.tar.bz2 2685133 SHA256 66dc30b82fba7f606658280d0dbac67a32152644a403ab00285fc3907b50082e SHA512 ab5384143edd03dfa1ef956c64e9fce2d845ce07c5388f719c202fd1ff9059282e104400f39f23ff1c4fefc8a23dd1d4c6c9094b497c40c659b087989bf07d44 WHIRLPOOL 27559c50f6aa55edb533046bb49b04784c63003569e7920261504a7b4c69891a80ff8432421352c13f274bb21876f2cf5266e9de2b1302d69e0254be87c17137
26 DIST lxd-0.23.tar.bz2 2606330 SHA256 06335bd15b00db2dec06114427b1d934fe1ac5271b85eb19074c508cb2466695 SHA512 2f73817c800c55c722a3017ee3064587c04730d5da9846b44be99b4541e739b466bcb7e924fcb18a15f1d49d010d471510378060530f6a15f6e60363b4d556b3 WHIRLPOOL 455b782ed2d21d5a720e06e356e1dd2115df174893e66710c74d02596deb8a66ff6e77b400f2ebeb047209b3bfed0927ff21a3a9f7cf9924719b84742f0eb5a7
27 DIST lxd-0.24.tar.bz2 1973022 SHA256 e3851bded0f2639e4aec9c63797135bfa3b27def17123c8e506c784b1ab4c99a SHA512 e7593136fd1fb13542a8415d964ff3bab8bcc7f7a7d806874e7c21fd9d96652aa5716a9d3318cea3d849a19aa96b40bfea27f4edd528c8307efaeeac88971f2e WHIRLPOOL 69b6722a25c9e75e533436a37951dc893cbf3d3c0f5d31b3ccc2cf0a7dede9cf16c53e68562348ab9bf9e621421030b826df21e5fb32df8a496127601fa5d898
28 +DIST lxd-0.25.tar.bz2 1983043 SHA256 1cfdf1a5e8638060e2368e9e5cf8763406857309f08c4668fa0756e85ba7b89e SHA512 001e52826a3bbe00121115ddace14b3f552321f16e97700763ff6dd23b5babd3c1393cbc9b9b263b6a18c31e49c30d612e3d7153d4987644689989be0be50d00 WHIRLPOOL 496f3f19c50c1ee79ba8b5625cf34b6f57683f4066a09b3edc2cbd017cc5ebc2cc7ac9e569c94bcba0d699c6efb722b79ae43541e0dfddc2fb8d877131519b06
29
30 diff --git a/app-emulation/lxd/files/lxd-0.25-dont-go-get.patch b/app-emulation/lxd/files/lxd-0.25-dont-go-get.patch
31 new file mode 100644
32 index 0000000..9964af6
33 --- /dev/null
34 +++ b/app-emulation/lxd/files/lxd-0.25-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.25-nc-binary-name.patch b/app-emulation/lxd/files/lxd-0.25-nc-binary-name.patch
58 new file mode 100644
59 index 0000000..7373b66
60 --- /dev/null
61 +++ b/app-emulation/lxd/files/lxd-0.25-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.25.confd b/app-emulation/lxd/files/lxd-0.25.confd
76 new file mode 100644
77 index 0000000..3d55327
78 --- /dev/null
79 +++ b/app-emulation/lxd/files/lxd-0.25.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.25.initd b/app-emulation/lxd/files/lxd-0.25.initd
110 new file mode 100644
111 index 0000000..ec23258
112 --- /dev/null
113 +++ b/app-emulation/lxd/files/lxd-0.25.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.25.ebuild b/app-emulation/lxd/lxd-0.25.ebuild
167 new file mode 100644
168 index 0000000..549dff5
169 --- /dev/null
170 +++ b/app-emulation/lxd/lxd-0.25.ebuild
171 @@ -0,0 +1,157 @@
172 +# Copyright 1999-2015 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/lxc.in 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 +}