Accepting request 629485 from home:cyphar:kubic:vc_refactor

- Merge -kubic packages back into the main Virtualization:containers packages.
  This is done using _multibuild to add a "kubic" flavour, which is then used
  to conditionally compile patches and other kubic-specific features.
  bsc#1105000

OBS-URL: https://build.opensuse.org/request/show/629485
OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/containerd?expand=0&rev=78
This commit is contained in:
Aleksa Sarai 2018-08-20 08:55:45 +00:00 committed by Git OBS Bridge
parent 099ca57ebe
commit a8d416a98f
3 changed files with 102 additions and 24 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>kubic</package>
</multibuild>

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Aug 16 02:00:31 UTC 2018 - asarai@suse.com
- Merge -kubic packages back into the main Virtualization:containers packages.
This is done using _multibuild to add a "kubic" flavour, which is then used
to conditionally compile patches and other kubic-specific features.
bsc#1105000
-------------------------------------------------------------------
Wed Aug 1 09:40:59 UTC 2018 - asarai@suse.com
@ -34,6 +42,28 @@ Tue Jun 5 06:38:40 UTC 2018 - asarai@suse.com
and hasn't (as far as I remember) ever caught a release-blocking issue. Smoke
testing has been far more useful. boo#1095817
-------------------------------------------------------------------
Wed May 16 10:10:10 UTC 2018 - jmassaguerpla@suse.com
- Review obsoletes tag to fix bsc#1080978
-------------------------------------------------------------------
Thu Apr 12 12:48:16 UTC 2018 - fcastelli@suse.com
- Put containerd under the podruntime slice. This the recommended
deployment to allow fine resource control on Kubernetes.
bsc#1086185
-------------------------------------------------------------------
Mon Feb 12 10:52:49 UTC 2018 - rbrown@suse.com
- Add ${version} to equivalent non-kubic package provides
-------------------------------------------------------------------
Thu Feb 8 12:34:13 UTC 2018 - rbrown@suse.com
- Add Provides for equivalent non-kubic packages
-------------------------------------------------------------------
Thu Feb 1 16:57:14 CET 2018 - ro@suse.de

View File

@ -22,6 +22,17 @@
%define _fillupdir /var/adm/fillup-templates
%endif
# 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
# MANUAL: Update the git_version and git_revision
%define containerd_version 1.1.1
%define git_version d64c661f1d51c48782c9cec8fda7604785f93587
@ -38,15 +49,15 @@
# required_dockerrunc in docker.spec!
%define required_dockerrunc 69663f0bd4b60df09991c08812a60108003fa340
Name: containerd
Name: %{realname}%{name_suffix}
Version: 1.1.1
Release: 0
Summary: Standalone OCI Container Daemon
License: Apache-2.0
Group: System/Management
Url: https://containerd.tools
Source: %{name}-git.%{git_short}.tar.xz
Source1: %{name}-rpmlintrc
Source: %{realname}-git.%{git_short}.tar.xz
Source1: %{realname}-rpmlintrc
# OPENSUSE-BACKPORT: Backport of https://github.com/containerd/containerd/pull/2534.
Patch1: 0001-docs-man-rename-config.toml-5-to-be-more-descriptive.patch
BuildRequires: fdupes
@ -56,14 +67,26 @@ BuildRequires: libbtrfs-devel >= 3.8
BuildRequires: libseccomp-devel >= 2.2
BuildRequires: pkg-config
BuildRequires: golang(API) = 1.10
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# 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}
# Currently runc is the only supported runtime for containerd. We match the
# same version as the one pinned by Docker. Obviously we pin the same flavour
# as us, to avoid mixing.
Requires: docker-runc%{name_suffix}-git = %{required_dockerrunc}
Requires(post): %fillup_prereq
ExcludeArch: s390
# 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}
%endif
%description
Containerd is a daemon with an API and a command line client, to manage
@ -77,6 +100,17 @@ Summary: Client for %{name}
Group: System/Management
Requires: %{name} = %{version}
BuildRequires: golang(API) = 1.10
# 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
%description ctr
Standalone client for containerd, which allows management of containerd containers
@ -87,12 +121,23 @@ Summary: Test package for containerd
Group: System/Management
BuildRequires: golang(API) = 1.10
BuildArch: noarch
# 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}-test = 0.2.5+gitr569_2a5e70c
# Conflict with non-kubic package, and provide equivalent
Conflicts: %{realname}-test > 0.2.5+gitr569_2a5e70c
Provides: %{realname}-test = %{version}
%endif
%description test
Test package for containerd. It contains the source code and the tests.
%prep
%setup -q -n %{name}-git.%{git_short}
%setup -q -n %{realname}-git.%{git_short}
%patch1 -p1
%build
@ -125,19 +170,19 @@ cp $PROJECT/bin/containerd-shim containerd-shim-%{version}
%install
# Install binaries.
install -D -m755 containerd-%{version} %{buildroot}/%{_sbindir}/%{name}
install -D -m755 containerd-shim-%{version} %{buildroot}/%{_sbindir}/%{name}-shim
install -D -m755 ctr-%{version} %{buildroot}/%{_sbindir}/%{name}-ctr
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
# 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.
ln -s %{_sbindir}/%{name} %{buildroot}/%{_sbindir}/docker-%{name}
ln -s %{_sbindir}/%{name}-shim %{buildroot}/%{_sbindir}/docker-%{name}-shim
ln -s %{_sbindir}/%{realname} %{buildroot}/%{_sbindir}/docker-%{realname}
ln -s %{_sbindir}/%{realname}-shim %{buildroot}/%{_sbindir}/docker-%{realname}-shim
# Set up dummy configuration.
install -d -m755 %{buildroot}/%{_sysconfdir}/%{name}
echo "# See containerd-config.toml(5) for documentation." >%{buildroot}/%{_sysconfdir}/%{name}/config.toml
install -d -m755 %{buildroot}/%{_sysconfdir}/%{realname}
echo "# See containerd-config.toml(5) for documentation." >%{buildroot}/%{_sysconfdir}/%{realname}/config.toml
# Man pages.
for file in man/*
@ -145,7 +190,7 @@ do
section="${file##*.}"
install -D -m644 "$file" "%{buildroot}/%{_mandir}/man$section/$(basename "$file")"
done
ln -s ctr.1 %{buildroot}/%{_mandir}/man1/%{name}-ctr.1
ln -s ctr.1 %{buildroot}/%{_mandir}/man1/%{realname}-ctr.1
# Source tree for containerd-test.
install -d -m755 %{buildroot}/usr/src/containerd/
@ -159,17 +204,17 @@ rm -rf %{buildroot}/usr/src/containerd/bin
%defattr(-,root,root)
%doc README.md
%license LICENSE
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/config.toml
%{_sbindir}/%{name}
%{_sbindir}/docker-%{name}
%{_sbindir}/%{name}-shim
%{_sbindir}/docker-%{name}-shim
%{_mandir}/man*/%{name}*
%dir %{_sysconfdir}/%{realname}
%config %{_sysconfdir}/%{realname}/config.toml
%{_sbindir}/%{realname}
%{_sbindir}/docker-%{realname}
%{_sbindir}/%{realname}-shim
%{_sbindir}/docker-%{realname}-shim
%{_mandir}/man*/%{realname}*
%exclude %{_mandir}/man1/*ctr.1*
%files ctr
%{_sbindir}/%{name}-ctr
%{_sbindir}/%{realname}-ctr
%{_mandir}/man1/*ctr.1*
%files test