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