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