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