2016-03-27 12:27:18 +02:00
|
|
|
#
|
|
|
|
# spec file for package containerd
|
|
|
|
#
|
2019-01-11 12:01:41 +01:00
|
|
|
# Copyright (c) 2019 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.
|
|
|
|
|
2019-03-25 07:51:51 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-03-27 12:27:18 +02:00
|
|
|
#
|
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
|
|
|
|
2017-11-24 11:06:55 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
|
|
|
|
2018-08-20 10:55:45 +02:00
|
|
|
# Handle _multibuild magic.
|
|
|
|
%define flavour @BUILD_FLAVOR@%{nil}
|
|
|
|
|
|
|
|
# We split the Name: into "realname" and "name_suffix".
|
|
|
|
%define realname containerd
|
|
|
|
%if "%flavour" == ""
|
|
|
|
%define name_suffix %{nil}
|
|
|
|
%else
|
|
|
|
%define name_suffix -%{flavour}
|
|
|
|
%endif
|
|
|
|
|
2018-08-24 10:10:17 +02:00
|
|
|
# MANUAL: Update the git_version.
|
2019-10-09 03:08:46 +02:00
|
|
|
%define git_version b34a5c8af56e510852c35414db4c1f4fa6172339
|
|
|
|
%define git_short b34a5c8af56e
|
2017-12-19 04:42:51 +01:00
|
|
|
|
2018-08-20 10:55:45 +02:00
|
|
|
Name: %{realname}%{name_suffix}
|
2019-10-09 03:08:46 +02:00
|
|
|
Version: 1.2.10
|
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
|
|
|
|
Url: https://containerd.tools
|
2019-05-03 18:22:54 +02:00
|
|
|
Source: %{realname}-%{version}_%{git_short}.tar.xz
|
2018-08-20 10:55:45 +02:00
|
|
|
Source1: %{realname}-rpmlintrc
|
2018-11-05 11:38:14 +01:00
|
|
|
# OPENSUSE-FIX-UPSTREAM: Backport of https://github.com/containerd/containerd/pull/2764.
|
2019-02-06 10:42:32 +01:00
|
|
|
Patch1: 0001-makefile-remove-emoji.patch
|
2017-10-26 20:00:35 +02:00
|
|
|
BuildRequires: fdupes
|
2018-08-15 09:09:11 +02:00
|
|
|
BuildRequires: glibc-devel-static
|
|
|
|
BuildRequires: go-go-md2man
|
|
|
|
BuildRequires: libbtrfs-devel >= 3.8
|
|
|
|
BuildRequires: libseccomp-devel >= 2.2
|
|
|
|
BuildRequires: pkg-config
|
2019-05-03 18:22:54 +02:00
|
|
|
BuildRequires: golang(API) >= 1.11
|
2017-12-19 04:42:51 +01:00
|
|
|
# We provide a git revision so that Docker can require it properly.
|
|
|
|
Provides: %{name}-git = %{git_version}
|
2019-02-08 11:37:59 +01:00
|
|
|
# Currently runc is the only supported runtime for containerd. We pin the same
|
|
|
|
# flavour as us, to avoid mixing (the version pinning is done by docker.spec).
|
|
|
|
Requires: docker-runc%{name_suffix}
|
2016-10-25 14:11:15 +02:00
|
|
|
Requires(post): %fillup_prereq
|
2018-02-02 11:30:25 +01:00
|
|
|
ExcludeArch: s390
|
2018-08-20 10:55:45 +02:00
|
|
|
# KUBIC-SPECIFIC: This was required when upgrading from the original kubic
|
|
|
|
# packaging, when everything was renamed to -kubic. It also is
|
|
|
|
# used to ensure that nothing complains too much when using
|
|
|
|
# -kubic packages. Hopfully it can be removed one day.
|
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# Obsolete older package without -kubic suffix: v2 -> v3
|
|
|
|
Obsoletes: %{realname} = 0.2.5+gitr569_2a5e70c
|
|
|
|
Obsoletes: %{realname}_2a5e70c
|
|
|
|
# Conflict with non-kubic package, and provide equivalent
|
|
|
|
Conflicts: %{realname} > 0.2.5+gitr569_2a5e70c
|
|
|
|
Provides: %{realname} = %{version}
|
2019-01-11 12:01:41 +01:00
|
|
|
# Disable leap based builds for kubic flavor (bsc#1121412)
|
|
|
|
%if 0%{?suse_version} == 1500 && 0%{?is_opensuse}
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%endif
|
2018-08-20 10:55:45 +02:00
|
|
|
%endif
|
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}
|
|
|
|
Requires: %{name} = %{version}
|
2018-08-20 10:55:45 +02:00
|
|
|
# KUBIC-SPECIFIC: This was required when upgrading from the original kubic
|
|
|
|
# packaging, when everything was renamed to -kubic. It also is
|
|
|
|
# used to ensure that nothing complains too much when using
|
|
|
|
# -kubic packages. Hopfully it can be removed one day.
|
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# Obsolete older package without -kubic suffix: v2 -> v3
|
|
|
|
Obsoletes: %{realname}-ctr = 0.2.5+gitr569_2a5e70c
|
|
|
|
# Conflict with non-kubic package, and provide equivalent
|
|
|
|
Conflicts: %{realname}-ctr > 0.2.5+gitr569_2a5e70c
|
|
|
|
Provides: %{realname}-ctr = %{version}
|
|
|
|
%endif
|
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-03-27 12:27:18 +02:00
|
|
|
%prep
|
2019-05-03 18:22:54 +02:00
|
|
|
%setup -q -n %{realname}-%{version}_%{git_short}
|
2018-08-15 09:09:11 +02:00
|
|
|
%patch1 -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-12-19 04:42:51 +01: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 12:27:18 +02:00
|
|
|
|
2018-08-15 09:09:11 +02:00
|
|
|
BUILDTAGS="apparmor selinux seccomp"
|
|
|
|
make -C $PROJECT \
|
|
|
|
BUILDTAGS="$BUILDTAGS" \
|
|
|
|
VERSION="v%{version}" \
|
|
|
|
REVISION="%{git_version}"
|
|
|
|
make man
|
|
|
|
|
2017-12-19 04:42:51 +01:00
|
|
|
cp $PROJECT/bin/ctr ctr-%{version}
|
|
|
|
cp $PROJECT/bin/containerd containerd-%{version}
|
|
|
|
cp $PROJECT/bin/containerd-shim containerd-shim-%{version}
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2016-08-23 17:13:07 +02:00
|
|
|
%check
|
2018-06-05 09:45:58 +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:13:07 +02:00
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%install
|
2018-08-15 09:09:11 +02:00
|
|
|
# Install binaries.
|
2018-08-20 10:55:45 +02:00
|
|
|
install -D -m755 containerd-%{version} %{buildroot}/%{_sbindir}/%{realname}
|
|
|
|
install -D -m755 containerd-shim-%{version} %{buildroot}/%{_sbindir}/%{realname}-shim
|
|
|
|
install -D -m755 ctr-%{version} %{buildroot}/%{_sbindir}/%{realname}-ctr
|
2016-03-27 12:27:18 +02:00
|
|
|
|
2018-08-15 09:09:11 +02:00
|
|
|
# Install docker-* symlinks to said binaries, since in order to use the
|
|
|
|
# upstream setup, Docker needs to spawn containerd and needs to have the
|
|
|
|
# binaries have specific names.
|
2018-08-20 10:55:45 +02:00
|
|
|
ln -s %{_sbindir}/%{realname} %{buildroot}/%{_sbindir}/docker-%{realname}
|
|
|
|
ln -s %{_sbindir}/%{realname}-shim %{buildroot}/%{_sbindir}/docker-%{realname}-shim
|
2018-08-15 09:09:11 +02:00
|
|
|
|
|
|
|
# Set up dummy configuration.
|
2018-08-20 10:55:45 +02:00
|
|
|
install -d -m755 %{buildroot}/%{_sysconfdir}/%{realname}
|
|
|
|
echo "# See containerd-config.toml(5) for documentation." >%{buildroot}/%{_sysconfdir}/%{realname}/config.toml
|
2018-08-15 09:09:11 +02:00
|
|
|
|
|
|
|
# Man pages.
|
|
|
|
for file in man/*
|
|
|
|
do
|
|
|
|
section="${file##*.}"
|
|
|
|
install -D -m644 "$file" "%{buildroot}/%{_mandir}/man$section/$(basename "$file")"
|
|
|
|
done
|
2018-08-20 10:55:45 +02:00
|
|
|
ln -s ctr.1 %{buildroot}/%{_mandir}/man1/%{realname}-ctr.1
|
2018-08-15 09:09:11 +02:00
|
|
|
|
2017-10-26 20:00:35 +02:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2016-03-27 12:27:18 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2018-06-13 12:19:14 +02:00
|
|
|
%doc README.md
|
2018-08-15 09:09:11 +02:00
|
|
|
%license LICENSE
|
2018-08-20 10:55:45 +02:00
|
|
|
%dir %{_sysconfdir}/%{realname}
|
|
|
|
%config %{_sysconfdir}/%{realname}/config.toml
|
|
|
|
%{_sbindir}/%{realname}
|
|
|
|
%{_sbindir}/docker-%{realname}
|
|
|
|
%{_sbindir}/%{realname}-shim
|
|
|
|
%{_sbindir}/docker-%{realname}-shim
|
|
|
|
%{_mandir}/man*/%{realname}*
|
2018-08-15 09:09:11 +02:00
|
|
|
%exclude %{_mandir}/man1/*ctr.1*
|
2016-03-27 13:14:42 +02:00
|
|
|
|
2016-03-27 13:20:12 +02:00
|
|
|
%files ctr
|
2018-08-20 10:55:45 +02:00
|
|
|
%{_sbindir}/%{realname}-ctr
|
2018-08-15 09:09:11 +02:00
|
|
|
%{_mandir}/man1/*ctr.1*
|
2016-06-17 16:40:17 +02:00
|
|
|
|
|
|
|
%changelog
|