3 %bcond_with tests # build without tests
5 Summary: Docker: the Linux container engine
10 Group: Applications/System
11 Source0: https://github.com/dotcloud/docker/archive/v%{version}/docker-%{version}.tar.gz
12 # Source0-md5: c70bb4f56ef1fee069964a5f8c7c26f9
14 URL: http://github.com/dotcloud/docker
15 BuildRequires: golang >= 1.1.2
16 BuildRequires: rpmbuild(macros) >= 1.228
17 Requires(post,preun): /sbin/chkconfig
18 Requires(postun): /usr/sbin/groupdel
19 Requires(pre): /usr/bin/getgid
20 Requires(pre): /usr/sbin/groupadd
21 Requires: iproute2 >= 3.5
24 Requires: rc-scripts >= 0.4.0.10
25 Requires: tar >= 1:1.26
26 Requires: uname(release) >= 3.8
28 Suggests: git-core >= 1.7
31 Provides: group(docker)
32 # only runs on x64 hosts for now:
33 # https://github.com/dotcloud/docker/issues/136
34 # https://github.com/dotcloud/docker/issues/611
35 ExclusiveArch: %{x8664}
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 %define bash_compdir %{_datadir}/bash-completion/completions
39 %define _vimdatadir %{_datadir}/vim
41 # binary stripped or something
42 %define _enable_debug_packages 0
45 Docker complements LXC with a high-level API which operates at the
46 process level. It runs unix processes with strong guarantees of
47 isolation and repeatability across servers.
49 Docker is a great building block for automating distributed systems:
50 large-scale web deployments, database clusters, continuous deployment
51 systems, private PaaS, service-oriented architectures, etc.
53 %package -n bash-completion-%{name}
54 Summary: bash-completion for Docker
55 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
56 Group: Applications/Shells
58 Requires: bash-completion >= 2.0
59 %if "%{_rpmversion}" >= "5"
63 %description -n bash-completion-lxc-docker
64 This package provides bash-completion for Docker.
66 %description -n bash-completion-lxc-docker -l pl.UTF-8
67 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
69 %package -n vim-syntax-%{name}
70 Summary: Vim syntax: Docker
71 Group: Applications/Editors/Vim
72 Requires: %{name} = %{version}-%{release}
73 Requires: vim-rt >= 4:7.2.170
74 %if "%{_rpmversion}" >= "5"
78 %description -n vim-syntax-%{name}
79 This plugin provides syntax highlighting in Dockerfile.
82 %setup -q -n docker-%{version}
84 install -d vendor/src/github.com/dotcloud
85 ln -s $(pwd) vendor/src/github.com/dotcloud/docker
88 export GOPATH=$(pwd)/vendor
92 GITCOMMIT=pld-%{release} # use RPM_PACKAGE_RELEASE for this
93 # Use these flags when compiling the tests and final binary
94 # without '-d', as that fails now
95 LDFLAGS="-X main.GITCOMMIT $GITCOMMIT -X main.VERSION $VERSION -w"
96 go build -v -ldflags "$LDFLAGS" -a github.com/dotcloud/docker/docker
99 rm -rf $RPM_BUILD_ROOT
100 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,/var/lib/docker/{containers,graph,volumes}}
101 install -p build/docker $RPM_BUILD_ROOT%{_bindir}/lxc-docker
102 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc-docker
103 ln -s lxc-docker $RPM_BUILD_ROOT%{_bindir}/docker
104 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
107 install -d $RPM_BUILD_ROOT%{bash_compdir}
108 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/lxc-docker
109 ln -s lxc-docker $RPM_BUILD_ROOT%{bash_compdir}/docker
112 install -d $RPM_BUILD_ROOT%{_vimdatadir}
113 cp -a contrib/vim-syntax/* $RPM_BUILD_ROOT%{_vimdatadir}
114 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
117 %groupadd -g 296 docker
120 /sbin/chkconfig --add %{name}
121 %service -n %{name} restart
124 if [ "$1" = "0" ]; then
125 %service -q %{name} stop
126 /sbin/chkconfig --del %{name}
130 if [ "$1" = "0" ]; then
135 rm -rf $RPM_BUILD_ROOT
138 %defattr(644,root,root,755)
139 %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS
140 %attr(754,root,root) /etc/rc.d/init.d/lxc-docker
141 %attr(755,root,root) %{_bindir}/lxc-docker
142 %attr(755,root,root) %{_bindir}/docker
143 #%{_mandir}/man1/lxc-docker.1*
144 %dir %attr(700,root,root) /var/lib/docker
145 %dir %attr(700,root,root) /var/lib/docker/containers
146 %dir %attr(700,root,root) /var/lib/docker/graph
147 %dir %attr(700,root,root) /var/lib/docker/volumes
149 %files -n bash-completion-%{name}
150 %defattr(644,root,root,755)
151 %{bash_compdir}/lxc-docker
152 %{bash_compdir}/docker
154 %files -n vim-syntax-%{name}
155 %defattr(644,root,root,755)
156 %doc contrib/vim-syntax/{README.md,LICENSE}
157 %{_vimdatadir}/doc/dockerfile.txt
158 %{_vimdatadir}/ftdetect/dockerfile.vim
159 %{_vimdatadir}/syntax/dockerfile.vim