]> git.pld-linux.org Git - packages/docker.git/blame - docker.spec
provide docker(engine) for docker-compose
[packages/docker.git] / docker.spec
CommitLineData
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
440e6b79
ER
10# v1.0.0-rc2-133-g9df8b30
11%define runc_commit 9df8b30
12# v0.2.3-85-gaa8187d
13%define containerd_commit aa8187d
a75f03e6
ER
14# v0.8.0-dev.2-464-g0f53435
15%define libnetwork_commit 0f53435
08ac500c 16#define subver -rc7
f4565fa4 17Summary: Docker: the open-source application container engine
47009a45 18Name: docker
440e6b79 19Version: 1.13.1
8672584e 20Release: 2
b877f7b7
ER
21License: Apache v2.0
22Group: Applications/System
2e523ef0 23# https://github.com/docker/docker/releases
08ac500c 24Source0: https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
440e6b79 25# Source0-md5: 032c39b2390a0f387cdb49bab8c4c712
7c769496 26Source1: https://github.com/docker/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
440e6b79 27# Source1-md5: 43ee79eaf575db8a212058c30997e45d
36f21c65 28Source2: https://github.com/docker/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
440e6b79 29# Source2-md5: 01c58df940b94910996ecb8096fd8b71
a75f03e6
ER
30Source3: https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
31# Source3-md5: 7cfbfe76355aae3577c77a6a4b2c92db
b96d9f58
ER
32Source4: https://github.com/krallin/tini/archive/v0.13.0/tini-0.13.0.tar.gz
33# Source4-md5: c29541112a242c53c82bb6b1213f288f
34Source5: %{name}d.sh
5fcaa458
JK
35Source7: %{name}.init
36Source8: %{name}.sysconfig
b6f967da 37Patch0: systemd.patch
35e5a999 38URL: http://www.docker.com/
be6486fd 39BuildRequires: btrfs-progs-devel >= 3.16.1
6dee0436 40BuildRequires: cmake
be6486fd 41BuildRequires: device-mapper-devel >= 2.02.89
d9a3d699 42BuildRequires: golang >= 1.6
be6486fd 43BuildRequires: libseccomp-devel >= 2.2.1
0be68701 44BuildRequires: rpmbuild(macros) >= 1.644
678a84bd 45BuildRequires: sqlite3-devel >= 3.7.9
d88043a2
ER
46Requires(post,preun): /sbin/chkconfig
47Requires(postun): /usr/sbin/groupdel
48Requires(pre): /usr/bin/getgid
49Requires(pre): /usr/sbin/groupadd
27e7cc0f 50Requires: ca-certificates
2e42e913 51Requires: iproute2 >= 3.5
b5920dfc 52Requires: iptables
345101bd 53Requires: rc-scripts >= 0.4.0.10
0be68701 54Requires: systemd-units >= 38
2e42e913 55Requires: tar >= 1:1.26
2015cb19 56Requires: uname(release) >= 3.8
db150373 57Requires: xz
65777843 58Suggests: docker-credential-helpers
2e42e913 59Suggests: git-core >= 1.7
46a6d8ab 60Suggests: libcgroup
2e42e913 61Suggests: xz >= 1:4.9
8672584e 62Provides: docker(engine) = %{version}
d88043a2 63Provides: group(docker)
47009a45 64Obsoletes: lxc-docker < 1.1.1
d2670441 65# only runs on x64 hosts for now:
f4565fa4
ER
66# https://github.com/docker/docker/issues/136
67# https://github.com/docker/docker/issues/611
345101bd 68ExclusiveArch: %{x8664}
b877f7b7
ER
69BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70
8c352669 71%define bash_compdir %{_datadir}/bash-completion/completions
a6da47b4 72%define zsh_compdir %{_datadir}/zsh/site-functions
f891ae41 73%define _vimdatadir %{_datadir}/vim
a990be6d 74%define _libexecdir %{_prefix}/lib
8c352669 75
434d66d3
ER
76# binary stripped or something
77%define _enable_debug_packages 0
78
b877f7b7 79%description
f4565fa4
ER
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.
b877f7b7 96
f891ae41 97%package -n bash-completion-%{name}
8c352669
ER
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
47009a45 103Obsoletes: bash-completion-lxc-docker < 1.1.1
8c352669
ER
104%if "%{_rpmversion}" >= "5"
105BuildArch: noarch
106%endif
107
47009a45 108%description -n bash-completion-%{name}
8c352669
ER
109This package provides bash-completion for Docker.
110
47009a45 111%description -n bash-completion-%{name} -l pl.UTF-8
8c352669
ER
112Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
113
a6da47b4
JK
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
f891ae41
ER
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
47009a45 134Obsoletes: vim-syntax-lxc-docker < 1.1.1
f891ae41
ER
135%if "%{_rpmversion}" >= "5"
136BuildArch: noarch
137%endif
138
139%description -n vim-syntax-%{name}
140This plugin provides syntax highlighting in Dockerfile.
141
b877f7b7 142%prep
b96d9f58 143%setup -q %{?subver:-n %{name}-%{version}%{subver}} -a1 -a2 -a3 -a4
36f21c65
ER
144mv runc-%{runc_commit}* runc
145mv containerd-%{containerd_commit}* containerd
a75f03e6 146mv libnetwork-%{libnetwork_commit}* libnetwork
b96d9f58 147mv tini-* tini
b6f967da 148%patch0 -p1
36f21c65 149
f4565fa4
ER
150install -d vendor/src/github.com/docker
151ln -s $(pwd) vendor/src/github.com/docker/docker
36f21c65 152ln -s $(pwd)/containerd containerd/vendor/src/github.com/docker/containerd
a75f03e6 153ln -s $(pwd)/libnetwork vendor/src/github.com/docker/libnetwork
b877f7b7 154
692548c0 155%build
440e6b79 156v=$(awk -F= '/^RUNC_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
36f21c65 157echo "$v" | grep "^%{runc_commit}"
440e6b79 158v=$(awk -F= '/^CONTAINERD_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
36f21c65 159echo "$v" | grep "^%{containerd_commit}"
440e6b79 160v=$(awk -F= '/^LIBNETWORK_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
a75f03e6 161echo "$v" | grep "^%{libnetwork_commit}"
36f21c65
ER
162
163export GOPATH=$(pwd)/vendor:$(pwd)/containerd/vendor
e4252f76 164export DOCKER_GITCOMMIT="pld/%{version}"
36f21c65
ER
165# build docker-runc
166%{__make} -C runc
167
168# build docker-containerd
169%{__make} -C containerd
170
a75f03e6 171# build docker-proxy
07732609 172go build -ldflags="-linkmode=external" \
a75f03e6
ER
173 -o docker-proxy \
174 github.com/docker/libnetwork/cmd/proxy
175
b96d9f58
ER
176# build docker-init
177cd tini
7397034b 178cmake .
b96d9f58
ER
179%{__make}
180cd ..
181
90544b12 182bash -x hack/make.sh dynbinary
b317146a
ER
183%if %{with doc}
184man/md2man-all.sh
185%endif
a73bca1d 186
b877f7b7
ER
187%install
188rm -rf $RPM_BUILD_ROOT
36f21c65 189install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
a990be6d 190 $RPM_BUILD_ROOT%{_libexecdir} \
7b3be108 191 $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
e4252f76 192
4467217c 193install -p bundles/%{version}%{?subver}/dynbinary-client/docker-%{version}%{?subver} $RPM_BUILD_ROOT%{_bindir}/docker
4467217c 194install -p bundles/%{version}%{?subver}/dynbinary-daemon/dockerd-%{version}%{?subver} $RPM_BUILD_ROOT%{_sbindir}/dockerd
36f21c65
ER
195
196# install docker-runc
197install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
198
199# install docker-containerd
200install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd
201install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim
6a5abe01 202install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-ctr
36f21c65 203
a75f03e6
ER
204# install docker-proxy
205install -p docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
206
b96d9f58
ER
207# install docker-init
208install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
209
b6f967da
ER
210cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
211cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
5fcaa458 212install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
b96d9f58 213install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
5fcaa458 214cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
b877f7b7 215
e4252f76
ER
216# install udev rules
217install -d $RPM_BUILD_ROOT/lib/udev/rules.d
218cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
219
a6da47b4 220# bash and zsh completion
8c352669 221install -d $RPM_BUILD_ROOT%{bash_compdir}
47009a45 222cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
a6da47b4
JK
223install -d $RPM_BUILD_ROOT%{zsh_compdir}
224cp -p contrib/completion/zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
8c352669 225
f891ae41 226# vim syntax
c590f8e8 227%if %{with vim}
f891ae41 228install -d $RPM_BUILD_ROOT%{_vimdatadir}
7db50491 229cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
f891ae41 230%{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
c590f8e8 231%endif
f891ae41 232
d88043a2
ER
233%pre
234%groupadd -g 296 docker
235
345101bd
ER
236%post
237/sbin/chkconfig --add %{name}
238%service -n %{name} restart
2e523ef0 239%systemd_post %{name}.service
345101bd
ER
240
241%preun
242if [ "$1" = "0" ]; then
243 %service -q %{name} stop
244 /sbin/chkconfig --del %{name}
245fi
2e523ef0 246%systemd_preun %{name}.service
345101bd 247
d88043a2
ER
248%postun
249if [ "$1" = "0" ]; then
250 %groupremove docker
251fi
2e523ef0 252%systemd_reload
d88043a2 253
b877f7b7
ER
254%clean
255rm -rf $RPM_BUILD_ROOT
256
257%files
258%defattr(644,root,root,755)
f4565fa4 259%doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
62b620a7 260%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
47009a45 261%attr(754,root,root) /etc/rc.d/init.d/docker
9c77b76c 262%attr(755,root,root) %{_bindir}/docker
36f21c65 263%attr(755,root,root) %{_sbindir}/docker-containerd
6a5abe01 264%attr(755,root,root) %{_sbindir}/docker-containerd-ctr
36f21c65 265%attr(755,root,root) %{_sbindir}/docker-containerd-shim
b96d9f58 266%attr(755,root,root) %{_sbindir}/docker-init
4467217c
ER
267%attr(755,root,root) %{_sbindir}/docker-proxy
268%attr(755,root,root) %{_sbindir}/docker-runc
269%attr(755,root,root) %{_sbindir}/dockerd
29baba5b 270%attr(755,root,root) %{_libexecdir}/dockerd
62b620a7 271%{systemdunitdir}/docker.service
5fcaa458 272%{systemdunitdir}/docker.socket
e4252f76 273/lib/udev/rules.d/80-docker.rules
36f21c65 274
af991618
ER
275%dir %attr(700,root,root) /var/lib/docker
276%dir %attr(700,root,root) /var/lib/docker/containers
b73b275e 277%dir %attr(700,root,root) /var/lib/docker/execdriver
af991618 278%dir %attr(700,root,root) /var/lib/docker/graph
841676f2 279%dir %attr(700,root,root) /var/lib/docker/image
b73b275e 280%dir %attr(700,root,root) /var/lib/docker/init
841676f2 281%dir %attr(700,root,root) /var/lib/docker/network
7b3be108 282%dir %attr(700,root,root) /var/lib/docker/swarm
b73b275e
ER
283%dir %attr(700,root,root) /var/lib/docker/tmp
284%dir %attr(700,root,root) /var/lib/docker/trust
285%dir %attr(700,root,root) /var/lib/docker/vfs
af991618 286%dir %attr(700,root,root) /var/lib/docker/volumes
8c352669 287
f891ae41 288%files -n bash-completion-%{name}
8c352669 289%defattr(644,root,root,755)
8c352669 290%{bash_compdir}/docker
f891ae41 291
a6da47b4
JK
292%files -n zsh-completion-%{name}
293%defattr(644,root,root,755)
294%{zsh_compdir}/_docker
295
c590f8e8 296%if %{with vim}
f891ae41
ER
297%files -n vim-syntax-%{name}
298%defattr(644,root,root,755)
7db50491 299%doc contrib/syntax/vim/{README.md,LICENSE}
f891ae41
ER
300%{_vimdatadir}/doc/dockerfile.txt
301%{_vimdatadir}/ftdetect/dockerfile.vim
302%{_vimdatadir}/syntax/dockerfile.vim
c590f8e8 303%endif
This page took 0.161952 seconds and 4 git commands to generate.