From 4112781916857d5ee651e090ac30305b9c841beeb322ca8e984227712d3470df Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Date: Wed, 17 Aug 2016 10:45:55 +0000 Subject: [PATCH] Accepting request 419728 from home:chbrauner:branches:Virtualization:containers OBS-URL: https://build.opensuse.org/request/show/419728 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/runc?expand=0&rev=14 --- runc.changes | 9 +++++++++ runc.spec | 40 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/runc.changes b/runc.changes index 422a4dd..55cdb64 100644 --- a/runc.changes +++ b/runc.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Aug 17 10:29:15 UTC 2016 - cbrauner@suse.de + +- Add runc-test package which contains the source code and the test. This + package will be used to run the integration tests. +- Simplify package build and check sections: Instead of symlinking we default to + cp -avr. go list gets confused by symlinks hence, we need to copy the source + code anyway if we want to run unit tests during package build at some point. + ------------------------------------------------------------------- Fri Apr 29 09:03:24 UTC 2016 - asarai@suse.de diff --git a/runc.spec b/runc.spec index e7aeef0..13eb798 100644 --- a/runc.spec +++ b/runc.spec @@ -57,16 +57,40 @@ specification. It is designed to be as minimal as possible, and is the workhorse of Docker. It was originally designed to be a replacement for LXC within Docker, and has grown to become a separate project entirely. +%package test +Summary: Test package for runc +Group: System/Management +%ifarch %go_arches +Requires: go >= 1.5 +Requires: go-go-md2man +%else +Requires: gcc5-go >= 5.0 +%endif +Requires: libapparmor-devel +# Seccomp isn't supported on aarch64. +%ifnarch aarch64 +Requires: libseccomp-devel +%endif +Requires: libselinux-devel +Recommends: criu +BuildArch: noarch + +%description test +Test package for runc. It contains the source code and the tests. + %prep %setup -q -n %{name}-%{version} # Apply the vendor'd patch to the right subdirectory. %patch0 -p1 -d Godeps/_workspace/src/github.com/seccomp/libseccomp-golang %build -# Create buildir, -export GOPATH=$PWD/Godeps/_workspace -mkdir -pv $GOPATH/src/github.com/opencontainers/ -ln -svfn $PWD $GOPATH/src/github.com/opencontainers/runc +# Do not use symlinks. If you want to run the unit tests for this package at +# some point during the build and you need to directly use go list directly it +# will get confused by symlinks. +export GOPATH=${HOME}/go:${HOME}/go/src/github.com/opencontainers/runc/Godeps/_workspace:${GOPATH} +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 # Build all features. export BUILDTAGS="apparmor selinux" @@ -86,6 +110,8 @@ man/md2man-all.sh %install %{__install} -D -m755 %{name}-%{version} %{buildroot}%{_sbindir}/%{name} +install -d -m755 %{buildroot}/usr/src/runc/ +cp -avr $HOME/go/src/github.com/opencontainers/runc/* %{buildroot}/usr/src/runc/ %ifarch %go_arches %{__install} -d -m755 %{buildroot}%{_mandir}/man8 @@ -101,4 +127,10 @@ man/md2man-all.sh %{_mandir}/man8/runc*.8.gz %endif +%files test +%defattr(-,root,root) +/usr/src/runc/ +%exclude /usr/src/runc/runc +%exclude /usr/src/runc/runc/Godeps/_workspace/pkg + %changelog