2016-03-21 09:36:29 +01:00
|
|
|
#
|
|
|
|
# spec file for package runc
|
|
|
|
#
|
2018-02-27 18:41:09 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-03-21 09:36:29 +01: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.
|
|
|
|
|
2018-12-13 08:54:13 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
2016-03-21 09:36:29 +01:00
|
|
|
#
|
2017-08-16 21:16:32 +02:00
|
|
|
# nodebuginfo
|
2016-03-21 09:36:29 +01:00
|
|
|
|
2016-07-19 17:34:55 +02:00
|
|
|
|
2017-08-16 21:16:32 +02:00
|
|
|
# We don't include a git_version in the "upstream" runc package, because we
|
|
|
|
# only package released versions (unlike docker-runc).
|
|
|
|
%define git_version %{nil}
|
|
|
|
|
2018-12-13 08:54:13 +01:00
|
|
|
# Package-wide golang version
|
|
|
|
%define go_version 1.10
|
2016-03-21 13:15:39 +01:00
|
|
|
%define go_tool go
|
2018-11-29 16:15:50 +01:00
|
|
|
%define _version 1.0.0-rc6
|
2017-08-11 14:10:02 +02:00
|
|
|
%define project github.com/opencontainers/runc
|
|
|
|
|
|
|
|
# enable libseccomp for sle >= sle12sp2
|
|
|
|
%if 0%{?sle_version} >= 120200
|
|
|
|
%define with_libseccomp 1
|
|
|
|
%endif
|
|
|
|
# enable libseccomp for leap >= 42.2
|
|
|
|
%if 0%{?leap_version} >= 420200
|
|
|
|
%define with_libseccomp 1
|
|
|
|
%endif
|
|
|
|
# enable libseccomp for Factory
|
|
|
|
%if 0%{?suse_version} > 1320
|
|
|
|
%define with_libseccomp 1
|
|
|
|
%endif
|
2016-03-21 09:36:29 +01:00
|
|
|
|
|
|
|
Name: runc
|
2018-11-29 16:15:50 +01:00
|
|
|
Version: 1.0.0~rc6
|
2016-03-21 09:36:29 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Tool for spawning and running OCI containers
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Management
|
|
|
|
Url: https://github.com/opencontainers/runc
|
2018-11-29 16:15:50 +01:00
|
|
|
Source0: https://github.com/opencontainers/runc/releases/download/v%{_version}/runc.tar.xz#/runc-%{_version}.tar.xz
|
|
|
|
Source1: https://github.com/opencontainers/runc/releases/download/v%{_version}/runc.tar.xz.asc#/runc-%{_version}.tar.xz.asc
|
2017-08-19 15:24:20 +02:00
|
|
|
Source2: runc.keyring
|
2016-09-23 16:37:04 +02:00
|
|
|
BuildRequires: fdupes
|
2016-03-27 17:19:30 +02:00
|
|
|
BuildRequires: go-go-md2man
|
2018-12-13 08:54:13 +01:00
|
|
|
BuildRequires: golang(API) = %{go_version}
|
2017-08-11 14:10:02 +02:00
|
|
|
%if 0%{?with_libseccomp}
|
2016-03-21 09:36:29 +01:00
|
|
|
BuildRequires: libseccomp-devel
|
2016-04-15 12:47:01 +02:00
|
|
|
%endif
|
2016-03-21 09:36:29 +01:00
|
|
|
BuildRequires: libselinux-devel
|
2016-03-27 17:19:30 +02:00
|
|
|
Recommends: criu
|
2016-03-21 09:36:29 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
runc is a CLI tool for spawning and running containers according to the OCI
|
|
|
|
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.
|
|
|
|
|
2016-08-17 12:45:55 +02:00
|
|
|
%package test
|
|
|
|
Summary: Test package for runc
|
2017-04-20 12:25:40 +02:00
|
|
|
# Make sure we require go 1.7
|
2016-08-17 12:45:55 +02:00
|
|
|
Group: System/Management
|
2018-12-13 08:54:13 +01:00
|
|
|
BuildRequires: golang(API) = %{go_version}
|
2016-08-17 12:45:55 +02:00
|
|
|
Requires: go-go-md2man
|
|
|
|
Requires: libapparmor-devel
|
2017-08-11 14:10:02 +02:00
|
|
|
%if 0%{?with_libseccomp}
|
|
|
|
BuildRequires: libseccomp-devel
|
2016-08-17 12:45:55 +02:00
|
|
|
%endif
|
|
|
|
Requires: libselinux-devel
|
|
|
|
Recommends: criu
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description test
|
|
|
|
Test package for runc. It contains the source code and the tests.
|
|
|
|
|
2016-03-21 09:36:29 +01:00
|
|
|
%prep
|
2017-08-19 15:24:20 +02:00
|
|
|
%setup -q -n %{name}-%{_version}
|
2016-03-21 09:36:29 +01:00
|
|
|
|
|
|
|
%build
|
2016-08-17 12:45:55 +02:00
|
|
|
# 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.
|
2017-08-16 21:16:32 +02:00
|
|
|
export GOPATH=${HOME}/go
|
2017-08-11 14:10:02 +02:00
|
|
|
mkdir -pv $HOME/go/src/%project
|
|
|
|
rm -rf $HOME/go/src/%project/*
|
|
|
|
cp -av * $HOME/go/src/%project
|
2016-03-21 13:15:39 +01:00
|
|
|
|
2017-08-11 14:10:02 +02:00
|
|
|
# Additionally enable seccomp.
|
|
|
|
%if 0%{?with_libseccomp}
|
2017-08-16 21:16:32 +02:00
|
|
|
export EXTRA_BUILDTAGS+="seccomp"
|
|
|
|
export EXTRA_GCCFLAGS+="-lseccomp"
|
2016-03-27 12:15:05 +02:00
|
|
|
%endif
|
|
|
|
|
2017-08-16 21:16:32 +02:00
|
|
|
# Build all features.
|
|
|
|
export BUILDTAGS="apparmor selinux $EXTRA_BUILDTAGS"
|
|
|
|
export BUILDFLAGS="-buildmode=pie -gccgoflags='-Wl,--add-needed -Wl,--no-as-needed -static-libgo -ldl -lselinux -lapparmor $EXTRA_GCCFLAGS'"
|
|
|
|
|
2017-08-11 14:10:02 +02:00
|
|
|
(cat <<EOF
|
|
|
|
export GOPATH="$GOPATH"
|
|
|
|
export BUILDTAGS="$BUILDTAGS"
|
|
|
|
export BUILDFLAGS="$BUILDFLAGS"
|
|
|
|
EOF
|
|
|
|
) >./.runc_build_env
|
|
|
|
source ./.runc_build_env
|
|
|
|
|
2016-03-27 12:15:05 +02:00
|
|
|
# Build runc.
|
2017-08-16 21:16:32 +02:00
|
|
|
make -C "$HOME/go/src/%project" EXTRA_FLAGS="-x $BUILDFLAGS" BUILDTAGS="$BUILDTAGS" COMMIT_NO="%{git_version}" runc
|
|
|
|
mv "$HOME/go/src/%project/runc" %{name}-%{version}
|
2016-03-21 09:36:29 +01:00
|
|
|
|
2016-03-27 17:19:30 +02:00
|
|
|
# Build man pages, this can only be done on arches where we can build go-md2man.
|
|
|
|
man/md2man-all.sh
|
|
|
|
|
2016-08-23 17:12:47 +02:00
|
|
|
%check
|
2018-06-05 09:46:42 +02:00
|
|
|
# We used to run 'go test' here, however we found that this actually didn't
|
|
|
|
# catch any issues that were caught by smoke testing, and %check would
|
|
|
|
# continually cause package builds to fail due to flaky tests. If you ever need
|
|
|
|
# to know how the testing was done, you can always look in the package history.
|
|
|
|
# boo#1095817
|
2016-08-23 17:12:47 +02:00
|
|
|
|
2016-03-21 09:36:29 +01:00
|
|
|
%install
|
2017-08-11 14:10:02 +02:00
|
|
|
source ./.runc_build_env
|
2016-03-21 09:36:29 +01:00
|
|
|
|
2018-10-31 16:30:13 +01:00
|
|
|
# We install to /usr/sbin/runc as per upstream an create a symlink in /usr/bin
|
|
|
|
# for rootless tools.
|
2017-08-11 14:10:02 +02:00
|
|
|
install -D -m755 %{name}-%{version} %{buildroot}%{_sbindir}/%{name}
|
2018-10-31 16:30:13 +01:00
|
|
|
install -m 755 -d %{buildroot}%{_bindir}
|
|
|
|
ln -s %{_sbindir}/%{name} %{buildroot}%{_bindir}/%{name}
|
2017-08-11 14:10:02 +02:00
|
|
|
install -d -m755 %{buildroot}/usr/src/%{name}/
|
|
|
|
cp -av $HOME/go/src/%{project}/* %{buildroot}/usr/src/%{name}/
|
2016-12-28 11:08:10 +01:00
|
|
|
|
2017-08-11 14:10:02 +02:00
|
|
|
# Man pages.
|
2017-04-28 18:29:38 +02:00
|
|
|
install -d -m755 %{buildroot}%{_mandir}/man8
|
|
|
|
install -m644 man/man8/runc*.8 %{buildroot}%{_mandir}/man8
|
2016-03-27 17:19:30 +02:00
|
|
|
|
2017-08-11 14:10:02 +02:00
|
|
|
%fdupes %{buildroot}
|
2016-09-23 16:37:04 +02:00
|
|
|
|
2016-12-21 17:38:17 +01:00
|
|
|
%post
|
|
|
|
|
2016-03-21 09:36:29 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2018-06-13 17:25:29 +02:00
|
|
|
%doc README.md
|
|
|
|
%license LICENSE
|
2016-03-30 16:18:58 +02:00
|
|
|
%{_sbindir}/%{name}
|
2018-10-31 16:30:13 +01:00
|
|
|
%{_bindir}/%{name}
|
2016-03-27 17:19:30 +02:00
|
|
|
%{_mandir}/man8/runc*.8.gz
|
2016-07-19 17:34:55 +02:00
|
|
|
|
2016-08-17 12:45:55 +02:00
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/src/runc/
|
|
|
|
%exclude /usr/src/runc/runc
|
|
|
|
%exclude /usr/src/runc/runc/Godeps/_workspace/pkg
|
|
|
|
|
2016-07-19 17:34:55 +02:00
|
|
|
%changelog
|