#
# Conditional build:
%bcond_with tests # build without tests
+%bcond_with vim # build vim syntax package
-Summary: Docker: the Linux container engine
+Summary: Docker: the open-source application container engine
Name: docker
-Version: 1.1.2
-Release: 0.1
+Version: 1.6.2
+Release: 1
License: Apache v2.0
Group: Applications/System
-Source0: https://github.com/dotcloud/docker/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 2e02d5288ecd6cbd9a6c3e4fd3b81ffc
+Source0: https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 81a1a015ec0520d739ec721f8295d94f
Source5: %{name}.service
Source6: %{name}.init
-URL: http://github.com/dotcloud/docker
+Source7: %{name}.sysconfig
+URL: https://github.com/docker/docker
BuildRequires: btrfs-progs-devel
BuildRequires: device-mapper-devel
-BuildRequires: golang >= 1.2.1
+BuildRequires: golang >= 1.3.1
BuildRequires: rpmbuild(macros) >= 1.228
BuildRequires: sqlite3-devel >= 3.7.9
Requires(post,preun): /sbin/chkconfig
Requires(pre): /usr/sbin/groupadd
Requires: iproute2 >= 3.5
Requires: iptables
-Requires: lxc >= 0.8
Requires: rc-scripts >= 0.4.0.10
Requires: tar >= 1:1.26
Requires: uname(release) >= 3.8
Obsoletes: lxc-docker < 1.1.1
Patch0: lxc-%{name}-nosha.patch
# only runs on x64 hosts for now:
-# https://github.com/dotcloud/docker/issues/136
-# https://github.com/dotcloud/docker/issues/611
+# https://github.com/docker/docker/issues/136
+# https://github.com/docker/docker/issues/611
ExclusiveArch: %{x8664}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _enable_debug_packages 0
%description
-Docker complements LXC with a high-level API which operates at the
-process level. It runs unix processes with strong guarantees of
-isolation and repeatability across servers.
-
-Docker is a great building block for automating distributed systems:
-large-scale web deployments, database clusters, continuous deployment
-systems, private PaaS, service-oriented architectures, etc.
+Docker is an open source project to pack, ship and run any application
+as a lightweight container
+
+Docker containers are both hardware-agnostic and platform-agnostic.
+This means that they can run anywhere, from your laptop to the largest
+EC2 compute instance and everything in between - and they don't
+require that you use a particular language, framework or packaging
+system. That makes them great building blocks for deploying and
+scaling web apps, databases and backend services without depending on
+a particular stack or provider.
+
+Docker is an open-source implementation of the deployment engine which
+powers dotCloud, a popular Platform-as-a-Service. It benefits directly
+from the experience accumulated over several years of large-scale
+operation and support of hundreds of thousands of applications and
+databases.
%package -n bash-completion-%{name}
Summary: bash-completion for Docker
%setup -q
%patch0 -p1
-install -d vendor/src/github.com/dotcloud
-ln -s $(pwd) vendor/src/github.com/dotcloud/docker
+install -d vendor/src/github.com/docker
+ln -s $(pwd) vendor/src/github.com/docker/docker
%build
export GOPATH=$(pwd)/vendor
-install -d build
-cd build
-VERSION=%{version}
-GITCOMMIT=pld-%{version}-%{release} # use RPM_PACKAGE_RELEASE for this
-# Use these flags when compiling the tests and final binary
-# without '-d', as that fails now
-LDFLAGS="-X github.com/dotcloud/docker/dockerversion.GITCOMMIT $GITCOMMIT -X github.com/dotcloud/docker/dockerversion.VERSION $VERSION -w"
-go build -v -ldflags "$LDFLAGS" -a github.com/dotcloud/docker/docker
-go build -v -ldflags "$LDFLAGS" -a ../dockerinit/dockerinit.go
+export DOCKER_GITCOMMIT="pld/%{version}"
+
+DEBUG=1 hack/make.sh dynbinary
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,%{systemdunitdir},/var/lib/docker/{containers,graph,volumes}}
-install -p build/docker $RPM_BUILD_ROOT%{_bindir}/docker
-install -p build/dockerinit $RPM_BUILD_ROOT%{_bindir}/dockerinit
-install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
+ $RPM_BUILD_ROOT/var/lib/docker/{aufs,containers,execdriver,graph,init,tmp,trust,vfs,volumes}
+
+install -p bundles/%{version}/dynbinary/docker-%{version} $RPM_BUILD_ROOT%{_bindir}/docker
+install -p bundles/%{version}/dynbinary/dockerinit-%{version} $RPM_BUILD_ROOT%{_bindir}/dockerinit
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
+cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/docker
#cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
+# install udev rules
+install -d $RPM_BUILD_ROOT/lib/udev/rules.d
+cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
+
# bash completion
install -d $RPM_BUILD_ROOT%{bash_compdir}
cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
# vim syntax
+%if %{with vim}
install -d $RPM_BUILD_ROOT%{_vimdatadir}
cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
%{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
+%endif
%pre
%groupadd -g 296 docker
%files
%defattr(644,root,root,755)
-%doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS
-%{systemdunitdir}/docker.service
+%doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
%attr(754,root,root) /etc/rc.d/init.d/docker
%attr(755,root,root) %{_bindir}/docker
%attr(755,root,root) %{_bindir}/dockerinit
+%{systemdunitdir}/docker.service
+/lib/udev/rules.d/80-docker.rules
#%{_mandir}/man1/lxc-docker.1*
+
%dir %attr(700,root,root) /var/lib/docker
+%dir %attr(700,root,root) /var/lib/docker/aufs
%dir %attr(700,root,root) /var/lib/docker/containers
+%dir %attr(700,root,root) /var/lib/docker/execdriver
%dir %attr(700,root,root) /var/lib/docker/graph
+%dir %attr(700,root,root) /var/lib/docker/init
+%dir %attr(700,root,root) /var/lib/docker/tmp
+%dir %attr(700,root,root) /var/lib/docker/trust
+%dir %attr(700,root,root) /var/lib/docker/vfs
%dir %attr(700,root,root) /var/lib/docker/volumes
%files -n bash-completion-%{name}
%defattr(644,root,root,755)
%{bash_compdir}/docker
+%if %{with vim}
%files -n vim-syntax-%{name}
%defattr(644,root,root,755)
%doc contrib/syntax/vim/{README.md,LICENSE}
%{_vimdatadir}/doc/dockerfile.txt
%{_vimdatadir}/ftdetect/dockerfile.vim
%{_vimdatadir}/syntax/dockerfile.vim
+%endif