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