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