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