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