Gentoo Archives: gentoo-commits

From: Kacper Kowalik <xarthisius@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/files/, app-emulation/docker/
Date: Tue, 24 Nov 2015 16:43:33
Message-Id: 1448383380.c32a35e8d8fea39c1445a6880656f850b110f4f7.xarthisius@gentoo
1 commit: c32a35e8d8fea39c1445a6880656f850b110f4f7
2 Author: mudler <mudler <AT> dark-lab <DOT> net>
3 AuthorDate: Sat Nov 21 11:52:18 2015 +0000
4 Commit: Kacper Kowalik <xarthisius <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 24 16:43:00 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c32a35e8
7
8 app-emulation/docker: version bump, fixes #566432
9
10 app-emulation/docker/Manifest | 1 +
11 app-emulation/docker/docker-1.9.1.ebuild | 265 +++++++++++++++++++++
12 .../docker/files/18074-disable-journald-arm.patch | 30 +++
13 3 files changed, 296 insertions(+)
14
15 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
16 index c36b331..5705368 100644
17 --- a/app-emulation/docker/Manifest
18 +++ b/app-emulation/docker/Manifest
19 @@ -4,3 +4,4 @@ DIST docker-1.7.1.tar.gz 6853527 SHA256 9cd26415d68a88d3cf576e7e78c2fe97f42af795
20 DIST docker-1.8.1.tar.gz 7562594 SHA256 7f22e88a994dc1bc143f87215de01ccd902450e6e8d747467d042a56db792b03 SHA512 6c015b236914da945d9e5bf2fed3e8a0a4d1e0c44ee02bf6edc04b2bb48b626353e37de45cd99c486b7ced70807e606d5eac2f1bdb3f8a7ba86cd9b71e4f5504 WHIRLPOOL 8d514fb309f0ddbb92bcf84f4d79320e18c26211536919bbed68888f5af77247f14f93239e5c890c5214cf0a9663acc48a45545a87227f0fe4bf8866ac7d7c5c
21 DIST docker-1.8.2.tar.gz 7563667 SHA256 457569ca8edd70293132789bfe51636f86cd8a46a60c6d02d5ee8600cf79f74b SHA512 c44f3cc0e0b7db463730620c0ec4b1aa1ea4a42f6528c891914318cb945aaa906e8eeaf91d32fb2d87a11ea1be428d1cf0de7d3ce4681c7db37390e4e1f79c67 WHIRLPOOL 2023f433ae25cc11fed6e4109a81dd949765daf342011f08a0ce8c1a8572ced595273ab78c45ac09abe895766c4443ff5a3219c5fce37725503bcdc39f49a947
22 DIST docker-1.9.0.tar.gz 7815144 SHA256 1c06baea61971a711f9e510800fb4de5e0d8a6560963cfdc891e0037b40dc974 SHA512 16c7fd900ff1122ccd62ce93b84209b026a165ff647cd4875e32c16251098c05e9e7de834cc6f27d164b5be168f8fd16323ec60593287a787f6fa8fcef144291 WHIRLPOOL 4031e3aa03f74afaf395a412668d7142f867e6279a9d0ac5334a6b1d8b3ad5cccc93961d0e1c63aa7fc46179555a6f106ce6e8acbec774d21a7af37a147a2ea0
23 +DIST docker-1.9.1.tar.gz 7824414 SHA256 ff0ad9647b756381758a16440a48e6f3c8615bbc903e53680569aac0b0a85157 SHA512 db9db1d5095b2afe2285265414c36026d2b42d5547301d7d462151b81553f33e242b403b566e7835727d51b77e3176c049f1e9f37f60b59b3c66b95403c97b9d WHIRLPOOL 93118093947c8a490a2007003e45974d7923afae4111c59e2f026787cf57f99b275be1be4a9e69b17cddf576f2d2af7fadcaa1f7ebc0ca08ce0e42a055ace22b
24
25 diff --git a/app-emulation/docker/docker-1.9.1.ebuild b/app-emulation/docker/docker-1.9.1.ebuild
26 new file mode 100644
27 index 0000000..f490eac
28 --- /dev/null
29 +++ b/app-emulation/docker/docker-1.9.1.ebuild
30 @@ -0,0 +1,265 @@
31 +# Copyright 1999-2015 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=5
36 +
37 +EGO_PN="github.com/docker/docker"
38 +
39 +if [[ ${PV} = *9999* ]]; then
40 + # Docker cannot be fetched via "go get", thanks to autogenerated code
41 + EGIT_REPO_URI="https://${EGO_PN}.git"
42 + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
43 + inherit git-r3
44 +else
45 + MY_PV="${PV/_/-}"
46 + DOCKER_GITCOMMIT="a34a1d5"
47 + EGIT_COMMIT="v${MY_PV}"
48 + SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
49 + KEYWORDS="~amd64"
50 + [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
51 + inherit golang-vcs-snapshot
52 +fi
53 +inherit bash-completion-r1 linux-info multilib systemd udev user
54 +
55 +DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
56 +HOMEPAGE="https://dockerproject.org"
57 +LICENSE="Apache-2.0"
58 +SLOT="0"
59 +IUSE="apparmor aufs btrfs +device-mapper experimental overlay"
60 +
61 +# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
62 +CDEPEND="
63 + >=dev-db/sqlite-3.7.9:3
64 + device-mapper? (
65 + >=sys-fs/lvm2-2.02.89[thin]
66 + )
67 +"
68 +
69 +DEPEND="
70 + ${CDEPEND}
71 +
72 + dev-go/go-md2man
73 +
74 + btrfs? (
75 + >=sys-fs/btrfs-progs-3.8
76 + )
77 +"
78 +
79 +# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
80 +# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#optional-dependencies
81 +RDEPEND="
82 + ${CDEPEND}
83 +
84 + !app-emulation/docker-bin
85 + >=net-firewall/iptables-1.4
86 + sys-process/procps
87 + >=dev-vcs/git-1.7
88 + >=app-arch/xz-utils-4.9
89 +
90 + apparmor? (
91 + sys-libs/libapparmor[static-libs]
92 + )
93 +"
94 +
95 +RESTRICT="installsources strip"
96 +
97 +# see "contrib/check-config.sh" from upstream's sources
98 +CONFIG_CHECK="
99 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
100 + ~DEVPTS_MULTIPLE_INSTANCES
101 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
102 + ~MACVLAN ~VETH ~BRIDGE ~BRIDGE_NETFILTER
103 + ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
104 + ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK
105 + ~NF_NAT ~NF_NAT_NEEDED
106 +
107 + ~POSIX_MQUEUE
108 +
109 + ~MEMCG_KMEM ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
110 +
111 + ~BLK_CGROUP ~IOSCHED_CFQ
112 + ~CGROUP_PERF
113 + ~CGROUP_HUGETLB
114 + ~NET_CLS_CGROUP
115 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
116 +"
117 +
118 +ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
119 +ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
120 +ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
121 +
122 +ERROR_BLK_CGROUP="CONFIG_BLK_CGROUP: is optional for container statistics gathering"
123 +ERROR_IOSCHED_CFQ="CONFIG_IOSCHED_CFQ: is optional for container statistics gathering"
124 +ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
125 +ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
126 +
127 +pkg_setup() {
128 + if kernel_is lt 3 10; then
129 + ewarn ""
130 + ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
131 + ewarn " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies"
132 + fi
133 +
134 + # for where these kernel versions come from, see:
135 + # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
136 + if ! {
137 + kernel_is ge 3 16 \
138 + || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
139 + || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
140 + || { kernel_is 3 12 && kernel_is ge 3 12 25; }
141 + }; then
142 + ewarn ""
143 + ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
144 + ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
145 + ewarn ""
146 + ewarn "See also https://github.com/docker/docker/issues/2960"
147 + fi
148 +
149 + if kernel_is le 3 18; then
150 + CONFIG_CHECK+="
151 + ~RESOURCE_COUNTERS
152 + "
153 + fi
154 +
155 + if kernel_is le 3 13; then
156 + CONFIG_CHECK+="
157 + ~NETPRIO_CGROUP
158 + "
159 + else
160 + CONFIG_CHECK+="
161 + ~CGROUP_NET_PRIO
162 + "
163 + fi
164 +
165 + if use aufs; then
166 + CONFIG_CHECK+="
167 + ~AUFS_FS
168 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
169 + "
170 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
171 + fi
172 +
173 + if use btrfs; then
174 + CONFIG_CHECK+="
175 + ~BTRFS_FS
176 + "
177 + fi
178 +
179 + if use device-mapper; then
180 + CONFIG_CHECK+="
181 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
182 + "
183 + fi
184 +
185 + if use overlay; then
186 + CONFIG_CHECK+="
187 + ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
188 + "
189 + fi
190 +
191 + linux-info_pkg_setup
192 +
193 + # create docker group for the code checking for it in /etc/group
194 + enewgroup docker
195 +}
196 +
197 +src_prepare() {
198 + cd "src/${EGO_PN}" || die
199 + epatch "${FILESDIR}"/18074-disable-journald-arm.patch
200 + # allow user patches (use sparingly - upstream won't support them)
201 + epatch_user
202 +}
203 +
204 +src_compile() {
205 + cd "src/${EGO_PN}" || die
206 + export GOPATH="${WORKDIR}/${P}:${PWD}/vendor:$(get_golibdir_gopath)"
207 +
208 + # setup CFLAGS and LDFLAGS for separate build target
209 + # see https://github.com/tianon/docker-overlay/pull/10
210 + export CGO_CFLAGS="-I${ROOT}/usr/include"
211 + export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
212 +
213 + # if we're building from a zip, we need the GITCOMMIT value
214 + [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
215 +
216 + if gcc-specs-pie; then
217 + sed -i "s/EXTLDFLAGS_STATIC='/EXTLDFLAGS_STATIC='-fno-PIC /" hack/make.sh || die
218 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
219 +
220 + sed -i "s/LDFLAGS_STATIC_DOCKER='/LDFLAGS_STATIC_DOCKER='-extldflags -fno-PIC /" hack/make/dynbinary || die
221 + grep -q -- '-fno-PIC' hack/make/dynbinary || die 'hardened sed failed'
222 + fi
223 +
224 + # let's set up some optional features :)
225 + export DOCKER_BUILDTAGS=''
226 + for gd in aufs btrfs device-mapper overlay; do
227 + if ! use $gd; then
228 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
229 + fi
230 + done
231 +
232 + if use apparmor; then
233 + DOCKER_BUILDTAGS+=' apparmor'
234 + fi
235 +
236 + # https://github.com/docker/docker/pull/13338
237 + if use experimental; then
238 + export DOCKER_EXPERIMENTAL=1
239 + else
240 + unset DOCKER_EXPERIMENTAL
241 + fi
242 +
243 + # time to build!
244 + ./hack/make.sh dynbinary || die 'dynbinary failed'
245 +
246 + # build the man pages too
247 + ./man/md2man-all.sh || die "unable to generate man pages"
248 +}
249 +
250 +src_install() {
251 + cd "src/${EGO_PN}" || die
252 + VERSION="$(cat VERSION)"
253 + newbin "bundles/$VERSION/dynbinary/docker-$VERSION" docker
254 + exeinto /usr/libexec/docker
255 + newexe "bundles/$VERSION/dynbinary/dockerinit-$VERSION" dockerinit
256 +
257 + newinitd contrib/init/openrc/docker.initd docker
258 + newconfd contrib/init/openrc/docker.confd docker
259 +
260 + systemd_dounit contrib/init/systemd/docker.{service,socket}
261 +
262 + udev_dorules contrib/udev/*.rules
263 +
264 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
265 + dodoc -r docs/*
266 + doman man/man*/*
267 +
268 + dobashcomp contrib/completion/bash/*
269 +
270 + insinto /usr/share/zsh/site-functions
271 + doins contrib/completion/zsh/*
272 +
273 + insinto /usr/share/vim/vimfiles
274 + doins -r contrib/syntax/vim/ftdetect
275 + doins -r contrib/syntax/vim/syntax
276 +
277 + # note: intentionally not using "doins" so that we preserve +x bits
278 + mkdir -p "${D}/usr/share/${PN}/contrib"
279 + cp -R contrib/* "${D}/usr/share/${PN}/contrib"
280 +}
281 +
282 +pkg_postinst() {
283 + udev_reload
284 +
285 + elog
286 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
287 + elog "start the Docker daemon at boot, add Docker to the default runlevel:"
288 + elog " rc-update add docker default"
289 + elog "Similarly for systemd:"
290 + elog " systemctl enable docker.service"
291 + elog
292 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
293 + elog " usermod -aG docker youruser"
294 + elog
295 +}
296
297 diff --git a/app-emulation/docker/files/18074-disable-journald-arm.patch b/app-emulation/docker/files/18074-disable-journald-arm.patch
298 new file mode 100644
299 index 0000000..e7c9a2f
300 --- /dev/null
301 +++ b/app-emulation/docker/files/18074-disable-journald-arm.patch
302 @@ -0,0 +1,30 @@
303 +diff --git a/daemon/logger/journald/journald.go b/daemon/logger/journald/journald.go
304 +index c729b56..97c379c 100644
305 +--- a/daemon/logger/journald/journald.go
306 ++++ b/daemon/logger/journald/journald.go
307 +@@ -1,4 +1,4 @@
308 +-// +build linux
309 ++// +build linux,!arm
310 +
311 + // Package journald provides the log driver for forwarding server logs
312 + // to endpoints that receive the systemd format.
313 +diff --git a/daemon/logger/journald/journald_unsupported.go b/daemon/logger/journald/journald_unsupported.go
314 +index d52ca92..8e9034a 100644
315 +--- a/daemon/logger/journald/journald_unsupported.go
316 ++++ b/daemon/logger/journald/journald_unsupported.go
317 +@@ -1,4 +1,4 @@
318 +-// +build !linux
319 ++// +build !linux linux,arm
320 +
321 + package journald
322 +
323 +diff --git a/daemon/logger/journald/read.go b/daemon/logger/journald/read.go
324 +index 80c1fbd..0477c04 100644
325 +--- a/daemon/logger/journald/read.go
326 ++++ b/daemon/logger/journald/read.go
327 +@@ -1,4 +1,4 @@
328 +-// +build linux,cgo,!static_build,journald
329 ++// +build linux,cgo,!static_build,journald,!arm
330 +
331 + package journald
332 +