]>
Commit | Line | Data |
---|---|---|
a73bca1d ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
de893b83 | 4 | %bcond_with vim # build vim syntax package (bundled in vim 7.4.979-2) |
b317146a | 5 | %bcond_with doc # build manual pages |
b2c07037 | 6 | |
8eac6649 ER |
7 | # TODO: drop P docker when docker-compose updated to use docker(engine) dep |
8 | ||
be6486fd ER |
9 | # NOTES |
10 | # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies | |
11 | ||
d83187b3 ER |
12 | # v1.0.0-rc2-391-g2d41c047 |
13 | %define runc_commit 2d41c04 | |
14 | # v0.2.8-38-gcfb82a87 | |
15 | %define containerd_commit cfb82a8 | |
16 | # v0.8.0-dev.2-624-g7b2b1feb | |
17 | %define libnetwork_commit 7b2b1fe | |
18 | #define subver -rc1 | |
8716e3f7 ER |
19 | Summary: Docker CE: the open-source application container engine |
20 | Name: docker-ce | |
21 | # Using Docker-CE, Stay on Stable channel | |
22 | # https://docs.docker.com/engine/installation/ | |
d83187b3 ER |
23 | Version: 17.06.0 |
24 | Release: 0.1 | |
b877f7b7 ER |
25 | License: Apache v2.0 |
26 | Group: Applications/System | |
d83187b3 ER |
27 | # https://github.com/docker/docker-ce/releases |
28 | Source0: https://github.com/docker/docker-ce/archive/v%{version}-ce/%{name}-%{version}-ce.tar.gz | |
29 | # Source0-md5: 1eb7761b77dc328e6b0a9c481bcd7514 | |
7c769496 | 30 | Source1: https://github.com/docker/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz |
d83187b3 | 31 | # Source1-md5: b1b8584e23f1e0dbe5e1bd2e623262df |
36f21c65 | 32 | Source2: https://github.com/docker/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz |
d83187b3 | 33 | # Source2-md5: a07b23b82974bba8fb8dfa69234cbd6a |
a75f03e6 | 34 | Source3: https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz |
d83187b3 | 35 | # Source3-md5: 9360e38c43e862e42c128db1852ac5bb |
b96d9f58 ER |
36 | Source4: https://github.com/krallin/tini/archive/v0.13.0/tini-0.13.0.tar.gz |
37 | # Source4-md5: c29541112a242c53c82bb6b1213f288f | |
8716e3f7 ER |
38 | Source5: dockerd.sh |
39 | Source7: docker.init | |
40 | Source8: docker.sysconfig | |
b6f967da | 41 | Patch0: systemd.patch |
8716e3f7 | 42 | URL: https://www.docker.com/community-edition/ |
be6486fd | 43 | BuildRequires: btrfs-progs-devel >= 3.16.1 |
6dee0436 | 44 | BuildRequires: cmake |
be6486fd | 45 | BuildRequires: device-mapper-devel >= 2.02.89 |
d9a3d699 | 46 | BuildRequires: golang >= 1.6 |
be6486fd | 47 | BuildRequires: libseccomp-devel >= 2.2.1 |
0be68701 | 48 | BuildRequires: rpmbuild(macros) >= 1.644 |
678a84bd | 49 | BuildRequires: sqlite3-devel >= 3.7.9 |
d88043a2 ER |
50 | Requires(post,preun): /sbin/chkconfig |
51 | Requires(postun): /usr/sbin/groupdel | |
52 | Requires(pre): /usr/bin/getgid | |
53 | Requires(pre): /usr/sbin/groupadd | |
27e7cc0f | 54 | Requires: ca-certificates |
2e42e913 | 55 | Requires: iproute2 >= 3.5 |
b5920dfc | 56 | Requires: iptables |
345101bd | 57 | Requires: rc-scripts >= 0.4.0.10 |
0be68701 | 58 | Requires: systemd-units >= 38 |
2e42e913 | 59 | Requires: tar >= 1:1.26 |
2015cb19 | 60 | Requires: uname(release) >= 3.8 |
db150373 | 61 | Requires: xz |
65777843 | 62 | Suggests: docker-credential-helpers |
2e42e913 | 63 | Suggests: git-core >= 1.7 |
46a6d8ab | 64 | Suggests: libcgroup |
2e42e913 | 65 | Suggests: xz >= 1:4.9 |
8eac6649 ER |
66 | Provides: docker = %{version} |
67 | Provides: docker(engine) = %{version} | |
d88043a2 | 68 | Provides: group(docker) |
23955a7a | 69 | Obsoletes: docker < 17.0 |
47009a45 | 70 | Obsoletes: lxc-docker < 1.1.1 |
d2670441 | 71 | # only runs on x64 hosts for now: |
f4565fa4 ER |
72 | # https://github.com/docker/docker/issues/136 |
73 | # https://github.com/docker/docker/issues/611 | |
345101bd | 74 | ExclusiveArch: %{x8664} |
b877f7b7 ER |
75 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
76 | ||
8c352669 | 77 | %define bash_compdir %{_datadir}/bash-completion/completions |
a6da47b4 | 78 | %define zsh_compdir %{_datadir}/zsh/site-functions |
f891ae41 | 79 | %define _vimdatadir %{_datadir}/vim |
a990be6d | 80 | %define _libexecdir %{_prefix}/lib |
8c352669 | 81 | |
434d66d3 ER |
82 | # binary stripped or something |
83 | %define _enable_debug_packages 0 | |
84 | ||
b877f7b7 | 85 | %description |
f4565fa4 ER |
86 | Docker is an open source project to pack, ship and run any application |
87 | as a lightweight container | |
88 | ||
89 | Docker containers are both hardware-agnostic and platform-agnostic. | |
90 | This means that they can run anywhere, from your laptop to the largest | |
91 | EC2 compute instance and everything in between - and they don't | |
92 | require that you use a particular language, framework or packaging | |
93 | system. That makes them great building blocks for deploying and | |
94 | scaling web apps, databases and backend services without depending on | |
95 | a particular stack or provider. | |
96 | ||
97 | Docker is an open-source implementation of the deployment engine which | |
98 | powers dotCloud, a popular Platform-as-a-Service. It benefits directly | |
99 | from the experience accumulated over several years of large-scale | |
100 | operation and support of hundreds of thousands of applications and | |
101 | databases. | |
b877f7b7 | 102 | |
f891ae41 | 103 | %package -n bash-completion-%{name} |
8c352669 ER |
104 | Summary: bash-completion for Docker |
105 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera | |
106 | Group: Applications/Shells | |
107 | Requires: %{name} | |
108 | Requires: bash-completion >= 2.0 | |
47009a45 | 109 | Obsoletes: bash-completion-lxc-docker < 1.1.1 |
8c352669 ER |
110 | %if "%{_rpmversion}" >= "5" |
111 | BuildArch: noarch | |
112 | %endif | |
113 | ||
47009a45 | 114 | %description -n bash-completion-%{name} |
8c352669 ER |
115 | This package provides bash-completion for Docker. |
116 | ||
47009a45 | 117 | %description -n bash-completion-%{name} -l pl.UTF-8 |
8c352669 ER |
118 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera. |
119 | ||
a6da47b4 JK |
120 | %package -n zsh-completion-%{name} |
121 | Summary: zsh completion for Docker | |
122 | Summary(pl.UTF-8): Uzupełnianie parametrów w zsh dla poleceń Dockera | |
123 | Group: Applications/Shells | |
124 | Requires: %{name} | |
125 | %if "%{_rpmversion}" >= "5" | |
126 | BuildArch: noarch | |
127 | %endif | |
128 | ||
129 | %description -n zsh-completion-%{name} | |
130 | This package provides zsh completion for Docker. | |
131 | ||
132 | %description -n zsh-completion-%{name} -l pl.UTF-8 | |
133 | Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera. | |
134 | ||
f891ae41 ER |
135 | %package -n vim-syntax-%{name} |
136 | Summary: Vim syntax: Docker | |
137 | Group: Applications/Editors/Vim | |
138 | Requires: %{name} = %{version}-%{release} | |
139 | Requires: vim-rt >= 4:7.2.170 | |
47009a45 | 140 | Obsoletes: vim-syntax-lxc-docker < 1.1.1 |
f891ae41 ER |
141 | %if "%{_rpmversion}" >= "5" |
142 | BuildArch: noarch | |
143 | %endif | |
144 | ||
145 | %description -n vim-syntax-%{name} | |
146 | This plugin provides syntax highlighting in Dockerfile. | |
147 | ||
b877f7b7 | 148 | %prep |
d83187b3 ER |
149 | %setup -q -n docker-ce-%{version}-ce%{?subver} -a1 -a2 -a3 -a4 |
150 | #mv runc-%{runc_commit}* runc | |
151 | #mv containerd-%{containerd_commit}* containerd | |
152 | #mv libnetwork-%{libnetwork_commit}* libnetwork | |
b96d9f58 | 153 | mv tini-* tini |
d83187b3 | 154 | %patch0 -p1 -d components/engine |
36f21c65 | 155 | |
d83187b3 ER |
156 | #install -d vendor/src/github.com/docker |
157 | #ln -s $(pwd) vendor/src/github.com/docker/docker | |
158 | #ln -s $(pwd)/containerd containerd/vendor/src/github.com/docker/containerd | |
159 | #ln -s $(pwd)/libnetwork vendor/src/github.com/docker/libnetwork | |
160 | ||
161 | #ln -s ../../../../cli components/engine/vendor/github.com/docker | |
162 | #ln -s cli/vendor/github.com/docker/docker components/engine/vendor/github.com/docker | |
163 | #ln -s ../../.. components/engine/vendor/github.com/docker/docker | |
b877f7b7 | 164 | |
692548c0 | 165 | %build |
d83187b3 | 166 | v=$(awk -F= '/^RUNC_COMMIT/ {print $2}' components/engine/hack/dockerfile/binaries-commits) |
36f21c65 | 167 | echo "$v" | grep "^%{runc_commit}" |
d83187b3 | 168 | v=$(awk -F= '/^CONTAINERD_COMMIT/ {print $2}' components/engine/hack/dockerfile/binaries-commits) |
36f21c65 | 169 | echo "$v" | grep "^%{containerd_commit}" |
d83187b3 | 170 | v=$(awk -F= '/^LIBNETWORK_COMMIT/ {print $2}' components/engine/hack/dockerfile/binaries-commits) |
a75f03e6 | 171 | echo "$v" | grep "^%{libnetwork_commit}" |
36f21c65 | 172 | |
d83187b3 ER |
173 | #export GOPATH=$(pwd)/vendor:$(pwd)/containerd/vendor |
174 | #export GOPATH=$(pwd)/components/engine | |
175 | export AUTO_GOPATH=1 | |
176 | #export GOROOT=$(pwd)/components/engine | |
e4252f76 | 177 | export DOCKER_GITCOMMIT="pld/%{version}" |
36f21c65 | 178 | # build docker-runc |
d83187b3 | 179 | #%{__make} -C runc |
36f21c65 ER |
180 | |
181 | # build docker-containerd | |
d83187b3 | 182 | #%{__make} -C containerd |
36f21c65 | 183 | |
a75f03e6 | 184 | # build docker-proxy |
d83187b3 ER |
185 | #go build -ldflags="-linkmode=external" \ |
186 | # -o docker-proxy \ | |
187 | # github.com/docker/libnetwork/cmd/proxy | |
a75f03e6 | 188 | |
b96d9f58 ER |
189 | # build docker-init |
190 | cd tini | |
7397034b | 191 | cmake . |
b96d9f58 ER |
192 | %{__make} |
193 | cd .. | |
194 | ||
d83187b3 | 195 | cd components/engine |
90544b12 | 196 | bash -x hack/make.sh dynbinary |
b317146a ER |
197 | %if %{with doc} |
198 | man/md2man-all.sh | |
199 | %endif | |
a73bca1d | 200 | |
b877f7b7 ER |
201 | %install |
202 | rm -rf $RPM_BUILD_ROOT | |
36f21c65 | 203 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \ |
a990be6d | 204 | $RPM_BUILD_ROOT%{_libexecdir} \ |
7b3be108 | 205 | $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes} |
e4252f76 | 206 | |
d83187b3 ER |
207 | install -p components/engine/bundles/latest/dynbinary-daemon/dockerd $RPM_BUILD_ROOT%{_sbindir}/dockerd |
208 | install -p components/engine/bundles/latest/dynbinary-client/docker $RPM_BUILD_ROOT%{_bindir}/docker | |
36f21c65 ER |
209 | |
210 | # install docker-runc | |
211 | install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc | |
212 | ||
213 | # install docker-containerd | |
214 | install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd | |
215 | install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim | |
6a5abe01 | 216 | install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-ctr |
36f21c65 | 217 | |
a75f03e6 ER |
218 | # install docker-proxy |
219 | install -p docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy | |
220 | ||
b96d9f58 ER |
221 | # install docker-init |
222 | install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init | |
223 | ||
d83187b3 ER |
224 | cp -p components/engine/contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir} |
225 | cp -p components/engine/contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir} | |
5fcaa458 | 226 | install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker |
b96d9f58 | 227 | install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd |
5fcaa458 | 228 | cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker |
b877f7b7 | 229 | |
e4252f76 ER |
230 | # install udev rules |
231 | install -d $RPM_BUILD_ROOT/lib/udev/rules.d | |
232 | cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d | |
233 | ||
a6da47b4 | 234 | # bash and zsh completion |
8c352669 | 235 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
47009a45 | 236 | cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker |
a6da47b4 JK |
237 | install -d $RPM_BUILD_ROOT%{zsh_compdir} |
238 | cp -p contrib/completion/zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir} | |
8c352669 | 239 | |
f891ae41 | 240 | # vim syntax |
c590f8e8 | 241 | %if %{with vim} |
f891ae41 | 242 | install -d $RPM_BUILD_ROOT%{_vimdatadir} |
7db50491 | 243 | cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir} |
f891ae41 | 244 | %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md} |
c590f8e8 | 245 | %endif |
f891ae41 | 246 | |
d88043a2 ER |
247 | %pre |
248 | %groupadd -g 296 docker | |
249 | ||
345101bd | 250 | %post |
8716e3f7 ER |
251 | /sbin/chkconfig --add docker |
252 | %service -n docker restart | |
253 | %systemd_post docker.service | |
345101bd ER |
254 | |
255 | %preun | |
256 | if [ "$1" = "0" ]; then | |
8716e3f7 ER |
257 | %service -q docker stop |
258 | /sbin/chkconfig --del docker | |
345101bd | 259 | fi |
8716e3f7 | 260 | %systemd_preun docker.service |
345101bd | 261 | |
d88043a2 ER |
262 | %postun |
263 | if [ "$1" = "0" ]; then | |
264 | %groupremove docker | |
265 | fi | |
2e523ef0 | 266 | %systemd_reload |
d88043a2 | 267 | |
eb841086 ER |
268 | %triggerun -- docker < 17.0 |
269 | # Prevent preun from docker from working | |
270 | chmod a-x /etc/rc.d/init.d/docker | |
271 | ||
272 | %triggerpostun -- docker < 17.0 | |
273 | # Restore what triggerun removed | |
274 | chmod 754 /etc/rc.d/init.d/docker | |
275 | # reinstall docker init.d links, which could be different | |
276 | /sbin/chkconfig --del docker | |
277 | /sbin/chkconfig --add docker | |
278 | ||
b877f7b7 ER |
279 | %clean |
280 | rm -rf $RPM_BUILD_ROOT | |
281 | ||
282 | %files | |
283 | %defattr(644,root,root,755) | |
f4565fa4 | 284 | %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS |
62b620a7 | 285 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker |
47009a45 | 286 | %attr(754,root,root) /etc/rc.d/init.d/docker |
9c77b76c | 287 | %attr(755,root,root) %{_bindir}/docker |
36f21c65 | 288 | %attr(755,root,root) %{_sbindir}/docker-containerd |
6a5abe01 | 289 | %attr(755,root,root) %{_sbindir}/docker-containerd-ctr |
36f21c65 | 290 | %attr(755,root,root) %{_sbindir}/docker-containerd-shim |
b96d9f58 | 291 | %attr(755,root,root) %{_sbindir}/docker-init |
4467217c ER |
292 | %attr(755,root,root) %{_sbindir}/docker-proxy |
293 | %attr(755,root,root) %{_sbindir}/docker-runc | |
294 | %attr(755,root,root) %{_sbindir}/dockerd | |
29baba5b | 295 | %attr(755,root,root) %{_libexecdir}/dockerd |
62b620a7 | 296 | %{systemdunitdir}/docker.service |
5fcaa458 | 297 | %{systemdunitdir}/docker.socket |
e4252f76 | 298 | /lib/udev/rules.d/80-docker.rules |
36f21c65 | 299 | |
af991618 ER |
300 | %dir %attr(700,root,root) /var/lib/docker |
301 | %dir %attr(700,root,root) /var/lib/docker/containers | |
b73b275e | 302 | %dir %attr(700,root,root) /var/lib/docker/execdriver |
af991618 | 303 | %dir %attr(700,root,root) /var/lib/docker/graph |
841676f2 | 304 | %dir %attr(700,root,root) /var/lib/docker/image |
b73b275e | 305 | %dir %attr(700,root,root) /var/lib/docker/init |
841676f2 | 306 | %dir %attr(700,root,root) /var/lib/docker/network |
7b3be108 | 307 | %dir %attr(700,root,root) /var/lib/docker/swarm |
b73b275e ER |
308 | %dir %attr(700,root,root) /var/lib/docker/tmp |
309 | %dir %attr(700,root,root) /var/lib/docker/trust | |
310 | %dir %attr(700,root,root) /var/lib/docker/vfs | |
af991618 | 311 | %dir %attr(700,root,root) /var/lib/docker/volumes |
8c352669 | 312 | |
f891ae41 | 313 | %files -n bash-completion-%{name} |
8c352669 | 314 | %defattr(644,root,root,755) |
8c352669 | 315 | %{bash_compdir}/docker |
f891ae41 | 316 | |
a6da47b4 JK |
317 | %files -n zsh-completion-%{name} |
318 | %defattr(644,root,root,755) | |
319 | %{zsh_compdir}/_docker | |
320 | ||
c590f8e8 | 321 | %if %{with vim} |
f891ae41 ER |
322 | %files -n vim-syntax-%{name} |
323 | %defattr(644,root,root,755) | |
7db50491 | 324 | %doc contrib/syntax/vim/{README.md,LICENSE} |
f891ae41 ER |
325 | %{_vimdatadir}/doc/dockerfile.txt |
326 | %{_vimdatadir}/ftdetect/dockerfile.vim | |
327 | %{_vimdatadir}/syntax/dockerfile.vim | |
c590f8e8 | 328 | %endif |