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