2016-03-27 10:27:18 +00:00
|
|
|
#
|
|
|
|
# spec file for package containerd
|
|
|
|
#
|
2018-02-02 10:30:25 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-03-27 10:27:18 +00: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 18:00:35 +00:00
|
|
|
# nodebuginfo
|
2016-03-27 10:27:18 +00:00
|
|
|
|
2016-06-17 14:40:17 +00:00
|
|
|
|
2017-11-24 10:06:55 +00:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
|
|
|
|
2016-03-27 10:27:18 +00:00
|
|
|
%define go_tool go
|
2017-08-11 12:10:01 +00:00
|
|
|
%define GO_BUILD_FLAGS -buildmode=pie
|
2016-03-27 10:27:18 +00:00
|
|
|
|
2016-11-24 12:49:04 +00:00
|
|
|
# MANUAL: Update the git_version and git_revision
|
2017-12-19 03:42:51 +00:00
|
|
|
%define git_version 06b9cb35161009dcb7123345749fef02f7cea8e0
|
|
|
|
%define git_short 06b9cb351610
|
2016-11-24 12:49:04 +00:00
|
|
|
# How to get the git_revision
|
2017-10-18 04:27:20 +00:00
|
|
|
# git clone https://github.com/containerd/containerd.git containerd-upstream
|
2016-11-24 12:49:04 +00:00
|
|
|
# cd containerd
|
|
|
|
# git checkout $git_version
|
|
|
|
# git_revision=r$(git rev-list HEAD | wc -l)
|
2017-12-19 03:42:51 +00:00
|
|
|
%define git_revision r706
|
|
|
|
|
|
|
|
# These are the git commits required. We verify them against the source to make
|
|
|
|
# sure we didn't miss anything important when doing upgrades. This MUST match
|
|
|
|
# required_dockerrunc in docker.spec!
|
|
|
|
%define required_dockerrunc 3f2f8b84a77f73d38244dd690525642a72156c64
|
2016-08-23 16:06:44 +00:00
|
|
|
|
2016-03-27 10:27:18 +00:00
|
|
|
Name: containerd
|
2017-12-19 03:42:51 +00:00
|
|
|
Version: 0.2.9+git%{git_revision}_%{git_short}
|
2016-03-27 10:27:18 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Standalone OCI Container Daemon
|
2016-06-17 14:40:17 +00:00
|
|
|
License: Apache-2.0
|
2016-03-27 10:27:18 +00:00
|
|
|
Group: System/Management
|
2016-06-17 14:40:17 +00:00
|
|
|
Url: https://containerd.tools
|
2017-10-26 18:00:35 +00:00
|
|
|
Source: %{name}-git.%{git_short}.tar.xz
|
2016-03-27 11:14:42 +00:00
|
|
|
Source1: %{name}.service
|
2016-04-01 12:49:25 +00:00
|
|
|
Source2: %{name}.socket
|
|
|
|
Source3: sysconfig.%{name}
|
2017-10-26 18:00:35 +00: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 04:27:20 +00:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-03-27 10:27:18 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2017-12-19 03:42:51 +00:00
|
|
|
# We provide a git revision so that Docker can require it properly.
|
|
|
|
Provides: %{name}-git = %{git_version}
|
|
|
|
# Currently runC is the only supported runtime for containerd. We match the
|
|
|
|
# same version as the one pinned by Docker.
|
|
|
|
Requires: docker-runc-git = %{required_dockerrunc}
|
2016-10-25 12:11:15 +00:00
|
|
|
Requires(post): %fillup_prereq
|
2018-02-02 10:30:25 +00:00
|
|
|
ExcludeArch: s390
|
2016-08-23 16:06:44 +00:00
|
|
|
|
2016-03-27 10:27:18 +00:00
|
|
|
%description
|
2016-04-01 12:49:25 +00:00
|
|
|
Containerd is a daemon with an API and a command line client, to manage
|
2016-03-27 10:27:18 +00:00
|
|
|
containers on one machine. It uses runC to run containers according to the OCI
|
2016-04-01 12:49:25 +00:00
|
|
|
specification. Containerd has advanced features such as seccomp and user
|
2016-03-27 10:27:18 +00:00
|
|
|
namespace support as well as checkpoint and restore for cloning and live
|
|
|
|
migration of containers.
|
|
|
|
|
2016-03-27 11:20:12 +00:00
|
|
|
%package ctr
|
2016-03-27 11:14:42 +00:00
|
|
|
Summary: Client for %{name}
|
|
|
|
Group: System/Management
|
|
|
|
Requires: %{name} = %{version}
|
2017-10-18 04:27:20 +00:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-03-27 11:14:42 +00:00
|
|
|
|
2016-03-27 11:20:12 +00:00
|
|
|
%description ctr
|
2016-03-27 11:14:42 +00:00
|
|
|
Standalone client for containerd, which allows management of containerd containers
|
|
|
|
separately from Docker.
|
|
|
|
|
2016-08-18 09:49:59 +00:00
|
|
|
%package test
|
|
|
|
Summary: Test package for containerd
|
|
|
|
Group: System/Management
|
2017-10-18 04:27:20 +00:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-08-18 09:49:59 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description test
|
|
|
|
Test package for containerd. It contains the source code and the tests.
|
|
|
|
|
2016-03-27 10:27:18 +00:00
|
|
|
%prep
|
2017-10-26 18:00:35 +00:00
|
|
|
%setup -q -n %{name}-git.%{git_short}
|
|
|
|
# bsc#1065109 boo#1053532
|
|
|
|
%patch100 -p1
|
2016-03-27 10:27:18 +00:00
|
|
|
|
|
|
|
%build
|
2016-08-18 09:49:59 +00: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-12-19 03:42:51 +00:00
|
|
|
export GOPATH=$HOME/go
|
|
|
|
export PROJECT=$HOME/go/src/github.com/containerd/containerd
|
|
|
|
mkdir -p $PROJECT
|
|
|
|
rm -rf $PROJECT/*
|
|
|
|
cp -ar * $PROJECT
|
2016-03-27 10:27:18 +00:00
|
|
|
|
2017-12-19 03:42:51 +00:00
|
|
|
make -C $PROJECT GIT_COMMIT=%{git_version}
|
|
|
|
cp $PROJECT/bin/ctr ctr-%{version}
|
|
|
|
cp $PROJECT/bin/containerd containerd-%{version}
|
|
|
|
cp $PROJECT/bin/containerd-shim containerd-shim-%{version}
|
2016-03-27 10:27:18 +00:00
|
|
|
|
2016-08-23 15:13:07 +00:00
|
|
|
%check
|
2018-06-05 07:45:58 +00: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 15:13:07 +00:00
|
|
|
|
2016-03-27 10:27:18 +00:00
|
|
|
%install
|
2017-10-26 18:00:35 +00: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 10:27:18 +00:00
|
|
|
|
2016-03-27 11:14:42 +00:00
|
|
|
# Add service and sysconfig.
|
2017-04-28 16:29:50 +00:00
|
|
|
install -D -m644 %SOURCE1 %{buildroot}/%{_unitdir}/%{name}.service
|
|
|
|
install -D -m644 %SOURCE2 %{buildroot}/%{_unitdir}/%{name}.socket
|
2016-04-29 10:06:39 +00:00
|
|
|
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rccontainerd
|
2017-11-24 10:06:55 +00:00
|
|
|
install -D -m644 %SOURCE3 %{buildroot}%{_fillupdir}/sysconfig.%{name}
|
2016-03-27 11:14:42 +00:00
|
|
|
|
2016-08-18 09:49:59 +00:00
|
|
|
install -d -m755 %{buildroot}/usr/src/containerd/
|
2017-10-18 04:27:20 +00:00
|
|
|
cp -ar $HOME/go/src/github.com/containerd/containerd/* %{buildroot}/usr/src/containerd/
|
2018-01-04 05:13:12 +00:00
|
|
|
# remove files we don't want to ship - exclude is the wrong usage here
|
|
|
|
rm -rf %{buildroot}/usr/src/containerd/bin
|
2016-08-18 09:49:59 +00:00
|
|
|
|
2017-10-26 18:00:35 +00:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2016-03-27 11:14:42 +00:00
|
|
|
%pre
|
2016-04-01 12:49:25 +00:00
|
|
|
%service_add_pre %{name}.service %{name}.socket
|
2016-03-27 11:14:42 +00:00
|
|
|
|
2016-03-27 10:27:18 +00:00
|
|
|
%post
|
2016-04-01 12:49:25 +00:00
|
|
|
%service_add_post %{name}.service %{name}.socket
|
2016-03-27 11:14:42 +00:00
|
|
|
%{fillup_only -n containerd}
|
|
|
|
|
|
|
|
%preun
|
2016-04-01 12:49:25 +00:00
|
|
|
%service_del_preun %{name}.service %{name}.socket
|
2016-03-27 10:27:18 +00:00
|
|
|
|
|
|
|
%postun
|
2016-04-01 12:49:25 +00:00
|
|
|
%service_del_postun %{name}.service %{name}.socket
|
2016-03-27 10:27:18 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc LICENSE.code LICENSE.docs README.md
|
2017-10-26 18:00:35 +00:00
|
|
|
%{_sbindir}/containerd
|
|
|
|
%{_sbindir}/containerd-shim
|
2016-03-27 11:14:42 +00:00
|
|
|
%{_unitdir}/%{name}.service
|
2016-04-01 12:49:25 +00:00
|
|
|
%{_unitdir}/%{name}.socket
|
2017-11-24 10:06:55 +00:00
|
|
|
%{_fillupdir}/sysconfig.%{name}
|
2016-04-29 10:06:39 +00:00
|
|
|
%{_sbindir}/rccontainerd
|
2016-03-27 11:14:42 +00:00
|
|
|
|
2016-03-27 11:20:12 +00:00
|
|
|
%files ctr
|
2017-10-26 18:00:35 +00:00
|
|
|
%{_sbindir}/%{name}-ctr
|
2016-06-17 14:40:17 +00:00
|
|
|
|
2016-08-18 09:49:59 +00:00
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/src/containerd/
|
|
|
|
|
2016-06-17 14:40:17 +00:00
|
|
|
%changelog
|