Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/
Date: Thu, 14 Jul 2016 23:46:28
Message-Id: 1468539400.5a5244803bf45d027389c3f242bf2d9ff6ff5708.williamh@gentoo
1 commit: 5a5244803bf45d027389c3f242bf2d9ff6ff5708
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 14 23:29:46 2016 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 14 23:36:40 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a524480
7
8 app-emulation/docker: 1.12.0-rc4-r1 revbump to install docker-proxy binary
9
10 Package-Manager: portage-2.2.28
11
12 app-emulation/docker/docker-1.12.0_rc4-r1.ebuild | 270 +++++++++++++++++++++++
13 1 file changed, 270 insertions(+)
14
15 diff --git a/app-emulation/docker/docker-1.12.0_rc4-r1.ebuild b/app-emulation/docker/docker-1.12.0_rc4-r1.ebuild
16 new file mode 100644
17 index 0000000..5344a16
18 --- /dev/null
19 +++ b/app-emulation/docker/docker-1.12.0_rc4-r1.ebuild
20 @@ -0,0 +1,270 @@
21 +# Copyright 1999-2016 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI=6
26 +
27 +EGO_PN="github.com/docker/docker"
28 +
29 +if [[ ${PV} = *9999* ]]; then
30 + # Docker cannot be fetched via "go get", thanks to autogenerated code
31 + EGIT_REPO_URI="https://${EGO_PN}.git"
32 + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
33 + inherit git-r3
34 +else
35 + MY_PV="${PV/_/-}"
36 + DOCKER_GITCOMMIT="e4a0dbc"
37 + EGIT_COMMIT="v${MY_PV}"
38 + SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
39 + KEYWORDS="~amd64"
40 + [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
41 + inherit golang-vcs-snapshot
42 +fi
43 +inherit bash-completion-r1 golang-base linux-info systemd udev user
44 +
45 +DESCRIPTION="The core functions you need to create Docker images and run Docker containers"
46 +HOMEPAGE="https://dockerproject.org"
47 +LICENSE="Apache-2.0"
48 +SLOT="0"
49 +IUSE="apparmor aufs btrfs +device-mapper experimental overlay seccomp"
50 +
51 +# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
52 +CDEPEND="
53 + >=dev-db/sqlite-3.7.9:3
54 + device-mapper? (
55 + >=sys-fs/lvm2-2.02.89[thin]
56 + )
57 + seccomp? ( >=sys-libs/libseccomp-2.2.1 )
58 + apparmor? ( sys-libs/libapparmor )
59 +"
60 +
61 +DEPEND="
62 + ${CDEPEND}
63 +
64 + dev-go/go-md2man
65 +
66 + btrfs? (
67 + >=sys-fs/btrfs-progs-3.8
68 + )
69 +"
70 +
71 +# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
72 +# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#optional-dependencies
73 +RDEPEND="
74 + ${CDEPEND}
75 +
76 + !app-emulation/docker-bin
77 + >=net-firewall/iptables-1.4
78 + sys-process/procps
79 + >=dev-vcs/git-1.7
80 + >=app-arch/xz-utils-4.9
81 +
82 + >app-emulation/containerd-0.2.2
83 + app-emulation/runc[apparmor?,seccomp?]
84 +"
85 +
86 +RESTRICT="installsources strip"
87 +
88 +S="${WORKDIR}/${P}/src/${EGO_PN}"
89 +
90 +# see "contrib/check-config.sh" from upstream's sources
91 +CONFIG_CHECK="
92 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
93 + ~DEVPTS_MULTIPLE_INSTANCES
94 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
95 + ~KEYS ~MACVLAN ~VETH ~BRIDGE ~BRIDGE_NETFILTER
96 + ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
97 + ~IP_VS
98 + ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK
99 + ~NF_NAT ~NF_NAT_NEEDED
100 +
101 + ~POSIX_MQUEUE
102 +
103 + ~MEMCG_KMEM ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
104 +
105 + ~BLK_CGROUP ~IOSCHED_CFQ
106 + ~CGROUP_PERF
107 + ~CGROUP_HUGETLB
108 + ~NET_CLS_CGROUP
109 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
110 + ~XFRM_ALGO ~XFRM_USER
111 +"
112 +
113 +ERROR_KEYS="CONFIG_KEYS: is mandatory"
114 +ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
115 +ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
116 +ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
117 +
118 +ERROR_BLK_CGROUP="CONFIG_BLK_CGROUP: is optional for container statistics gathering"
119 +ERROR_IOSCHED_CFQ="CONFIG_IOSCHED_CFQ: is optional for container statistics gathering"
120 +ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
121 +ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
122 +ERROR_XFRM_ALGO="CONFIG_XFRM_ALGO: is optional for secure networks"
123 +ERROR_XFRM_USER="CONFIG_XFRM_USER: is optional for secure networks"
124 +
125 +pkg_setup() {
126 + if kernel_is lt 3 10; then
127 + ewarn ""
128 + ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
129 + ewarn " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies"
130 + fi
131 +
132 + # for where these kernel versions come from, see:
133 + # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
134 + if ! {
135 + kernel_is ge 3 16 \
136 + || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
137 + || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
138 + || { kernel_is 3 12 && kernel_is ge 3 12 25; }
139 + }; then
140 + ewarn ""
141 + ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
142 + ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
143 + ewarn ""
144 + ewarn "See also https://github.com/docker/docker/issues/2960"
145 + fi
146 +
147 + if kernel_is le 3 18; then
148 + CONFIG_CHECK+="
149 + ~RESOURCE_COUNTERS
150 + "
151 + fi
152 +
153 + if kernel_is le 3 13; then
154 + CONFIG_CHECK+="
155 + ~NETPRIO_CGROUP
156 + "
157 + else
158 + CONFIG_CHECK+="
159 + ~CGROUP_NET_PRIO
160 + "
161 + fi
162 +
163 + if use aufs; then
164 + CONFIG_CHECK+="
165 + ~AUFS_FS
166 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
167 + "
168 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
169 + fi
170 +
171 + if use btrfs; then
172 + CONFIG_CHECK+="
173 + ~BTRFS_FS
174 + "
175 + fi
176 +
177 + if use device-mapper; then
178 + CONFIG_CHECK+="
179 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
180 + "
181 + fi
182 +
183 + if use overlay; then
184 + CONFIG_CHECK+="
185 + ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
186 + "
187 + fi
188 +
189 + linux-info_pkg_setup
190 +
191 + # create docker group for the code checking for it in /etc/group
192 + enewgroup docker
193 +}
194 +
195 +src_compile() {
196 + export GOPATH="${WORKDIR}/${P}:${PWD}/vendor"
197 +
198 + # setup CFLAGS and LDFLAGS for separate build target
199 + # see https://github.com/tianon/docker-overlay/pull/10
200 + export CGO_CFLAGS="-I${ROOT}/usr/include"
201 + export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
202 +
203 + # if we're building from a zip, we need the GITCOMMIT value
204 + [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
205 +
206 + if gcc-specs-pie; then
207 + sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
208 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
209 +
210 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
211 + -i hack/make/dynbinary || die
212 + grep -q -- '-fno-PIC' hack/make/dynbinary || die 'hardened sed failed'
213 + fi
214 +
215 + # let's set up some optional features :)
216 + export DOCKER_BUILDTAGS=''
217 + for gd in aufs btrfs device-mapper overlay; do
218 + if ! use $gd; then
219 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
220 + fi
221 + done
222 +
223 + for tag in apparmor seccomp; do
224 + if use $tag; then
225 + DOCKER_BUILDTAGS+=" $tag"
226 + fi
227 + done
228 +
229 + # https://github.com/docker/docker/pull/13338
230 + if use experimental; then
231 + export DOCKER_EXPERIMENTAL=1
232 + else
233 + unset DOCKER_EXPERIMENTAL
234 + fi
235 +
236 + # time to build!
237 + ./hack/make.sh dynbinary || die 'dynbinary failed'
238 +
239 + # build the man pages too
240 + ./man/md2man-all.sh || die "unable to generate man pages"
241 +}
242 +
243 +src_install() {
244 + VERSION="$(cat VERSION)"
245 + newbin "bundles/$VERSION/dynbinary-client/docker-$VERSION" docker
246 + newbin "bundles/$VERSION/dynbinary-daemon/dockerd-$VERSION" dockerd
247 + newbin "bundles/$VERSION/dynbinary-daemon/docker-proxy-$VERSION" docker-proxy
248 + dosym containerd /usr/bin/docker-containerd
249 + dosym containerd-shim /usr/bin/docker-containerd-shim
250 + dosym runc /usr/bin/docker-runc
251 +
252 + newinitd contrib/init/openrc/docker.initd docker
253 + newconfd contrib/init/openrc/docker.confd docker
254 +
255 + systemd_dounit contrib/init/systemd/docker.{service,socket}
256 +
257 + udev_dorules contrib/udev/*.rules
258 +
259 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
260 + dodoc -r docs/*
261 + doman man/man*/*
262 +
263 + dobashcomp contrib/completion/bash/*
264 +
265 + insinto /usr/share/zsh/site-functions
266 + doins contrib/completion/zsh/*
267 +
268 + insinto /usr/share/vim/vimfiles
269 + doins -r contrib/syntax/vim/ftdetect
270 + doins -r contrib/syntax/vim/syntax
271 +
272 + # note: intentionally not using "doins" so that we preserve +x bits
273 + mkdir -p "${D}/usr/share/${PN}/contrib"
274 + cp -R contrib/* "${D}/usr/share/${PN}/contrib"
275 +}
276 +
277 +pkg_postinst() {
278 + udev_reload
279 +
280 + elog
281 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
282 + elog "start the Docker daemon at boot, add Docker to the default runlevel:"
283 + elog " rc-update add docker default"
284 + elog "Similarly for systemd:"
285 + elog " systemctl enable docker.service"
286 + elog
287 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
288 + elog " usermod -aG docker youruser"
289 + elog
290 +}