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