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: Tue, 12 Jul 2016 23:54:59
Message-Id: 1468367659.42357c55b8c39c4b8b763b03e8f51b089e82590f.stasibear@gentoo
1 commit: 42357c55b8c39c4b8b763b03e8f51b089e82590f
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 12 23:54:19 2016 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 12 23:54:19 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42357c55
7
8 app-emulation/lxd: Bump to 2.0.3
9
10 EAPI=6
11
12 Package-Manager: portage-2.3.0
13
14 app-emulation/lxd/Manifest | 1 +
15 .../lxd/files/lxd-2.0.3-dont-go-get.patch | 22 +++
16 app-emulation/lxd/files/lxd-2.0.3.confd | 27 ++++
17 app-emulation/lxd/files/lxd-2.0.3.initd | 50 +++++++
18 app-emulation/lxd/lxd-2.0.3.ebuild | 155 +++++++++++++++++++++
19 5 files changed, 255 insertions(+)
20
21 diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
22 index 072650a..8abc29c 100644
23 --- a/app-emulation/lxd/Manifest
24 +++ b/app-emulation/lxd/Manifest
25 @@ -3,3 +3,4 @@ DIST lxd-2.0.0_beta4.tar.bz2 2291955 SHA256 6487750275e21ab3e862ea56807b9fcf28e9
26 DIST lxd-2.0.0_rc2.tar.bz2 2306077 SHA256 d74babbd5c537430a574a13c0f70c7633affc9bbd0e21bf0039872bdfb801fe9 SHA512 6a21620e19277293a3b665d4061f5aa9443d1a9a5ab88fa885096ff77acf828b215e247136bb99ea1ba230f015181bc9a86a919664c9288577509a2146a5aa66 WHIRLPOOL f88e0f3b5ecd9803bc8baee864ffbdf33b39f331a5e5ceb170b2792d2e26b6f4faae3a8cc6aae090e81accd3835408f2956a117095bc790ca7c16cd7f21d205e
27 DIST lxd-2.0.1.tar.bz2 2330217 SHA256 b9a315825bfc66469a442f3b3da73e2af97dba270ffe1bc18c871cd6c1c7ad69 SHA512 67b1c42a0957bd2f4963c860372211dbbc38cb8e9346e83c6319749efd9e1a188c00033865901d285650298531460b9f54cba0e88d0973179c0c17bcd30cc97d WHIRLPOOL 4ae640fc6410dff9d08816a6ac7ddb47a4cce9dfbbfaa65baf8456517aca25a501b0e680d9a6855a0fa3b9efe8cd1eddb0a9981d43de9ef573c16be936f5104a
28 DIST lxd-2.0.2.tar.bz2 2340565 SHA256 0054b0e79ba0bc1a1189eb63ca8ac2ca2bafd10c500ce53f67abbd5abc03b542 SHA512 c79f1c7f0aeb289ba7bea745917aaac0d339baf0e6b4fe62cbcb67b8da072ef135e971d4c17546e2e208aeae921ad2853073493f9e7a6e300876bd72b808e516 WHIRLPOOL a30bddfc79ad0c7d941db811f1942fff67afc79a217a251d55b1cf37d80cdb21f8f1f72df268382cbcd34d408005ef4185f5bd59f95369b51558938352f05c60
29 +DIST lxd-2.0.3.tar.bz2 2349842 SHA256 fb8a56e08da776f5210970a12e61b2e7b751328b5628e6fbebde231952b907a9 SHA512 62ac76bee0ff151343d0686da9376ff16965af5de19b50055bad86461dc2dd8e06544ee39640537f8352ec03b584ed32cf70cce9c7c961285d9ea567c617330e WHIRLPOOL 60204498c0a104310ddb28e42ea8889830c2f0e8c830c683b51d5cdbc92380de7c7964961fc7a34b32c7cb4dccaa4222f017b0d8948f54d5044770c066141319
30
31 diff --git a/app-emulation/lxd/files/lxd-2.0.3-dont-go-get.patch b/app-emulation/lxd/files/lxd-2.0.3-dont-go-get.patch
32 new file mode 100644
33 index 0000000..9402de5
34 --- /dev/null
35 +++ b/app-emulation/lxd/files/lxd-2.0.3-dont-go-get.patch
36 @@ -0,0 +1,22 @@
37 +--- /Makefile.orig 2016-07-11 23:34:40.299664675 +0000
38 ++++ /Makefile 2016-07-11 23:37:00.816018727 +0000
39 +@@ -12,19 +12,11 @@
40 +
41 + .PHONY: default
42 + default:
43 +- # Must a few times due to go get race
44 +- -go get -t -v -d ./...
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 a few times due to go get race
53 +- -go get -t -v -d ./...
54 +- -go get -t -v -d ./...
55 +- -go get -t -v -d ./...
56 + go install -v $(DEBUG) ./lxc
57 + @echo "LXD client built successfully"
58 +
59
60 diff --git a/app-emulation/lxd/files/lxd-2.0.3.confd b/app-emulation/lxd/files/lxd-2.0.3.confd
61 new file mode 100644
62 index 0000000..3d55327
63 --- /dev/null
64 +++ b/app-emulation/lxd/files/lxd-2.0.3.confd
65 @@ -0,0 +1,27 @@
66 +# Group which owns the shared socket
67 +LXD_OPTIONS+=" --group lxd"
68 +
69 +
70 +
71 +# Enable cpu profiling into the specified file
72 +#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile"
73 +
74 +# Enable memory profiling into the specified file
75 +#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile"
76 +
77 +
78 +
79 +# Enables debug mode
80 +#LXD_OPTIONS+=" --debug"
81 +
82 +# For debugging, print a complete stack trace every n seconds
83 +#LXD_OPTIONS+=" --print-goroutines-every 5"
84 +
85 +# Enables verbose mode
86 +#LXD_OPTIONS+=" -v"
87 +
88 +# Logfile to log to
89 +#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log"
90 +
91 +# Enables syslog logging
92 +#LXD_OPTIONS+=" --syslog"
93
94 diff --git a/app-emulation/lxd/files/lxd-2.0.3.initd b/app-emulation/lxd/files/lxd-2.0.3.initd
95 new file mode 100644
96 index 0000000..c1aef37
97 --- /dev/null
98 +++ b/app-emulation/lxd/files/lxd-2.0.3.initd
99 @@ -0,0 +1,50 @@
100 +#!/sbin/openrc-run
101 +# Copyright 1999-2016 Gentoo Foundation
102 +# Distributed under the terms of the GNU General Public License v2
103 +# $Id$
104 +
105 +DAEMON=/usr/sbin/lxd
106 +PIDFILE=/run/lxd.pid
107 +
108 +extra_commands="stopall"
109 +
110 +depend() {
111 + need net
112 + use lxcfs
113 +
114 + # remove with 2.0 release
115 + need cgmanager
116 +}
117 +
118 +start() {
119 + ebegin "Starting lxd server"
120 +
121 + start-stop-daemon --start \
122 + --pidfile ${PIDFILE} \
123 + --exec ${DAEMON} \
124 + --background \
125 + --make-pidfile \
126 + -- \
127 + ${LXD_OPTIONS}
128 +
129 + eend $?
130 +}
131 +
132 +stop() {
133 + if [[ $RC_GOINGDOWN = YES ]] || [[ $RC_REBOOT = YES ]]; then
134 + stopall
135 + else
136 + ebegin "Stopping lxd service (but not containers)"
137 + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
138 + eend $?
139 + fi
140 +}
141 +
142 +stopall() {
143 + ebegin "Stopping lxd service and containers"
144 + if "${DAEMON}" shutdown; then
145 + /etc/init.d/lxd zap
146 + rm -f ${PIDFILE}
147 + fi
148 + eend $?
149 +}
150
151 diff --git a/app-emulation/lxd/lxd-2.0.3.ebuild b/app-emulation/lxd/lxd-2.0.3.ebuild
152 new file mode 100644
153 index 0000000..e45469a
154 --- /dev/null
155 +++ b/app-emulation/lxd/lxd-2.0.3.ebuild
156 @@ -0,0 +1,155 @@
157 +# Copyright 1999-2016 Gentoo Foundation
158 +# Distributed under the terms of the GNU General Public License v2
159 +# $Id$
160 +
161 +EAPI=6
162 +
163 +DESCRIPTION="Fast, dense and secure container management"
164 +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
165 +EGO_PN_PARENT="github.com/lxc"
166 +EGO_PN="${EGO_PN_PARENT}/lxd"
167 +
168 +# The source is repackaged using a script at:
169 +# https://dev.gentoo.org/~stasibear/lxd_repackage.py
170 +# This is necessary because go's native package management assumes
171 +# that a build starts with checking out many git repositories, often
172 +# from HEAD. This provides no way to build the same code repeatably,
173 +# and anyway portage requires that fetching is only done from SRC_URI.
174 +# The only sane alternative I've seen is in the consul ebuild, which
175 +# is more transparent but raises other questions.
176 +SRC_URI="https://dev.gentoo.org/~stasibear/distfiles/${P}.tar.bz2"
177 +
178 +LICENSE="Apache-2.0"
179 +SLOT="0"
180 +KEYWORDS="~amd64"
181 +
182 +PLOCALES="de fr ja"
183 +IUSE="+daemon nls test"
184 +
185 +# IUSE and PLOCALES must be defined before l10n inherited
186 +inherit bash-completion-r1 golang-build l10n systemd user vcs-snapshot
187 +
188 +DEPEND="
189 + dev-go/go-crypto
190 + dev-libs/protobuf
191 + nls? ( sys-devel/gettext )
192 + test? (
193 + app-misc/jq
194 + dev-db/sqlite
195 + net-misc/curl
196 + sys-devel/gettext
197 + )
198 +"
199 +
200 +RDEPEND="
201 + daemon? (
202 + app-admin/cgmanager
203 + app-arch/xz-utils
204 + app-emulation/lxc[cgmanager,seccomp]
205 + net-misc/rsync[xattr]
206 + sys-apps/iproute2
207 + virtual/acl
208 + )
209 +"
210 +
211 +PATCHES=("${FILESDIR}/${P}-dont-go-get.patch")
212 +
213 +# KNOWN ISSUES:
214 +# - Translations may not work. I've been unsuccessful in forcing
215 +# localized output. Anyway, upstream (Canonical) doesn't install the
216 +# message files.
217 +
218 +src_prepare() {
219 + cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir"
220 +
221 + default_src_prepare
222 +
223 + tmpgoroot="${T}/goroot"
224 + mkdir -p "$tmpgoroot" || die "Failed to create temporary GOROOT"
225 + cp -sR "$(get_golibdir_gopath)"/* "${tmpgoroot}" || die "Failed to copy files to temporary GOROOT"
226 +
227 + # Warn on unhandled locale changes
228 + l10n_find_plocales_changes po "" .po
229 +}
230 +
231 +src_compile() {
232 + golang-build_src_compile
233 +
234 + cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir"
235 +
236 + tmpgoroot="${T}/goroot"
237 + if use daemon; then
238 + # Build binaries
239 + GOPATH="${S}:${tmpgoroot}" emake
240 + else
241 + # build client tool
242 + GOPATH="${S}:${tmpgoroot}" emake client
243 + fi
244 +
245 + use nls && emake build-mo
246 +}
247 +
248 +src_test() {
249 + if use daemon; then
250 + # Go native tests should succeed
251 + golang-build_src_test
252 + fi
253 +}
254 +
255 +src_install() {
256 + # Installs all src,pkg to /usr/lib/go-gentoo
257 + golang-build_src_install
258 +
259 + cd "${S}"
260 + dobin bin/lxc
261 + use daemon && dosbin bin/lxd
262 +
263 + cd "src/${EGO_PN}"
264 +
265 + if use nls; then
266 + for lingua in ${PLOCALES}; do
267 + if use linguas_${lingua}; then
268 + domo po/${lingua}.mo
269 + fi
270 + done
271 + fi
272 +
273 + if use daemon; then
274 + newinitd "${FILESDIR}"/${P}.initd lxd
275 + newconfd "${FILESDIR}"/${P}.confd lxd
276 +
277 + systemd_dounit "${FILESDIR}"/lxd.service
278 + fi
279 +
280 + newbashcomp config/bash/lxd-client lxc
281 +
282 + dodoc AUTHORS CONTRIBUTING.md README.md doc/*
283 +}
284 +
285 +pkg_postinst() {
286 + einfo
287 + einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
288 + einfo "including a Quick Start."
289 +
290 + # The messaging below only applies to daemon installs
291 + use daemon || return 0
292 +
293 + # The control socket will be owned by (and writeable by) this group.
294 + enewgroup lxd
295 +
296 + # Ubuntu also defines an lxd user but it appears unused (the daemon
297 + # must run as root)
298 +
299 + einfo
300 + einfo "Though not strictly required, some features are enabled at run-time"
301 + einfo "when the relevant helper programs are detected:"
302 + einfo "- sys-apps/apparmor"
303 + einfo "- sys-fs/btrfs-progs"
304 + einfo "- sys-fs/lvm2"
305 + einfo "- sys-fs/lxcfs"
306 + einfo "- sys-fs/zfs"
307 + einfo "- sys-process/criu"
308 + einfo
309 + einfo "Since these features can't be disabled at build-time they are"
310 + einfo "not USE-conditional."
311 +}