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