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