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