3 %bcond_with tests # build without tests
4 %bcond_with vim # build vim syntax package
6 Summary: Docker: the open-source application container engine
11 Group: Applications/System
12 Source0: https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
13 # Source0-md5: 19f027d937069b104dfb0a4a01f2e30f
14 Source5: %{name}.service
16 Source7: %{name}.sysconfig
17 URL: https://github.com/docker/docker
18 BuildRequires: btrfs-progs-devel
19 BuildRequires: device-mapper-devel
20 BuildRequires: golang >= 1.3.1
21 BuildRequires: rpmbuild(macros) >= 1.228
22 BuildRequires: sqlite3-devel >= 3.7.9
23 Requires(post,preun): /sbin/chkconfig
24 Requires(postun): /usr/sbin/groupdel
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/sbin/groupadd
27 Requires: iproute2 >= 3.5
29 Requires: rc-scripts >= 0.4.0.10
30 Requires: tar >= 1:1.26
31 Requires: uname(release) >= 3.8
33 Suggests: git-core >= 1.7
36 Provides: group(docker)
37 Obsoletes: lxc-docker < 1.1.1
38 Patch0: lxc-%{name}-nosha.patch
39 # only runs on x64 hosts for now:
40 # https://github.com/docker/docker/issues/136
41 # https://github.com/docker/docker/issues/611
42 ExclusiveArch: %{x8664}
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define bash_compdir %{_datadir}/bash-completion/completions
46 %define _vimdatadir %{_datadir}/vim
48 # binary stripped or something
49 %define _enable_debug_packages 0
52 Docker is an open source project to pack, ship and run any application
53 as a lightweight container
55 Docker containers are both hardware-agnostic and platform-agnostic.
56 This means that they can run anywhere, from your laptop to the largest
57 EC2 compute instance and everything in between - and they don't
58 require that you use a particular language, framework or packaging
59 system. That makes them great building blocks for deploying and
60 scaling web apps, databases and backend services without depending on
61 a particular stack or provider.
63 Docker is an open-source implementation of the deployment engine which
64 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
65 from the experience accumulated over several years of large-scale
66 operation and support of hundreds of thousands of applications and
69 %package -n bash-completion-%{name}
70 Summary: bash-completion for Docker
71 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
72 Group: Applications/Shells
74 Requires: bash-completion >= 2.0
75 Obsoletes: bash-completion-lxc-docker < 1.1.1
76 %if "%{_rpmversion}" >= "5"
80 %description -n bash-completion-%{name}
81 This package provides bash-completion for Docker.
83 %description -n bash-completion-%{name} -l pl.UTF-8
84 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
86 %package -n vim-syntax-%{name}
87 Summary: Vim syntax: Docker
88 Group: Applications/Editors/Vim
89 Requires: %{name} = %{version}-%{release}
90 Requires: vim-rt >= 4:7.2.170
91 Obsoletes: vim-syntax-lxc-docker < 1.1.1
92 %if "%{_rpmversion}" >= "5"
96 %description -n vim-syntax-%{name}
97 This plugin provides syntax highlighting in Dockerfile.
103 install -d vendor/src/github.com/docker
104 ln -s $(pwd) vendor/src/github.com/docker/docker
107 export GOPATH=$(pwd)/vendor
108 export DOCKER_GITCOMMIT="pld/%{version}"
110 DEBUG=1 hack/make.sh dynbinary
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
115 $RPM_BUILD_ROOT/var/lib/docker/{aufs,containers,execdriver,graph,init,tmp,trust,vfs,volumes}
117 install -p bundles/%{version}/dynbinary/docker-%{version} $RPM_BUILD_ROOT%{_bindir}/docker
118 install -p bundles/%{version}/dynbinary/dockerinit-%{version} $RPM_BUILD_ROOT%{_bindir}/dockerinit
119 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
120 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
121 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/docker
122 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
125 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
126 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
129 install -d $RPM_BUILD_ROOT%{bash_compdir}
130 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
134 install -d $RPM_BUILD_ROOT%{_vimdatadir}
135 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
136 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
140 %groupadd -g 296 docker
143 /sbin/chkconfig --add %{name}
144 %service -n %{name} restart
147 if [ "$1" = "0" ]; then
148 %service -q %{name} stop
149 /sbin/chkconfig --del %{name}
153 if [ "$1" = "0" ]; then
158 rm -rf $RPM_BUILD_ROOT
161 %defattr(644,root,root,755)
162 %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
163 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
164 %attr(754,root,root) /etc/rc.d/init.d/docker
165 %attr(755,root,root) %{_bindir}/docker
166 %attr(755,root,root) %{_bindir}/dockerinit
167 %{systemdunitdir}/docker.service
168 /lib/udev/rules.d/80-docker.rules
169 #%{_mandir}/man1/lxc-docker.1*
171 %dir %attr(700,root,root) /var/lib/docker
172 %dir %attr(700,root,root) /var/lib/docker/aufs
173 %dir %attr(700,root,root) /var/lib/docker/containers
174 %dir %attr(700,root,root) /var/lib/docker/execdriver
175 %dir %attr(700,root,root) /var/lib/docker/graph
176 %dir %attr(700,root,root) /var/lib/docker/init
177 %dir %attr(700,root,root) /var/lib/docker/tmp
178 %dir %attr(700,root,root) /var/lib/docker/trust
179 %dir %attr(700,root,root) /var/lib/docker/vfs
180 %dir %attr(700,root,root) /var/lib/docker/volumes
182 %files -n bash-completion-%{name}
183 %defattr(644,root,root,755)
184 %{bash_compdir}/docker
187 %files -n vim-syntax-%{name}
188 %defattr(644,root,root,755)
189 %doc contrib/syntax/vim/{README.md,LICENSE}
190 %{_vimdatadir}/doc/dockerfile.txt
191 %{_vimdatadir}/ftdetect/dockerfile.vim
192 %{_vimdatadir}/syntax/dockerfile.vim