3 %bcond_with tests # build without tests
4 %bcond_with vim # build vim syntax package
5 %bcond_with doc # build manual pages
8 # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
10 Summary: Docker: the open-source application container engine
15 Group: Applications/System
16 Source0: https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5: ada4a756f71886049ad793cab8787de8
19 Source5: %{name}.service
21 Source7: %{name}.sysconfig
22 URL: http://www.docker.com/
23 BuildRequires: btrfs-progs-devel >= 3.16.1
24 BuildRequires: device-mapper-devel >= 2.02.89
25 BuildRequires: golang >= 1.4
26 BuildRequires: libseccomp-devel >= 2.2.1
27 BuildRequires: rpmbuild(macros) >= 1.228
28 BuildRequires: sqlite3-devel >= 3.7.9
29 Requires(post,preun): /sbin/chkconfig
30 Requires(postun): /usr/sbin/groupdel
31 Requires(pre): /usr/bin/getgid
32 Requires(pre): /usr/sbin/groupadd
33 Requires: iproute2 >= 3.5
35 Requires: rc-scripts >= 0.4.0.10
36 Requires: tar >= 1:1.26
37 Requires: uname(release) >= 3.8
39 Suggests: git-core >= 1.7
42 Provides: group(docker)
43 Obsoletes: lxc-docker < 1.1.1
44 Patch0: lxc-%{name}-nosha.patch
45 # only runs on x64 hosts for now:
46 # https://github.com/docker/docker/issues/136
47 # https://github.com/docker/docker/issues/611
48 ExclusiveArch: %{x8664}
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 %define bash_compdir %{_datadir}/bash-completion/completions
52 %define _vimdatadir %{_datadir}/vim
53 %define _libexecdir %{_prefix}/lib
55 # binary stripped or something
56 %define _enable_debug_packages 0
59 Docker is an open source project to pack, ship and run any application
60 as a lightweight container
62 Docker containers are both hardware-agnostic and platform-agnostic.
63 This means that they can run anywhere, from your laptop to the largest
64 EC2 compute instance and everything in between - and they don't
65 require that you use a particular language, framework or packaging
66 system. That makes them great building blocks for deploying and
67 scaling web apps, databases and backend services without depending on
68 a particular stack or provider.
70 Docker is an open-source implementation of the deployment engine which
71 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
72 from the experience accumulated over several years of large-scale
73 operation and support of hundreds of thousands of applications and
76 %package -n bash-completion-%{name}
77 Summary: bash-completion for Docker
78 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
79 Group: Applications/Shells
81 Requires: bash-completion >= 2.0
82 Obsoletes: bash-completion-lxc-docker < 1.1.1
83 %if "%{_rpmversion}" >= "5"
87 %description -n bash-completion-%{name}
88 This package provides bash-completion for Docker.
90 %description -n bash-completion-%{name} -l pl.UTF-8
91 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
93 %package -n vim-syntax-%{name}
94 Summary: Vim syntax: Docker
95 Group: Applications/Editors/Vim
96 Requires: %{name} = %{version}-%{release}
97 Requires: vim-rt >= 4:7.2.170
98 Obsoletes: vim-syntax-lxc-docker < 1.1.1
99 %if "%{_rpmversion}" >= "5"
103 %description -n vim-syntax-%{name}
104 This plugin provides syntax highlighting in Dockerfile.
108 #%patch0 -p1 why is this patch needed?
110 install -d vendor/src/github.com/docker
111 ln -s $(pwd) vendor/src/github.com/docker/docker
114 export GOPATH=$(pwd)/vendor
115 export DOCKER_GITCOMMIT="pld/%{version}"
117 bash -x hack/make.sh dynbinary
123 rm -rf $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
125 $RPM_BUILD_ROOT%{_libexecdir} \
126 $RPM_BUILD_ROOT/var/lib/docker/{aufs,containers,execdriver,graph,image,init,network,overlay,tmp,trust,vfs,volumes}
128 install -p bundles/%{version}/dynbinary/docker-%{version} $RPM_BUILD_ROOT%{_bindir}/docker
129 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
130 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
131 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/docker
132 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/docker
133 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
136 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
137 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
140 install -d $RPM_BUILD_ROOT%{bash_compdir}
141 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
145 install -d $RPM_BUILD_ROOT%{_vimdatadir}
146 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
147 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
151 %groupadd -g 296 docker
154 /sbin/chkconfig --add %{name}
155 %service -n %{name} restart
158 if [ "$1" = "0" ]; then
159 %service -q %{name} stop
160 /sbin/chkconfig --del %{name}
164 if [ "$1" = "0" ]; then
169 rm -rf $RPM_BUILD_ROOT
172 %defattr(644,root,root,755)
173 %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
174 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
175 %attr(754,root,root) /etc/rc.d/init.d/docker
176 %attr(755,root,root) %{_bindir}/docker
177 %attr(755,root,root) %{_libexecdir}/docker
178 %{systemdunitdir}/docker.service
179 /lib/udev/rules.d/80-docker.rules
180 #%{_mandir}/man1/lxc-docker.1*
182 %dir %attr(700,root,root) /var/lib/docker
183 %dir %attr(700,root,root) /var/lib/docker/aufs
184 %dir %attr(700,root,root) /var/lib/docker/containers
185 %dir %attr(700,root,root) /var/lib/docker/execdriver
186 %dir %attr(700,root,root) /var/lib/docker/graph
187 %dir %attr(700,root,root) /var/lib/docker/image
188 %dir %attr(700,root,root) /var/lib/docker/init
189 %dir %attr(700,root,root) /var/lib/docker/network
190 %dir %attr(700,root,root) /var/lib/docker/overlay
191 %dir %attr(700,root,root) /var/lib/docker/tmp
192 %dir %attr(700,root,root) /var/lib/docker/trust
193 %dir %attr(700,root,root) /var/lib/docker/vfs
194 %dir %attr(700,root,root) /var/lib/docker/volumes
196 %files -n bash-completion-%{name}
197 %defattr(644,root,root,755)
198 %{bash_compdir}/docker
201 %files -n vim-syntax-%{name}
202 %defattr(644,root,root,755)
203 %doc contrib/syntax/vim/{README.md,LICENSE}
204 %{_vimdatadir}/doc/dockerfile.txt
205 %{_vimdatadir}/ftdetect/dockerfile.vim
206 %{_vimdatadir}/syntax/dockerfile.vim