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