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: bc5e2aa1fbcd3ab8fac1a4f6a4613a16
14 URL: http://github.com/dotcloud/docker
15 BuildRequires: device-mapper-devel
16 BuildRequires: golang >= 1.1.2
17 BuildRequires: rpmbuild(macros) >= 1.228
18 BuildRequires: sqlite3-devel >= 3.7.9
19 Requires(post,preun): /sbin/chkconfig
20 Requires(postun): /usr/sbin/groupdel
21 Requires(pre): /usr/bin/getgid
22 Requires(pre): /usr/sbin/groupadd
23 Requires: iproute2 >= 3.5
26 Requires: rc-scripts >= 0.4.0.10
27 Requires: tar >= 1:1.26
28 Requires: uname(release) >= 3.8
30 Suggests: git-core >= 1.7
33 Provides: group(docker)
34 Patch0: lxc-docker-nosha.patch
35 # only runs on x64 hosts for now:
36 # https://github.com/dotcloud/docker/issues/136
37 # https://github.com/dotcloud/docker/issues/611
38 ExclusiveArch: %{x8664}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define bash_compdir %{_datadir}/bash-completion/completions
42 %define _vimdatadir %{_datadir}/vim
44 # binary stripped or something
45 %define _enable_debug_packages 0
48 Docker complements LXC with a high-level API which operates at the
49 process level. It runs unix processes with strong guarantees of
50 isolation and repeatability across servers.
52 Docker is a great building block for automating distributed systems:
53 large-scale web deployments, database clusters, continuous deployment
54 systems, private PaaS, service-oriented architectures, etc.
56 %package -n bash-completion-%{name}
57 Summary: bash-completion for Docker
58 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
59 Group: Applications/Shells
61 Requires: bash-completion >= 2.0
62 %if "%{_rpmversion}" >= "5"
66 %description -n bash-completion-lxc-docker
67 This package provides bash-completion for Docker.
69 %description -n bash-completion-lxc-docker -l pl.UTF-8
70 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
72 %package -n vim-syntax-%{name}
73 Summary: Vim syntax: Docker
74 Group: Applications/Editors/Vim
75 Requires: %{name} = %{version}-%{release}
76 Requires: vim-rt >= 4:7.2.170
77 %if "%{_rpmversion}" >= "5"
81 %description -n vim-syntax-%{name}
82 This plugin provides syntax highlighting in Dockerfile.
85 %setup -q -n docker-%{version}
88 install -d vendor/src/github.com/dotcloud
89 ln -s $(pwd) vendor/src/github.com/dotcloud/docker
92 export GOPATH=$(pwd)/vendor
96 GITCOMMIT=pld-%{release} # use RPM_PACKAGE_RELEASE for this
97 # Use these flags when compiling the tests and final binary
98 # without '-d', as that fails now
99 LDFLAGS="-X main.GITCOMMIT $GITCOMMIT -X main.VERSION $VERSION -w"
100 go build -v -ldflags "$LDFLAGS" -a github.com/dotcloud/docker/docker
101 go build -v -ldflags "$LDFLAGS" -a ../dockerinit/dockerinit.go
104 rm -rf $RPM_BUILD_ROOT
105 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,/var/lib/docker/{containers,graph,volumes}}
106 install -p build/docker $RPM_BUILD_ROOT%{_bindir}/lxc-docker
107 install -p build/dockerinit $RPM_BUILD_ROOT%{_bindir}/dockerinit
108 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc-docker
109 ln -s lxc-docker $RPM_BUILD_ROOT%{_bindir}/docker
110 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
113 install -d $RPM_BUILD_ROOT%{bash_compdir}
114 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/lxc-docker
115 ln -s lxc-docker $RPM_BUILD_ROOT%{bash_compdir}/docker
118 install -d $RPM_BUILD_ROOT%{_vimdatadir}
119 cp -a contrib/vim-syntax/* $RPM_BUILD_ROOT%{_vimdatadir}
120 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
123 %groupadd -g 296 docker
126 /sbin/chkconfig --add %{name}
127 %service -n %{name} restart
130 if [ "$1" = "0" ]; then
131 %service -q %{name} stop
132 /sbin/chkconfig --del %{name}
136 if [ "$1" = "0" ]; then
141 rm -rf $RPM_BUILD_ROOT
144 %defattr(644,root,root,755)
145 %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS
146 %attr(754,root,root) /etc/rc.d/init.d/lxc-docker
147 %attr(755,root,root) %{_bindir}/lxc-docker
148 %attr(755,root,root) %{_bindir}/docker
149 %attr(755,root,root) %{_bindir}/dockerinit
150 #%{_mandir}/man1/lxc-docker.1*
151 %dir %attr(700,root,root) /var/lib/docker
152 %dir %attr(700,root,root) /var/lib/docker/containers
153 %dir %attr(700,root,root) /var/lib/docker/graph
154 %dir %attr(700,root,root) /var/lib/docker/volumes
156 %files -n bash-completion-%{name}
157 %defattr(644,root,root,755)
158 %{bash_compdir}/lxc-docker
159 %{bash_compdir}/docker
161 %files -n vim-syntax-%{name}
162 %defattr(644,root,root,755)
163 %doc contrib/vim-syntax/{README.md,LICENSE}
164 %{_vimdatadir}/doc/dockerfile.txt
165 %{_vimdatadir}/ftdetect/dockerfile.vim
166 %{_vimdatadir}/syntax/dockerfile.vim