containerd/containerd.spec

89 lines
2.6 KiB
RPMSpec

#
# spec file for package containerd
#
# Copyright (c) 2016 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_arches %ix86 x86_64
%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"
%endif
%define version_unconverted 0.0.5
Name: containerd
Version: 0.0.5
Release: 0
License: Apache-2.0
Summary: Standalone OCI Container Daemon
Url: https://containerd.tools
Group: System/Management
Source: %{name}-%{version}.tar.xz
%ifarch %go_arches
BuildRequires: go >= 1.5
%else
BuildRequires: gcc5-go >= 5.0
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define client ctr
%define daemon %{name}
%define shim %{name}-shim
%description
containerd is a daemon with an API and a command line client, to manage
containers on one machine. It uses runC to run containers according to the OCI
specification. containerd has advanced features such as seccomp and user
namespace support as well as checkpoint and restore for cloning and live
migration of containers.
%prep
%setup -q
%build
# Create buildir,
export GOPATH=$PWD/vendor
mkdir -pv $GOPATH/src/github.com/docker/
ln -svfn $PWD $GOPATH/src/github.com/docker/containerd
# Build deamon.
%go_tool build %GO_BUILD_FLAGS -x -o %{daemon}-%{version} github.com/docker/%{name}/%{daemon}
# Build shim.
%go_tool build %GO_BUILD_FLAGS -x -o %{shim}-%{version} github.com/docker/%{name}/%{shim}
# Build client.
%go_tool build %GO_BUILD_FLAGS -x -o %{client}-%{version} github.com/docker/%{name}/%{client}
%install
%{__install} -D -m755 %{daemon}-%{version} %{buildroot}/%{_bindir}/%{daemon}
%{__install} -D -m755 %{shim}-%{version} %{buildroot}/%{_bindir}/%{shim}
%{__install} -D -m755 %{client}-%{version} %{buildroot}/%{_bindir}/%{client}
%post
%postun
%files
%defattr(-,root,root)
%doc LICENSE.code LICENSE.docs README.md
%{_bindir}/%{daemon}
%{_bindir}/%{shim}
%{_bindir}/%{client}