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/
Date: Thu, 14 Jul 2016 02:48:45
Message-Id: 1468464507.6a9a664ec93efaf354150dd22c07eceb1ff427b0.stasibear@gentoo
1 commit: 6a9a664ec93efaf354150dd22c07eceb1ff427b0
2 Author: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 14 02:48:27 2016 +0000
4 Commit: Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 14 02:48:27 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a9a664e
7
8 app-emulation/lxd: Revbump to add missing dep
9
10 Gentoo-bug: 588754
11
12 Package-Manager: portage-2.3.0
13
14 app-emulation/lxd/lxd-2.0.3-r1.ebuild | 156 ++++++++++++++++++++++++++++++++++
15 1 file changed, 156 insertions(+)
16
17 diff --git a/app-emulation/lxd/lxd-2.0.3-r1.ebuild b/app-emulation/lxd/lxd-2.0.3-r1.ebuild
18 new file mode 100644
19 index 0000000..b5754f1
20 --- /dev/null
21 +++ b/app-emulation/lxd/lxd-2.0.3-r1.ebuild
22 @@ -0,0 +1,156 @@
23 +# Copyright 1999-2016 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +# $Id$
26 +
27 +EAPI=6
28 +
29 +DESCRIPTION="Fast, dense and secure container management"
30 +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
31 +EGO_PN_PARENT="github.com/lxc"
32 +EGO_PN="${EGO_PN_PARENT}/lxd"
33 +
34 +# The source is repackaged using a script at:
35 +# https://dev.gentoo.org/~stasibear/lxd_repackage.py
36 +# This is necessary because go's native package management assumes
37 +# that a build starts with checking out many git repositories, often
38 +# from HEAD. This provides no way to build the same code repeatably,
39 +# and anyway portage requires that fetching is only done from SRC_URI.
40 +# The only sane alternative I've seen is in the consul ebuild, which
41 +# is more transparent but raises other questions.
42 +SRC_URI="https://dev.gentoo.org/~stasibear/distfiles/${P}.tar.bz2"
43 +
44 +LICENSE="Apache-2.0"
45 +SLOT="0"
46 +KEYWORDS="~amd64"
47 +
48 +PLOCALES="de fr ja"
49 +IUSE="+daemon nls test"
50 +
51 +# IUSE and PLOCALES must be defined before l10n inherited
52 +inherit bash-completion-r1 golang-build l10n systemd user vcs-snapshot
53 +
54 +DEPEND="
55 + dev-go/go-crypto
56 + dev-libs/protobuf
57 + nls? ( sys-devel/gettext )
58 + test? (
59 + app-misc/jq
60 + dev-db/sqlite
61 + net-misc/curl
62 + sys-devel/gettext
63 + )
64 +"
65 +
66 +RDEPEND="
67 + daemon? (
68 + app-admin/cgmanager
69 + app-arch/xz-utils
70 + app-emulation/lxc[cgmanager,seccomp]
71 + net-misc/rsync[xattr]
72 + sys-apps/iproute2
73 + sys-fs/squashfs-tools
74 + virtual/acl
75 + )
76 +"
77 +
78 +PATCHES=("${FILESDIR}/${P}-dont-go-get.patch")
79 +
80 +# KNOWN ISSUES:
81 +# - Translations may not work. I've been unsuccessful in forcing
82 +# localized output. Anyway, upstream (Canonical) doesn't install the
83 +# message files.
84 +
85 +src_prepare() {
86 + cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir"
87 +
88 + default_src_prepare
89 +
90 + tmpgoroot="${T}/goroot"
91 + mkdir -p "$tmpgoroot" || die "Failed to create temporary GOROOT"
92 + cp -sR "$(get_golibdir_gopath)"/* "${tmpgoroot}" || die "Failed to copy files to temporary GOROOT"
93 +
94 + # Warn on unhandled locale changes
95 + l10n_find_plocales_changes po "" .po
96 +}
97 +
98 +src_compile() {
99 + golang-build_src_compile
100 +
101 + cd "${S}/src/${EGO_PN}" || die "Failed to change to deep src dir"
102 +
103 + tmpgoroot="${T}/goroot"
104 + if use daemon; then
105 + # Build binaries
106 + GOPATH="${S}:${tmpgoroot}" emake
107 + else
108 + # build client tool
109 + GOPATH="${S}:${tmpgoroot}" emake client
110 + fi
111 +
112 + use nls && emake build-mo
113 +}
114 +
115 +src_test() {
116 + if use daemon; then
117 + # Go native tests should succeed
118 + golang-build_src_test
119 + fi
120 +}
121 +
122 +src_install() {
123 + # Installs all src,pkg to /usr/lib/go-gentoo
124 + golang-build_src_install
125 +
126 + cd "${S}"
127 + dobin bin/lxc
128 + use daemon && dosbin bin/lxd
129 +
130 + cd "src/${EGO_PN}"
131 +
132 + if use nls; then
133 + for lingua in ${PLOCALES}; do
134 + if use linguas_${lingua}; then
135 + domo po/${lingua}.mo
136 + fi
137 + done
138 + fi
139 +
140 + if use daemon; then
141 + newinitd "${FILESDIR}"/${P}.initd lxd
142 + newconfd "${FILESDIR}"/${P}.confd lxd
143 +
144 + systemd_dounit "${FILESDIR}"/lxd.service
145 + fi
146 +
147 + newbashcomp config/bash/lxd-client lxc
148 +
149 + dodoc AUTHORS CONTRIBUTING.md README.md doc/*
150 +}
151 +
152 +pkg_postinst() {
153 + einfo
154 + einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
155 + einfo "including a Quick Start."
156 +
157 + # The messaging below only applies to daemon installs
158 + use daemon || return 0
159 +
160 + # The control socket will be owned by (and writeable by) this group.
161 + enewgroup lxd
162 +
163 + # Ubuntu also defines an lxd user but it appears unused (the daemon
164 + # must run as root)
165 +
166 + einfo
167 + einfo "Though not strictly required, some features are enabled at run-time"
168 + einfo "when the relevant helper programs are detected:"
169 + einfo "- sys-apps/apparmor"
170 + einfo "- sys-fs/btrfs-progs"
171 + einfo "- sys-fs/lvm2"
172 + einfo "- sys-fs/lxcfs"
173 + einfo "- sys-fs/zfs"
174 + einfo "- sys-process/criu"
175 + einfo
176 + einfo "Since these features can't be disabled at build-time they are"
177 + einfo "not USE-conditional."
178 +}