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