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