SHA256
1
0
forked from pool/docker

Accepting request 421307 from Virtualization:containers:1.12-RC

- use gcc6-go instead of gcc5-go (bsc#988408) 
- build ppc64le with gc-go because this version builds with gc-go 1.6
- remove bnc964673-boltdb-metadata-recovery.patch because it has already
  been merged

- update to v1.12.0 (bsc#995058)
  see detailed changelog at
    https://github.com/docker/docker/releases/tag/v1.12.0
- disable test that fail in obs build context
- only run unit tests on architectures that provide the go list and go test
  tools
- disable dockerd, parser, integration test, and devicemapper related tests
  on versions below SLE12 and openSUSE_13.2
- bump test timeout to 10m (for aarch64)
- run unit tests during the build
- Adapt docker.service file.
- adapt install sections for gccgo builds: gccgo build are not built in separate
  folders for client and daemon. They both reside in dyngccgo.
- gcc-go-patch: link against systemd when compiling the daemon.
- Add disable-pprof-trace.patch
  pprof.Trace() is not available in go version <= 1.4 which we use to build SLES
  packages. This patch comments out the pprof.Trace() section.
- update gcc-go-patch and docker-mount-secrets.patch

- Fixed binary split, install both required binaries correctly

OBS-URL: https://build.opensuse.org/request/show/421307
OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=127
This commit is contained in:
Christian Brauner
2016-08-23 14:44:42 +00:00
committed by Git OBS Bridge
parent 031a7bc93c
commit d470da093f
11 changed files with 202 additions and 181 deletions

View File

@@ -21,9 +21,9 @@
%global docker_migration_testfile %{docker_store}/.suse-image-migration-v1to2-complete
%global docker_migration_warnfile %{docker_store}/docker-update-message.txt
%define docker_graph %{docker_store}/graph
%define git_version 9e83765
%define go_arches %ix86 x86_64 aarch64
%define version_unconverted 1.11.2
%define git_version 8eab29e
%define go_arches %ix86 x86_64 aarch64 ppc64le
%define docker_version 1.12.0
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
# When upgrading to a new version requires the service not to be restarted
# Due to a long migration process update last_migration_version to the new version
@@ -31,7 +31,7 @@
# 1.10.1
%global last_migration_version 1.10.1
Name: docker
Version: 1.11.2
Version: 1.12.0
Release: 0
Summary: The Linux container runtime
License: Apache-2.0
@@ -45,15 +45,12 @@ Source6: docker-rpmlintrc
Source7: README_SUSE.md
Source8: docker-audit.rules
Source9: docker-update-message.txt
# Required to overcome some limitations of gcc-go: https://groups.google.com/forum/#!msg/golang-nuts/SlGCPYkjxo4/4DjcjXRCqAkJ
Patch101: gcc-go-patches.patch
Patch102: netlink_gcc_go.patch
Patch103: netlink_netns_powerpc.patch
# Fixes for architecture-specific issues (gcc-go).
Patch100: gcc-go-patches.patch
Patch101: netlink_gcc_go.patch
Patch102: netlink_netns_powerpc.patch
Patch103: disable-pprof-trace.patch
Patch200: docker-mount-secrets.patch
# This fixes bnc#964673. This fix is in boltdb upstream, but has yet to be
# merged into Docker (in a vendor commit). This patch was cherry-picked from
# bolt#555.
Patch302: bnc964673-boltdb-metadata-recovery.patch
BuildRequires: audit
BuildRequires: bash-completion
BuildRequires: device-mapper-devel >= 1.2.68
@@ -71,8 +68,8 @@ Requires: ca-certificates-mozilla
# execdrivers of Docker. NOTE: The version pinning here matches upstream's
# Dockerfile to ensure that we don't use a slightly incompatible version of
# runC or containerd (which would be bad).
Requires: containerd = 0.2.2
Requires: runc = 0.1.1
Requires: containerd = 0.2.3
Requires: runc = 0.1.1+gitcc29e3d
# Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used
Requires: e2fsprogs
Requires: git-core >= 1.7
@@ -98,7 +95,7 @@ Source5: docker_systemd_lt_214.socket
BuildRequires: go >= 1.5
BuildRequires: go-go-md2man
%else
BuildRequires: gcc5-go >= 5.0
BuildRequires: gcc6-go >= 6.1
%endif
%if 0%{?is_opensuse}
ExcludeArch: s390x
@@ -150,7 +147,7 @@ BuildArch: noarch
%ifarch %{go_arches}
Requires: go >= 1.4
%else
Requires: gcc5-go >= 5.0
Requires: gcc6-go >= 6.1
%endif
%description test
@@ -164,12 +161,11 @@ Test package for docker. It contains the source code and the tests.
%patch200 -p1
%endif
%ifnarch %{go_arches}
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%endif
# bnc#964673
%patch302 -p1
cp %{SOURCE7} .
%build
@@ -177,7 +173,7 @@ cp %{SOURCE7} .
tmphack=/tmp/dirty-hack
[ -e $tmphack ] && rm -rf $tmphack
mkdir $tmphack
ln -s %{_bindir}/go-5 $tmphack/go
ln -s %{_bindir}/go-6 $tmphack/go
export PATH=$tmphack:$PATH
%endif
@@ -200,16 +196,84 @@ man/md2man-all.sh
# otherwise the resulting package will have extra requires
rm -rf hack/make/.build-deb
%ifarch %go_arches
%check
. ./docker_build_env
# go test will look in github.com/docker/docker/vendor for vendored packages but
# Docker keeps them in github.com/docker/docker/vendor/src. Let's do it like
# Docker does it and append github.com/docker/docker/vendor to the GOPATH so the
# packages are found by go test.
export GOPATH=$HOME/go/src/github.com/docker/docker/vendor:$GOPATH
# Create or dir if it doesn't exist already
mkdir -p $HOME/go/src/github.com/docker
# Remove any existing symlinks.
rm -rf $HOME/go/src/github.com/docker/*
# go list -e ... doesn't seem to work with symlinks so do a full copy instead.
cp -avr %{buildroot}/usr/src/%{name} $HOME/go/src/github.com/docker/docker
cd $HOME/go/src/github.com/docker/docker
# Note that these commands do not allow %%elseif.
# For versions equal to or below SLE12 && openSUSE_13.2 libdevmapper.h is not
# recent enough to define dm_task_deferred_remove(). (This is not true of
# SLE12_SP1 but we cannot distinguish it with this macro.)
EXCLUDE_TAGS=
%if 0%{?suse_version} <= 1320
EXCLUDE_TAGS="libdm_no_deferred_remove $EXCLUDE_TAGS"
%endif
# The command is taken from hack/make/test-unit and various test runs.
# Everything that follows github.com/docker/pkg/integration-cli are packages
# containing tests that cannot run in an obs build context.
PKG_LIST=$(go list -e \
-f '{{if ne .Name "github.com/docker/docker"}} {{.ImportPath}}
{{end}}' \
-tags $EXCLUDE_TAGS \
-a "${BUILDFLAGS[@]}" ... \
| grep 'github.com/docker/docker' \
| grep -v 'github.com/docker/docker/vendor' \
| grep -v 'github.com/docker/docker/integration-cli' \
| grep -v 'github.com/docker/docker/pkg/archive$' \
| grep -v 'github.com/docker/docker/pkg/chrootarchive$' \
| grep -v 'github.com/docker/docker/pkg/gitutils$' \
| grep -v 'github.com/docker/docker/pkg/idtools$' \
| grep -v 'github.com/docker/docker/pkg/jsonlog$' \
| grep -v 'github.com/docker/docker/pkg/mount$' \
| grep -v 'github.com/docker/docker/pkg/sysinfo$' \
| grep -v 'github.com/docker/docker/registry$' \
| grep -v 'github.com/docker/docker/volume/local$' \
| grep -v 'github.com/docker/docker/builder$' \
| grep -v 'github.com/docker/docker/daemon$' \
| grep -v 'github.com/docker/docker/daemon/graphdriver/btrfs$' \
| grep -v 'github.com/docker/docker/daemon/graphdriver/devmapper$' \
| grep -v 'github.com/docker/docker/daemon/graphdriver/vfs$' \
| grep -v 'github.com/docker/docker/builder/dockerfile$' \
| grep -v 'github.com/docker/docker/cmd/dockerd$' \
| grep -v 'github.com/docker/docker/builder/dockerfile/parser$' \
| grep -v 'github.com/docker/docker/man$' \
| grep -v 'github.com/docker/docker/pkg/integration$')
go test -cover -ldflags -w -tags $EXCLUDE_TAGS -a -test.timeout=10m $PKG_LIST
%endif
%install
install -d %{buildroot}%{go_contribdir}
install -d %{buildroot}%{_bindir}
%ifarch %{go_arches}
install -D -m755 bundles/%{version}/dynbinary/%{name}-%{version} %{buildroot}/%{_bindir}/%{name}
install -D -m755 bundles/latest/dynbinary-client/%{name} %{buildroot}/%{_bindir}/%{name}
install -D -m755 bundles/latest/dynbinary-daemon/%{name}d %{buildroot}/%{_bindir}/%{name}d
%else
install -D -m755 bundles/%{version}/dyngccgo/%{name}-%{version} %{buildroot}/%{_bindir}/%{name}
install -D -m755 bundles/latest/dyngccgo/%{name} %{buildroot}/%{_bindir}/%{name}
install -D -m755 bundles/latest/dyngccgo/%{name}d %{buildroot}/%{_bindir}/%{name}d
%endif
install -d %{buildroot}/%{_prefix}/lib/docker
install -Dd -m 0755 %{buildroot}%{_sbindir}
install -Dd -m 0755 \
%{buildroot}%{_sysconfdir}/init.d \
%{buildroot}%{_sbindir}
install -D -m0644 contrib/completion/bash/docker "%{buildroot}%{_sysconfdir}/bash_completion.d/%{name}"
install -D -m0644 contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/%{name}"
@@ -297,6 +361,7 @@ fi
%defattr(-,root,root)
%doc README.md LICENSE README_SUSE.md
%{_bindir}/docker
%{_bindir}/dockerd
%{_sbindir}/rcdocker
%{_libexecdir}/docker/
%{_unitdir}/%{name}.service