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