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