f50f0c9beb
- Update to runc v1.0.0-rc4. Upstream changelog: + runc now supports v1.0.0 of the OCI runtime specification. #1527 + Rootless containers support has been released. The current state of this feature is that it only supports single-{uid,gid} mappings as an unprivileged user, and cgroups are completely unsupported. Work is being done to improve this. #774 + Rather than relying on CRIU version nnumbers, actually check if the system supports pre-dumping. #1371 + Allow the PIDs cgroup limit to be updated. #1423 + Add support for checkpoint/restore of containers with orphaned PTYs (which is effectively all containers with terminal=true). #1355 + Permit prestart hooks to modify the cgroup configuration of a container. #1239 + Add support for a wide variety of mount options. #1460 + Expose memory.use_hierarchy in MemoryStats. #1378 * Fix incorrect handling of systems without the freezer cgroup. #1387 * Many, many changes to switch away from Go's "syscall" stdlib to "golang.org/x/sys/unix". #1394 #1398 #1442 #1464 #1467 #1470 #1474 #1478 #1491 #1482 #1504 #1519 #1530 * Set cgroup resources when restoring a container. #1399 * Switch back to using /sbin as the installation directory. #1406 * Remove the arbitrary container ID length restriction. #1435 * Make container force deletion ignore non-existent containers. #1451 * Improve handling of arbitrary cgroup mount locations when populating cpuset. #1372 * Make the SaneTerminal interface public. #1479 * Fix cases where runc would report a container to be in a "Running" state if the init was a zombie or dead. #1489 * Do not set supplementary groups for numeric users. #1450 * Fix various issues with the "owner" field in runc-list. #1516 * Many other miscellaneous fixes, some of which were made by first-time contributors. Thanks, and welcome to the project! #1406 #1400 #1365 #1396 #1402 #1414 #1412 #1408 #1418 #1425 #1428 #1436 #1433 #1438 #1410 #1447 #1388 #1484 #1481 #1496 #1245 #1524 #1534 #1526 #1533 - Remove any semblance of non-Linux support. #1502 - We no longer use shfmt for testing. #1510 OBS-URL: https://build.opensuse.org/request/show/516116 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/runc?expand=0&rev=54
162 lines
4.7 KiB
RPMSpec
162 lines
4.7 KiB
RPMSpec
#
|
|
# spec file for package runc
|
|
#
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
#
|
|
# 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/
|
|
#
|
|
|
|
|
|
%define go_tool go
|
|
%define _version 1.0.0rc4
|
|
%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
|
|
|
|
Name: runc
|
|
Version: 1.0.0~rc4
|
|
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}-v%{_version}.tar.xz
|
|
BuildRequires: fdupes
|
|
# Make sure we require go 1.7
|
|
BuildRequires: go-go-md2man
|
|
BuildRequires: libapparmor-devel
|
|
BuildRequires: golang(API) = 1.7
|
|
%if 0%{?with_libseccomp}
|
|
BuildRequires: libseccomp-devel
|
|
%endif
|
|
BuildRequires: libselinux-devel
|
|
Recommends: criu
|
|
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.
|
|
|
|
%package test
|
|
Summary: Test package for runc
|
|
# Make sure we require go 1.7
|
|
Group: System/Management
|
|
BuildRequires: golang(API) = 1.7
|
|
Requires: go-go-md2man
|
|
Requires: libapparmor-devel
|
|
%if 0%{?with_libseccomp}
|
|
BuildRequires: 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}-v%{_version}
|
|
|
|
%build
|
|
# 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/%project/Godeps/_workspace
|
|
mkdir -pv $HOME/go/src/%project
|
|
rm -rf $HOME/go/src/%project/*
|
|
cp -av * $HOME/go/src/%project
|
|
|
|
# Build all features.
|
|
export BUILDTAGS="apparmor selinux"
|
|
export BUILDFLAGS="-gccgoflags=-Wl,--add-needed -Wl,--no-as-needed -static-libgo -ldl -lselinux -lapparmor"
|
|
|
|
# Additionally enable seccomp.
|
|
%if 0%{?with_libseccomp}
|
|
export BUILDTAGS="$BUILDTAGS seccomp"
|
|
export BUILDFLAGS="$BUILDFLAGS -lseccomp"
|
|
%endif
|
|
|
|
(cat <<EOF
|
|
export GOPATH="$GOPATH"
|
|
export BUILDTAGS="$BUILDTAGS"
|
|
export BUILDFLAGS="$BUILDFLAGS"
|
|
EOF
|
|
) >./.runc_build_env
|
|
source ./.runc_build_env
|
|
|
|
# Build runc.
|
|
%go_tool build -buildmode=pie "$BUILDFLAGS" -tags "$BUILDTAGS" -x -o %{name}-%{version} %{project}
|
|
|
|
# Build man pages, this can only be done on arches where we can build go-md2man.
|
|
man/md2man-all.sh
|
|
|
|
%check
|
|
source ./.runc_build_env
|
|
cd $HOME/go/src/%project
|
|
|
|
PKG_LIST=$(go list ./... \
|
|
| grep -v '%{project}/libcontainer/cgroups/fs$' \
|
|
| grep -v '%{project}/libcontainer$' \
|
|
| grep -v '%{project}/libcontainer/integration$' \
|
|
| grep -v '%{project}/libcontainer/nsenter$' \
|
|
| grep -v '%{project}/libcontainer/user$' \
|
|
| grep -v '%{project}/libcontainer/xattr$' \
|
|
%if ! 0%{?with_libseccomp}
|
|
| grep -v '%{project}/libcontainer/seccomp$' \
|
|
| grep -v 'github.com/seccomp/libseccomp-golang$' \
|
|
%endif
|
|
)
|
|
%go_tool test -buildmode=pie "$BUILDFLAGS" -tags "$BUILDTAGS" -timeout 3m -v $PKG_LIST
|
|
|
|
%install
|
|
source ./.runc_build_env
|
|
|
|
# We install to /usr/sbin/runc as per upstream.
|
|
install -D -m755 %{name}-%{version} %{buildroot}%{_sbindir}/%{name}
|
|
install -d -m755 %{buildroot}/usr/src/%{name}/
|
|
cp -av $HOME/go/src/%{project}/* %{buildroot}/usr/src/%{name}/
|
|
|
|
# Man pages.
|
|
install -d -m755 %{buildroot}%{_mandir}/man8
|
|
install -m644 man/man8/runc*.8 %{buildroot}%{_mandir}/man8
|
|
|
|
%fdupes %{buildroot}
|
|
|
|
%post
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%doc README.md LICENSE
|
|
%{_sbindir}/%{name}
|
|
%{_mandir}/man8/runc*.8.gz
|
|
|
|
%files test
|
|
%defattr(-,root,root)
|
|
/usr/src/runc/
|
|
%exclude /usr/src/runc/runc
|
|
%exclude /usr/src/runc/runc/Godeps/_workspace/pkg
|
|
|
|
%changelog
|