2016-03-27 12:27:18 +02:00
|
|
|
#
|
|
|
|
# spec file for package containerd
|
|
|
|
#
|
2017-01-16 10:37:31 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-03-27 12:27:18 +02: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.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2017-10-26 20:00:35 +02:00
|
|
|
# nodebuginfo
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2016-06-17 16:40:17 +02:00
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%define go_tool go
|
2017-08-11 14:10:01 +02:00
|
|
|
%define GO_BUILD_FLAGS -buildmode=pie
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2016-11-24 13:49:04 +01:00
|
|
|
# MANUAL: Update the git_version and git_revision
|
2017-10-26 20:00:35 +02:00
|
|
|
%define git_version 3addd840653146c90a254301d6c3a663c7fd6429
|
|
|
|
%define git_short 3addd8406531
|
2016-11-24 13:49:04 +01:00
|
|
|
# How to get the git_revision
|
2017-10-18 06:27:20 +02:00
|
|
|
# git clone https://github.com/containerd/containerd.git containerd-upstream
|
2016-11-24 13:49:04 +01:00
|
|
|
# cd containerd
|
|
|
|
# git checkout $git_version
|
|
|
|
# git_revision=r$(git rev-list HEAD | wc -l)
|
2017-10-18 06:27:20 +02:00
|
|
|
%define git_revision r671
|
2016-08-23 18:06:44 +02:00
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
Name: containerd
|
2017-10-26 20:00:35 +02:00
|
|
|
Version: 0.2.8+git%{git_revision}_%{git_short}
|
2016-03-27 12:27:18 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Standalone OCI Container Daemon
|
2016-06-17 16:40:17 +02:00
|
|
|
License: Apache-2.0
|
2016-03-27 12:27:18 +02:00
|
|
|
Group: System/Management
|
2016-06-17 16:40:17 +02:00
|
|
|
Url: https://containerd.tools
|
2017-10-26 20:00:35 +02:00
|
|
|
Source: %{name}-git.%{git_short}.tar.xz
|
2016-03-27 13:14:42 +02:00
|
|
|
Source1: %{name}.service
|
2016-04-01 14:49:25 +02:00
|
|
|
Source2: %{name}.socket
|
|
|
|
Source3: sysconfig.%{name}
|
2017-10-26 20:00:35 +02:00
|
|
|
# OPENSUSE-FIX-UPSTREAM: Backport of https://github.com/containerd/containerd/pull/1686. bsc#1065109 boo#1053532
|
|
|
|
Patch100: bsc1065109-0001-makefile-add-support-for-build_flags.patch
|
|
|
|
BuildRequires: fdupes
|
2017-10-18 06:27:20 +02:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-03-27 12:27:18 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2016-08-16 12:57:22 +02:00
|
|
|
# Currently runC is the only supported runtime for containerd. NOTE:
|
|
|
|
# This version pinning is done to follow (as well as we can) upstream's
|
|
|
|
# Dockerfile. However, for some reason the Dockerfile for containerd
|
|
|
|
# diverges from the one for Docker. As such, this cannot be a hard
|
|
|
|
# requirement (that would break Docker).
|
2017-10-18 06:27:20 +02:00
|
|
|
Requires: docker-runc = 1.0.0rc3+gitr3201_2d41c04
|
2016-10-25 14:11:15 +02:00
|
|
|
Requires(post): %fillup_prereq
|
2016-08-23 18:06:44 +02:00
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%description
|
2016-04-01 14:49:25 +02:00
|
|
|
Containerd is a daemon with an API and a command line client, to manage
|
2016-03-27 12:27:18 +02:00
|
|
|
containers on one machine. It uses runC to run containers according to the OCI
|
2016-04-01 14:49:25 +02:00
|
|
|
specification. Containerd has advanced features such as seccomp and user
|
2016-03-27 12:27:18 +02:00
|
|
|
namespace support as well as checkpoint and restore for cloning and live
|
|
|
|
migration of containers.
|
|
|
|
|
2016-03-27 13:20:12 +02:00
|
|
|
%package ctr
|
2016-03-27 13:14:42 +02:00
|
|
|
Summary: Client for %{name}
|
|
|
|
Group: System/Management
|
|
|
|
Requires: %{name} = %{version}
|
2017-10-18 06:27:20 +02:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-03-27 13:14:42 +02:00
|
|
|
|
2016-03-27 13:20:12 +02:00
|
|
|
%description ctr
|
2016-03-27 13:14:42 +02:00
|
|
|
Standalone client for containerd, which allows management of containerd containers
|
|
|
|
separately from Docker.
|
|
|
|
|
2016-08-18 11:49:59 +02:00
|
|
|
%package test
|
|
|
|
Summary: Test package for containerd
|
|
|
|
Group: System/Management
|
2017-10-18 06:27:20 +02:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-08-18 11:49:59 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description test
|
|
|
|
Test package for containerd. It contains the source code and the tests.
|
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%prep
|
2017-10-26 20:00:35 +02:00
|
|
|
%setup -q -n %{name}-git.%{git_short}
|
|
|
|
# bsc#1065109 boo#1053532
|
|
|
|
%patch100 -p1
|
2016-03-27 12:27:18 +02:00
|
|
|
|
|
|
|
%build
|
2016-08-18 11:49:59 +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-10-18 06:27:20 +02:00
|
|
|
export GOPATH=${HOME}/go:${HOME}/go/src/github.com/containerd/containerd/vendor
|
|
|
|
mkdir -p $HOME/go/src/github.com/containerd/containerd
|
|
|
|
rm -rf $HOME/go/src/github.com/containerd/containerd/*
|
|
|
|
cp -ar * $HOME/go/src/github.com/containerd/containerd
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2017-10-26 20:00:35 +02:00
|
|
|
make GIT_COMMIT=%{git_version}
|
|
|
|
cp bin/ctr ctr-%{version}
|
|
|
|
cp bin/containerd containerd-%{version}
|
|
|
|
cp bin/containerd-shim containerd-shim-%{version}
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2016-08-23 17:13:07 +02:00
|
|
|
%check
|
2017-10-18 06:27:20 +02:00
|
|
|
export GOPATH=$HOME/go/src/github.com/containerd/containerd/vendor:$GOPATH
|
|
|
|
cd $HOME/go/src/github.com/containerd/containerd
|
|
|
|
%go_tool test %GO_BUILD_FLAGS -v $(%go_tool list ./... | grep github.com/containerd/containerd | grep -v /integration-test)
|
2016-08-23 17:13:07 +02:00
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%install
|
2017-10-26 20:00:35 +02:00
|
|
|
install -D -m755 containerd-%{version} %{buildroot}/%{_sbindir}/containerd
|
|
|
|
install -D -m755 containerd-shim-%{version} %{buildroot}/%{_sbindir}/containerd-shim
|
|
|
|
install -D -m755 ctr-%{version} %{buildroot}/%{_sbindir}/%{name}-ctr
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2016-03-27 13:14:42 +02:00
|
|
|
# Add service and sysconfig.
|
2017-04-28 18:29:50 +02:00
|
|
|
install -D -m644 %SOURCE1 %{buildroot}/%{_unitdir}/%{name}.service
|
|
|
|
install -D -m644 %SOURCE2 %{buildroot}/%{_unitdir}/%{name}.socket
|
2016-04-29 12:06:39 +02:00
|
|
|
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rccontainerd
|
2017-04-28 18:29:50 +02:00
|
|
|
install -D -m644 %SOURCE3 %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
|
2016-03-27 13:14:42 +02:00
|
|
|
|
2016-08-18 11:49:59 +02:00
|
|
|
install -d -m755 %{buildroot}/usr/src/containerd/
|
2017-10-18 06:27:20 +02:00
|
|
|
cp -ar $HOME/go/src/github.com/containerd/containerd/* %{buildroot}/usr/src/containerd/
|
2016-08-18 11:49:59 +02:00
|
|
|
|
2017-10-26 20:00:35 +02:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2016-03-27 13:14:42 +02:00
|
|
|
%pre
|
2016-04-01 14:49:25 +02:00
|
|
|
%service_add_pre %{name}.service %{name}.socket
|
2016-03-27 13:14:42 +02:00
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%post
|
2016-04-01 14:49:25 +02:00
|
|
|
%service_add_post %{name}.service %{name}.socket
|
2016-03-27 13:14:42 +02:00
|
|
|
%{fillup_only -n containerd}
|
|
|
|
|
|
|
|
%preun
|
2016-04-01 14:49:25 +02:00
|
|
|
%service_del_preun %{name}.service %{name}.socket
|
2016-03-27 12:27:18 +02:00
|
|
|
|
|
|
|
%postun
|
2016-04-01 14:49:25 +02:00
|
|
|
%service_del_postun %{name}.service %{name}.socket
|
2016-03-27 12:27:18 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc LICENSE.code LICENSE.docs README.md
|
2017-10-26 20:00:35 +02:00
|
|
|
%{_sbindir}/containerd
|
|
|
|
%{_sbindir}/containerd-shim
|
2016-03-27 13:14:42 +02:00
|
|
|
%{_unitdir}/%{name}.service
|
2016-04-01 14:49:25 +02:00
|
|
|
%{_unitdir}/%{name}.socket
|
2016-03-27 13:14:42 +02:00
|
|
|
/var/adm/fillup-templates/sysconfig.%{name}
|
2016-04-29 12:06:39 +02:00
|
|
|
%{_sbindir}/rccontainerd
|
2016-03-27 13:14:42 +02:00
|
|
|
|
2016-03-27 13:20:12 +02:00
|
|
|
%files ctr
|
2017-10-26 20:00:35 +02:00
|
|
|
%{_sbindir}/%{name}-ctr
|
2016-06-17 16:40:17 +02:00
|
|
|
|
2016-08-18 11:49:59 +02:00
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/src/containerd/
|
|
|
|
%exclude /usr/src/containerd/bin
|
|
|
|
|
2016-06-17 16:40:17 +02:00
|
|
|
%changelog
|