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