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