2014-08-01 11:48:31 +02:00
|
|
|
#
|
2014-07-17 17:31:28 +02:00
|
|
|
# spec file for package docker
|
2014-08-01 11:48:31 +02:00
|
|
|
#
|
2015-04-10 09:50:51 +02:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2014-07-17 17:31:28 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2014-08-01 11:48:31 +02:00
|
|
|
|
2015-07-15 10:32:13 +02:00
|
|
|
%define git_version 786b29d
|
2015-06-26 16:30:44 +02:00
|
|
|
%define go_arches %ix86 x86_64
|
2014-07-17 17:31:28 +02:00
|
|
|
Name: docker
|
2015-08-13 11:00:13 +02:00
|
|
|
Version: 1.8.1
|
2014-07-17 17:31:28 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: The Linux container runtime
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Management
|
|
|
|
Url: http://www.docker.io
|
|
|
|
Source: %{name}-%{version}.tar.bz2
|
|
|
|
Source1: docker.service
|
|
|
|
Source3: 80-docker.rules
|
|
|
|
Source4: sysconfig.docker
|
2015-05-15 07:44:24 +02:00
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1320
|
2014-07-17 17:31:28 +02:00
|
|
|
Source5: docker.socket
|
2015-05-15 07:44:24 +02:00
|
|
|
%else
|
|
|
|
Source5: docker_systemd_lt_214.socket
|
|
|
|
%endif
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
Source6: docker-rpmlintrc
|
2014-08-16 15:38:01 +02:00
|
|
|
Source7: README_SUSE.md
|
2015-06-05 17:24:58 +02:00
|
|
|
# TODO: remove once we figure out what is wrong with iptables on ppc64le
|
|
|
|
Source100: sysconfig.docker.ppc64le
|
2015-06-22 11:09:23 +02:00
|
|
|
Patch0: fix-docker-init.patch
|
2014-09-12 17:04:18 +02:00
|
|
|
# PATCH-FIX-OPENSUSE libcontainer-apparmor-fixes.patch -- mount rules aren't supported in our apparmor
|
|
|
|
Patch1: libcontainer-apparmor-fixes.patch
|
2015-06-05 17:24:58 +02:00
|
|
|
# Required to overcome some limitations of gcc-go: https://groups.google.com/forum/#!msg/golang-nuts/SlGCPYkjxo4/4DjcjXRCqAkJ
|
|
|
|
# Right now docker passes the sha1sum of the dockerinit binary to the docker binary at build time
|
|
|
|
# We cannot do that, right now a quick and really dirty way to get it running is
|
|
|
|
# to simply disable this check
|
|
|
|
Patch100: ignore-dockerinit-checksum.patch
|
|
|
|
Patch101: gcc-go-build-static-libgo.patch
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: bash-completion
|
|
|
|
BuildRequires: device-mapper-devel >= 1.2.68
|
|
|
|
BuildRequires: glibc-devel-static
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifarch %go_arches
|
2015-06-22 11:09:23 +02:00
|
|
|
BuildRequires: go >= 1.4
|
2015-05-27 12:27:27 +02:00
|
|
|
BuildRequires: go-go-md2man
|
2015-06-26 16:30:44 +02:00
|
|
|
%else
|
|
|
|
BuildRequires: gcc5-go >= 5.0
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
2015-07-22 17:00:07 +02:00
|
|
|
BuildRequires: fdupes
|
2014-08-01 11:48:31 +02:00
|
|
|
BuildRequires: libapparmor-devel
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: libbtrfs-devel >= 3.8
|
|
|
|
BuildRequires: procps
|
|
|
|
BuildRequires: sqlite3-devel
|
|
|
|
BuildRequires: systemd-devel
|
|
|
|
BuildRequires: zsh
|
2014-08-01 11:48:31 +02:00
|
|
|
Requires: apparmor-parser
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: bridge-utils
|
|
|
|
Requires: ca-certificates-mozilla
|
2015-01-22 21:49:38 +01:00
|
|
|
# Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used
|
|
|
|
Requires: e2fsprogs
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: git-core >= 1.7
|
|
|
|
Requires: iproute2 >= 3.5
|
|
|
|
Requires: iptables >= 1.4
|
|
|
|
Requires: kernel >= 3.8.0
|
|
|
|
Requires: lvm2 >= 2.2.89
|
|
|
|
Requires: procps
|
|
|
|
Requires: tar >= 1.26
|
|
|
|
Requires: xz >= 4.9
|
2014-08-01 11:48:31 +02:00
|
|
|
Conflicts: lxc < 1.0
|
2014-07-17 17:31:28 +02:00
|
|
|
PreReq: %fillup_prereq
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2015-07-01 14:33:12 +02:00
|
|
|
ExcludeArch: %ix86
|
2015-07-24 16:22:23 +02:00
|
|
|
ExcludeArch: s390
|
|
|
|
ExcludeArch: s390x
|
|
|
|
ExcludeArch: ppc
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
%package bash-completion
|
|
|
|
Summary: Bash Completion for %{name}
|
|
|
|
Group: System/Management
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires: bash-completion
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description bash-completion
|
|
|
|
Bash command line completion support for %{name}.
|
|
|
|
|
|
|
|
%package zsh-completion
|
|
|
|
Summary: Zsh Completion for %{name}
|
|
|
|
Group: System/Management
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires: zsh
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description zsh-completion
|
|
|
|
Zsh command line completion support for %{name}.
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
%package test
|
|
|
|
Summary: Test package for docker
|
|
|
|
Group: System/Management
|
|
|
|
Requires: device-mapper-devel >= 1.2.68
|
|
|
|
Requires: glibc-devel-static
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifarch %go_arches
|
|
|
|
Requires: go >= 1.4
|
2015-06-10 10:16:24 +02:00
|
|
|
%else
|
2015-06-26 16:30:44 +02:00
|
|
|
Requires: gcc5-go >= 5.0
|
2015-06-10 10:16:24 +02:00
|
|
|
%endif
|
|
|
|
Requires: apparmor-parser
|
|
|
|
Requires: bash-completion
|
|
|
|
Requires: libapparmor-devel
|
|
|
|
Requires: libbtrfs-devel >= 3.8
|
|
|
|
Requires: procps
|
|
|
|
Requires: sqlite3-devel
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description test
|
|
|
|
Test package for docker. It contains the source code and the tests.
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%prep
|
2015-07-15 10:15:16 +02:00
|
|
|
%setup -q -n docker-%{version}
|
2014-07-17 17:31:28 +02:00
|
|
|
%patch0 -p1
|
2014-09-12 17:04:18 +02:00
|
|
|
%patch1 -p1
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifnarch %go_arches
|
|
|
|
%patch100
|
|
|
|
%patch101
|
2015-06-05 17:24:58 +02:00
|
|
|
%endif
|
2014-08-16 15:38:01 +02:00
|
|
|
cp %{SOURCE7} .
|
2015-06-22 11:09:23 +02:00
|
|
|
find . -name ".gitignore" | xargs rm
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%build
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifnarch %go_arches
|
2015-06-05 17:24:58 +02:00
|
|
|
mkdir /tmp/dirty-hack
|
|
|
|
ln -s /usr/bin/go-5 /tmp/dirty-hack/go
|
|
|
|
export PATH=/tmp/dirty-hack:$PATH
|
|
|
|
%endif
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
(cat <<EOF
|
2014-09-01 16:59:21 +02:00
|
|
|
export AUTO_GOPATH=1
|
2014-08-01 11:48:31 +02:00
|
|
|
export DOCKER_BUILDTAGS="exclude_graphdriver_aufs apparmor selinux"
|
2014-07-17 17:31:28 +02:00
|
|
|
export DOCKER_GITCOMMIT=%{git_version}
|
2015-06-10 10:16:24 +02:00
|
|
|
EOF
|
|
|
|
) > docker_build_env
|
|
|
|
. ./docker_build_env
|
2014-07-17 17:31:28 +02:00
|
|
|
./hack/make.sh dynbinary
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifarch %go_arches
|
2015-06-22 11:09:23 +02:00
|
|
|
man/md2man-all.sh
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
2015-06-10 10:16:24 +02:00
|
|
|
# remove other than systemd
|
|
|
|
# otherwise the resulting package will have extra requires
|
2015-06-22 11:09:23 +02:00
|
|
|
rm -rf hack/make/.build-deb
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
install -d %{buildroot}%{go_contribdir}
|
|
|
|
install -d %{buildroot}%{_bindir}
|
|
|
|
install -D -m755 bundles/%{version}/dynbinary/%{name}-%{version} %{buildroot}/%{_bindir}/%{name}
|
|
|
|
install -d %{buildroot}/%{_prefix}/lib/docker
|
|
|
|
install -D -m755 bundles/%{version}/dynbinary/dockerinit-%{version} %{buildroot}/%{_prefix}/lib/docker/dockerinit
|
|
|
|
install -Dd -m 0755 \
|
|
|
|
%{buildroot}%{_sysconfdir}/init.d \
|
|
|
|
%{buildroot}%{_sbindir}
|
|
|
|
|
|
|
|
install -D -m0644 contrib/completion/bash/docker "%{buildroot}/etc/bash_completion.d/%{name}"
|
|
|
|
install -D -m0644 contrib/completion/zsh/_docker "%{buildroot}/etc/zsh_completion.d/%{name}"
|
2015-06-10 10:16:24 +02:00
|
|
|
# copy all for the test package
|
|
|
|
install -d %{buildroot}/usr/src/docker/
|
|
|
|
cp -av . %{buildroot}/usr/src/docker/
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# systemd service
|
|
|
|
#
|
|
|
|
install -D -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
install -D -m 0644 %SOURCE5 %{buildroot}%{_unitdir}/%{name}.socket
|
2014-12-03 22:48:32 +01:00
|
|
|
ln -sf /sbin/service $RPM_BUILD_ROOT/usr/sbin/rcdocker
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# udev rules that prevents dolphin to show all docker devices and slows down
|
|
|
|
# upstream report https://bugs.kde.org/show_bug.cgi?id=329930
|
|
|
|
#
|
|
|
|
|
|
|
|
install -D -m 0644 %SOURCE3 %{buildroot}%{_prefix}/lib/udev/rules.d/80-%{name}.rules
|
|
|
|
|
|
|
|
# sysconfig file
|
2015-06-05 17:24:58 +02:00
|
|
|
%ifarch ppc64le
|
|
|
|
install -D -m 644 %SOURCE100 %{buildroot}/var/adm/fillup-templates/sysconfig.docker
|
|
|
|
%else
|
2014-07-17 17:31:28 +02:00
|
|
|
install -D -m 644 %SOURCE4 %{buildroot}/var/adm/fillup-templates/sysconfig.docker
|
2015-06-05 17:24:58 +02:00
|
|
|
%endif
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifarch %go_arches
|
2015-05-27 12:27:27 +02:00
|
|
|
# install manpages
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
2015-06-22 11:09:23 +02:00
|
|
|
install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1
|
2015-05-27 12:27:27 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man5
|
2015-06-22 11:09:23 +02:00
|
|
|
install -p -m 644 man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
2015-05-27 12:27:27 +02:00
|
|
|
|
2015-07-22 17:00:07 +02:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%pre
|
|
|
|
echo "creating group docker..."
|
|
|
|
groupadd -r docker 2>/dev/null || :
|
2014-12-03 22:48:32 +01:00
|
|
|
%service_add_pre %{name}.service %{name}.socket
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%post
|
2014-12-03 22:48:32 +01:00
|
|
|
%service_add_post %{name}.service %{name}.socket
|
2014-07-17 17:31:28 +02:00
|
|
|
%{fillup_only -n docker}
|
|
|
|
|
|
|
|
%preun
|
2014-12-03 22:48:32 +01:00
|
|
|
%service_del_preun %{name}.service %{name}.socket
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%postun
|
2014-12-03 22:48:32 +01:00
|
|
|
%service_del_postun %{name}.service %{name}.socket
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2014-08-16 15:38:01 +02:00
|
|
|
%doc README.md LICENSE README_SUSE.md
|
2014-07-17 17:31:28 +02:00
|
|
|
%{_bindir}/docker
|
2014-12-03 22:48:32 +01:00
|
|
|
%{_sbindir}/rcdocker
|
2014-07-17 17:31:28 +02:00
|
|
|
%{_prefix}/lib/docker/
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%{_unitdir}/%{name}.socket
|
|
|
|
%{_prefix}/lib/udev/rules.d/80-%{name}.rules
|
|
|
|
/var/adm/fillup-templates/sysconfig.docker
|
2015-06-26 16:30:44 +02:00
|
|
|
%ifarch %go_arches
|
2015-05-27 12:27:27 +02:00
|
|
|
%{_mandir}/man1/docker-*.1.gz
|
|
|
|
%{_mandir}/man1/docker.1.gz
|
|
|
|
%{_mandir}/man5/Dockerfile.5.gz
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%files bash-completion
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%config %{_sysconfdir}/bash_completion.d/%{name}
|
|
|
|
|
|
|
|
%files zsh-completion
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%config %{_sysconfdir}/zsh_completion.d/%{name}
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/src/docker/
|
2015-07-10 13:27:13 +02:00
|
|
|
# exclude binaries
|
2015-06-10 10:16:24 +02:00
|
|
|
%exclude /usr/src/docker/bundles/
|
2015-07-10 13:27:13 +02:00
|
|
|
# exclude init configurations other than systemd
|
|
|
|
%exclude /usr/src/docker/contrib/init/openrc
|
|
|
|
%exclude /usr/src/docker/contrib/init/sysvinit-debian
|
|
|
|
%exclude /usr/src/docker/contrib/init/sysvinit-redhat
|
|
|
|
%exclude /usr/src/docker/contrib/init/upstart
|
2015-06-10 10:16:24 +02:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%changelog
|