Accepting request 421318 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 - bump git commit id to the one required by docker v1.12.0 (bsc#995058) - run unit tests during package build - remove seccomp-use-pkg-config.patch The patch is now upstream. - remove GO_BUILD_FLAGS macro and substitute with BUILDFLAGS env variable to allow for easier string appending. - only run unit test on architectures that provide the go list and go test tools OBS-URL: https://build.opensuse.org/request/show/421318 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/runc?expand=0&rev=16
This commit is contained in:
parent
4112781916
commit
a8cdc9e7c2
4
_service
4
_service
@ -3,8 +3,8 @@
|
||||
<param name="url">https://github.com/opencontainers/runc.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="filename">runc</param>
|
||||
<param name="versionformat">0.1.1</param>
|
||||
<param name="revision">v0.1.1</param>
|
||||
<param name="versionformat">git.%h</param>
|
||||
<param name="revision">cc29e3dded8e27ba8f65738f40d251c885030a28</param>
|
||||
<param name="exclude">.git</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d97b2bc26851ce8b8bbad2c47f873baaf97b2098f74c254af0a8e3686a7968a7
|
||||
size 365364
|
3
runc-git.cc29e3d.tar.xz
Normal file
3
runc-git.cc29e3d.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c47ccde2967b47723fb5e035e571c55849d9d308543641af5b91e3efdff34ed8
|
||||
size 394544
|
17
runc.changes
17
runc.changes
@ -1,3 +1,20 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 18 10:35:29 UTC 2016 - jmassaguerpla@suse.com
|
||||
|
||||
- use gcc6-go instead of gcc5-go (bsc#988408)
|
||||
- build ppc64le with gc-go because this version builds with gc-go 1.6
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 18 10:34:29 UTC 2016 - cbrauner@suse.de
|
||||
|
||||
- bump git commit id to the one required by docker v1.12.0 (bsc#995058)
|
||||
- run unit tests during package build
|
||||
- remove seccomp-use-pkg-config.patch
|
||||
The patch is now upstream.
|
||||
- remove GO_BUILD_FLAGS macro and substitute with BUILDFLAGS env variable to
|
||||
allow for easier string appending.
|
||||
- only run unit test on architectures that provide the go list and go test tools
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 17 10:29:15 UTC 2016 - cbrauner@suse.de
|
||||
|
||||
|
38
runc.spec
38
runc.spec
@ -16,31 +16,28 @@
|
||||
#
|
||||
|
||||
|
||||
%define go_arches %ix86 x86_64 aarch64
|
||||
%define go_arches %ix86 x86_64 aarch64 ppc64le
|
||||
%ifarch %go_arches
|
||||
%define go_tool go
|
||||
%define GO_BUILD_FLAGS %{nil}
|
||||
%else
|
||||
%define go_tool go-5
|
||||
%define GO_BUILD_FLAGS "-gccgoflags=-Wl,--add-needed -Wl,--no-as-needed -static-libgo -ldl -lseccomp -lselinux -lapparmor"
|
||||
%define go_tool go-6
|
||||
%endif
|
||||
|
||||
%define version_unconverted 0.1.1
|
||||
%define git_version cc29e3d
|
||||
|
||||
Name: runc
|
||||
Version: 0.1.1
|
||||
Version: 0.1.1+git%{git_version}
|
||||
Release: 0
|
||||
Summary: Tool for spawning and running OCI containers
|
||||
License: Apache-2.0
|
||||
Group: System/Management
|
||||
Url: https://github.com/opencontainers/runc
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
Patch0: seccomp-use-pkg-config.patch
|
||||
Source: %{name}-git.%{git_version}.tar.xz
|
||||
%ifarch %go_arches
|
||||
BuildRequires: go >= 1.5
|
||||
BuildRequires: go-go-md2man
|
||||
%else
|
||||
BuildRequires: gcc5-go >= 5.0
|
||||
BuildRequires: gcc6-go >= 6.1
|
||||
%endif
|
||||
BuildRequires: libapparmor-devel
|
||||
# Seccomp isn't supported on aarch64.
|
||||
@ -64,7 +61,7 @@ Group: System/Management
|
||||
Requires: go >= 1.5
|
||||
Requires: go-go-md2man
|
||||
%else
|
||||
Requires: gcc5-go >= 5.0
|
||||
Requires: gcc6-go >= 6.1
|
||||
%endif
|
||||
Requires: libapparmor-devel
|
||||
# Seccomp isn't supported on aarch64.
|
||||
@ -79,9 +76,8 @@ BuildArch: noarch
|
||||
Test package for runc. It contains the source code and the tests.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%setup -q -n %{name}-git.%{git_version}
|
||||
# Apply the vendor'd patch to the right subdirectory.
|
||||
%patch0 -p1 -d Godeps/_workspace/src/github.com/seccomp/libseccomp-golang
|
||||
|
||||
%build
|
||||
# Do not use symlinks. If you want to run the unit tests for this package at
|
||||
@ -92,22 +88,38 @@ mkdir -pv $HOME/go/src/github.com/opencontainers/runc
|
||||
rm -rf $HOME/go/src/github.com/opencontainers/runc/*
|
||||
cp -avr * $HOME/go/src/github.com/opencontainers/runc
|
||||
|
||||
export BUILDFLAGS="-gccgoflags=-Wl,--add-needed -Wl,--no-as-needed -static-libgo -ldl -lselinux -lapparmor"
|
||||
# Build all features.
|
||||
export BUILDTAGS="apparmor selinux"
|
||||
|
||||
# Seccomp isn't supported on aarch64.
|
||||
%ifnarch aarch64
|
||||
export BUILDTAGS="$BUILDTAGS seccomp"
|
||||
export BUILDFLAGS="$BUILDFLAGS -lseccomp"
|
||||
%endif
|
||||
|
||||
# Build runc.
|
||||
%go_tool build %GO_BUILD_FLAGS -tags "$BUILDTAGS" -x -o %{name}-%{version} github.com/opencontainers/%{name}
|
||||
%go_tool build "$BUILDFLAGS" -tags "$BUILDTAGS" -x -o %{name}-%{version} github.com/opencontainers/%{name}
|
||||
|
||||
# Build man pages, this can only be done on arches where we can build go-md2man.
|
||||
%ifarch %go_arches
|
||||
man/md2man-all.sh
|
||||
%endif
|
||||
|
||||
%ifarch %go_arches
|
||||
%check
|
||||
export GOPATH=$HOME/go/src/github.com/opencontainers/runc/Godeps/_workspace:$GOPATH
|
||||
cd $HOME/go/src/github.com/opencontainers/runc
|
||||
PKG_LIST=$(go list ./... \
|
||||
| grep -v 'github.com/opencontainers/runc/libcontainer/cgroups/fs$' \
|
||||
| grep -v 'github.com/opencontainers/runc/libcontainer$' \
|
||||
| grep -v 'github.com/opencontainers/runc/libcontainer/integration$' \
|
||||
| grep -v 'github.com/opencontainers/runc/libcontainer/nsenter$' \
|
||||
| grep -v 'github.com/opencontainers/runc/libcontainer/user$' \
|
||||
| grep -v 'github.com/opencontainers/runc/libcontainer/xattr$')
|
||||
go test -timeout 3m -tags "$BUILDTAGS" -v $PKG_LIST
|
||||
%endif
|
||||
|
||||
%install
|
||||
%{__install} -D -m755 %{name}-%{version} %{buildroot}%{_sbindir}/%{name}
|
||||
install -d -m755 %{buildroot}/usr/src/runc/
|
||||
|
@ -1,45 +0,0 @@
|
||||
From 37d7332d4b4159cc3ca09a020319da2492b66a4e Mon Sep 17 00:00:00 2001
|
||||
From: Aleksa Sarai <asarai@suse.de>
|
||||
Date: Mon, 21 Mar 2016 19:01:33 +1100
|
||||
Subject: [PATCH] seccomp: use pkg-config for cgo flag generation
|
||||
|
||||
Not all distributions package libseccomp in the same way, but pkg-config
|
||||
allows the same configuration to work on different distributions. Switch
|
||||
to using pkg-config to automatically figure out what the correct
|
||||
commandline flags are for libseccomp.
|
||||
|
||||
Signed-off-by: Aleksa Sarai <asarai@suse.de>
|
||||
---
|
||||
seccomp.go | 2 +-
|
||||
seccomp_internal.go | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/seccomp.go b/seccomp.go
|
||||
index cebafdfae841..de847378d927 100644
|
||||
--- a/seccomp.go
|
||||
+++ b/seccomp.go
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
// C wrapping code
|
||||
|
||||
-// #cgo LDFLAGS: -lseccomp
|
||||
+// #cgo pkg-config: libseccomp
|
||||
// #include <stdlib.h>
|
||||
// #include <seccomp.h>
|
||||
import "C"
|
||||
diff --git a/seccomp_internal.go b/seccomp_internal.go
|
||||
index 306ed17570be..04095f664879 100644
|
||||
--- a/seccomp_internal.go
|
||||
+++ b/seccomp_internal.go
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// Get the seccomp header in scope
|
||||
// Need stdlib.h for free() on cstrings
|
||||
|
||||
-// #cgo LDFLAGS: -lseccomp
|
||||
+// #cgo pkg-config: libseccomp
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include <seccomp.h>
|
||||
--
|
||||
2.7.3
|
||||
|
Loading…
Reference in New Issue
Block a user