]> git.pld-linux.org Git - packages/docker.git/blob - docker.spec
- unconditional noarch subpackages
[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 BuildArch:      noarch
108
109 %description -n bash-completion-%{name}
110 This package provides bash-completion for Docker.
111
112 %description -n bash-completion-%{name} -l pl.UTF-8
113 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
114
115 %package -n zsh-completion-%{name}
116 Summary:        zsh completion for Docker
117 Summary(pl.UTF-8):      Uzupełnianie parametrów w zsh dla poleceń Dockera
118 Group:          Applications/Shells
119 Requires:       %{name}
120 BuildArch:      noarch
121
122 %description -n zsh-completion-%{name}
123 This package provides zsh completion for Docker.
124
125 %description -n zsh-completion-%{name} -l pl.UTF-8
126 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
127
128 %package -n vim-syntax-%{name}
129 Summary:        Vim syntax: Docker
130 Group:          Applications/Editors/Vim
131 Requires:       %{name} = %{version}-%{release}
132 Requires:       vim-rt >= 4:7.2.170
133 Obsoletes:      vim-syntax-lxc-docker < 1.1.1
134 BuildArch:      noarch
135
136 %description -n vim-syntax-%{name}
137 This plugin provides syntax highlighting in Dockerfile.
138
139 %prep
140 %setup -q %{?subver:-n %{name}-%{version}%{subver}} -a1 -a2 -a3 -a4
141 mv runc-%{runc_commit}* runc
142 mv containerd-%{containerd_commit}* containerd
143 mv libnetwork-%{libnetwork_commit}* libnetwork
144 mv tini-* tini
145 %patch0 -p1
146
147 install -d vendor/src/github.com/docker
148 ln -s $(pwd) vendor/src/github.com/docker/docker
149 ln -s $(pwd)/containerd containerd/vendor/src/github.com/docker/containerd
150 ln -s $(pwd)/libnetwork vendor/src/github.com/docker/libnetwork
151
152 %build
153 v=$(awk -F= '/^RUNC_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
154 echo "$v" | grep "^%{runc_commit}"
155 v=$(awk -F= '/^CONTAINERD_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
156 echo "$v" | grep "^%{containerd_commit}"
157 v=$(awk -F= '/^LIBNETWORK_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
158 echo "$v" | grep "^%{libnetwork_commit}"
159
160 export GOPATH=$(pwd)/vendor:$(pwd)/containerd/vendor
161 export DOCKER_GITCOMMIT="pld/%{version}"
162 # build docker-runc
163 %{__make} -C runc
164
165 # build docker-containerd
166 %{__make} -C containerd
167
168 # build docker-proxy
169 go build -ldflags="-linkmode=external" \
170         -o docker-proxy \
171         github.com/docker/libnetwork/cmd/proxy
172
173 # build docker-init
174 cd tini
175 cmake .
176 %{__make}
177 cd ..
178
179 bash -x hack/make.sh dynbinary
180 %if %{with doc}
181 man/md2man-all.sh
182 %endif
183
184 %install
185 rm -rf $RPM_BUILD_ROOT
186 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
187         $RPM_BUILD_ROOT%{_libexecdir} \
188         $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
189
190 install -p bundles/%{version}%{?subver}/dynbinary-client/docker-%{version}%{?subver} $RPM_BUILD_ROOT%{_bindir}/docker
191 install -p bundles/%{version}%{?subver}/dynbinary-daemon/dockerd-%{version}%{?subver} $RPM_BUILD_ROOT%{_sbindir}/dockerd
192
193 # install docker-runc
194 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
195
196 # install docker-containerd
197 install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd
198 install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim
199 install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-ctr
200
201 # install docker-proxy
202 install -p docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
203
204 # install docker-init
205 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
206
207 cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
208 cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
209 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
210 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
211 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
212
213 # install udev rules
214 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
215 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
216
217 # bash and zsh completion
218 install -d $RPM_BUILD_ROOT%{bash_compdir}
219 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
220 install -d $RPM_BUILD_ROOT%{zsh_compdir}
221 cp -p contrib/completion/zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
222
223 # vim syntax
224 %if %{with vim}
225 install -d $RPM_BUILD_ROOT%{_vimdatadir}
226 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
227 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
228 %endif
229
230 %pre
231 %groupadd -g 296 docker
232
233 %post
234 /sbin/chkconfig --add %{name}
235 %service -n %{name} restart
236 %systemd_post %{name}.service
237
238 %preun
239 if [ "$1" = "0" ]; then
240         %service -q %{name} stop
241         /sbin/chkconfig --del %{name}
242 fi
243 %systemd_preun %{name}.service
244
245 %postun
246 if [ "$1" = "0" ]; then
247         %groupremove docker
248 fi
249 %systemd_reload
250
251 %clean
252 rm -rf $RPM_BUILD_ROOT
253
254 %files
255 %defattr(644,root,root,755)
256 %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
257 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
258 %attr(754,root,root) /etc/rc.d/init.d/docker
259 %attr(755,root,root) %{_bindir}/docker
260 %attr(755,root,root) %{_sbindir}/docker-containerd
261 %attr(755,root,root) %{_sbindir}/docker-containerd-ctr
262 %attr(755,root,root) %{_sbindir}/docker-containerd-shim
263 %attr(755,root,root) %{_sbindir}/docker-init
264 %attr(755,root,root) %{_sbindir}/docker-proxy
265 %attr(755,root,root) %{_sbindir}/docker-runc
266 %attr(755,root,root) %{_sbindir}/dockerd
267 %attr(755,root,root) %{_libexecdir}/dockerd
268 %{systemdunitdir}/docker.service
269 %{systemdunitdir}/docker.socket
270 /lib/udev/rules.d/80-docker.rules
271
272 %dir %attr(700,root,root) /var/lib/docker
273 %dir %attr(700,root,root) /var/lib/docker/containers
274 %dir %attr(700,root,root) /var/lib/docker/execdriver
275 %dir %attr(700,root,root) /var/lib/docker/graph
276 %dir %attr(700,root,root) /var/lib/docker/image
277 %dir %attr(700,root,root) /var/lib/docker/init
278 %dir %attr(700,root,root) /var/lib/docker/network
279 %dir %attr(700,root,root) /var/lib/docker/swarm
280 %dir %attr(700,root,root) /var/lib/docker/tmp
281 %dir %attr(700,root,root) /var/lib/docker/trust
282 %dir %attr(700,root,root) /var/lib/docker/vfs
283 %dir %attr(700,root,root) /var/lib/docker/volumes
284
285 %files -n bash-completion-%{name}
286 %defattr(644,root,root,755)
287 %{bash_compdir}/docker
288
289 %files -n zsh-completion-%{name}
290 %defattr(644,root,root,755)
291 %{zsh_compdir}/_docker
292
293 %if %{with vim}
294 %files -n vim-syntax-%{name}
295 %defattr(644,root,root,755)
296 %doc contrib/syntax/vim/{README.md,LICENSE}
297 %{_vimdatadir}/doc/dockerfile.txt
298 %{_vimdatadir}/ftdetect/dockerfile.vim
299 %{_vimdatadir}/syntax/dockerfile.vim
300 %endif
This page took 0.109075 seconds and 4 git commands to generate.