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 # only runs on x64 hosts for now:
35 # https://github.com/dotcloud/docker/issues/136
36 # https://github.com/dotcloud/docker/issues/611
37 ExclusiveArch: %{x8664}
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define bash_compdir %{_datadir}/bash-completion/completions
41 %define _vimdatadir %{_datadir}/vim
43 # binary stripped or something
44 %define _enable_debug_packages 0
47 Docker complements LXC with a high-level API which operates at the
48 process level. It runs unix processes with strong guarantees of
49 isolation and repeatability across servers.
51 Docker is a great building block for automating distributed systems:
52 large-scale web deployments, database clusters, continuous deployment
53 systems, private PaaS, service-oriented architectures, etc.
55 %package -n bash-completion-%{name}
56 Summary: bash-completion for Docker
57 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
58 Group: Applications/Shells
60 Requires: bash-completion >= 2.0
61 %if "%{_rpmversion}" >= "5"
65 %description -n bash-completion-lxc-docker
66 This package provides bash-completion for Docker.
68 %description -n bash-completion-lxc-docker -l pl.UTF-8
69 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
71 %package -n vim-syntax-%{name}
72 Summary: Vim syntax: Docker
73 Group: Applications/Editors/Vim
74 Requires: %{name} = %{version}-%{release}
75 Requires: vim-rt >= 4:7.2.170
76 %if "%{_rpmversion}" >= "5"
80 %description -n vim-syntax-%{name}
81 This plugin provides syntax highlighting in Dockerfile.
84 %setup -q -n docker-%{version}
86 install -d vendor/src/github.com/dotcloud
87 ln -s $(pwd) vendor/src/github.com/dotcloud/docker
90 export GOPATH=$(pwd)/vendor
94 GITCOMMIT=pld-%{release} # use RPM_PACKAGE_RELEASE for this
95 # Use these flags when compiling the tests and final binary
96 # without '-d', as that fails now
97 LDFLAGS="-X main.GITCOMMIT $GITCOMMIT -X main.VERSION $VERSION -w"
98 go build -v -ldflags "$LDFLAGS" -a github.com/dotcloud/docker/docker
99 go build -v -ldflags "$LDFLAGS" -a ../dockerinit/dockerinit.go
102 rm -rf $RPM_BUILD_ROOT
103 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,/var/lib/docker/{containers,graph,volumes}}
104 install -p build/docker $RPM_BUILD_ROOT%{_bindir}/lxc-docker
105 install -p build/dockerinit $RPM_BUILD_ROOT%{_bindir}/dockerinit
106 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc-docker
107 ln -s lxc-docker $RPM_BUILD_ROOT%{_bindir}/docker
108 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
111 install -d $RPM_BUILD_ROOT%{bash_compdir}
112 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/lxc-docker
113 ln -s lxc-docker $RPM_BUILD_ROOT%{bash_compdir}/docker
116 install -d $RPM_BUILD_ROOT%{_vimdatadir}
117 cp -a contrib/vim-syntax/* $RPM_BUILD_ROOT%{_vimdatadir}
118 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
121 %groupadd -g 296 docker
124 /sbin/chkconfig --add %{name}
125 %service -n %{name} restart
128 if [ "$1" = "0" ]; then
129 %service -q %{name} stop
130 /sbin/chkconfig --del %{name}
134 if [ "$1" = "0" ]; then
139 rm -rf $RPM_BUILD_ROOT
142 %defattr(644,root,root,755)
143 %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS
144 %attr(754,root,root) /etc/rc.d/init.d/lxc-docker
145 %attr(755,root,root) %{_bindir}/lxc-docker
146 %attr(755,root,root) %{_bindir}/docker
147 %attr(755,root,root) %{_bindir}/dockerinit
148 #%{_mandir}/man1/lxc-docker.1*
149 %dir %attr(700,root,root) /var/lib/docker
150 %dir %attr(700,root,root) /var/lib/docker/containers
151 %dir %attr(700,root,root) /var/lib/docker/graph
152 %dir %attr(700,root,root) /var/lib/docker/volumes
154 %files -n bash-completion-%{name}
155 %defattr(644,root,root,755)
156 %{bash_compdir}/lxc-docker
157 %{bash_compdir}/docker
159 %files -n vim-syntax-%{name}
160 %defattr(644,root,root,755)
161 %doc contrib/vim-syntax/{README.md,LICENSE}
162 %{_vimdatadir}/doc/dockerfile.txt
163 %{_vimdatadir}/ftdetect/dockerfile.vim
164 %{_vimdatadir}/syntax/dockerfile.vim