Blob Blame History Raw
# Generated by go2rpm 1.11.0
%bcond_without check

# https://github.com/containerd/containerd
%global goipath         github.com/containerd/containerd
Version:                1.7.15

%gometa -L -f

%global common_description %{expand:
Containerd is an industry-standard container runtime with an emphasis on
simplicity, robustness and portability. It is available as a daemon for Linux
and Windows, which can manage the complete container lifecycle of its host
system: image transfer and storage, container execution and supervision,
low-level storage and network attachments, etc.}

Name:           containerd
Release:        %autorelease
Summary:        An open and reliable container runtime

# Generated by go-vendor-tools
# SourceLicense:  Apache-2.0
License:        Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
URL:            %{gourl}
Source0:        %{gosource}
# Generated by go-vendor-tools
Source1:        %{archivename}-vendor.tar.bz2
Source2:        go-vendor-tools.toml
Source3:        containerd.toml

Patch:          0001-Makefile-fix-GO_LDFLAGS-quoting.patch

BuildRequires:  /usr/bin/go-md2man
BuildRequires:  btrfs-progs-devel
BuildRequires:  go-vendor-tools
BuildRequires:  make
BuildRequires:  systemd-rpm-macros

Requires:       runc

%description %{common_description}

%prep
%goprep -A
%setup -q -T -D -a1 %{forgesetupargs}
%autopatch -p1
# Replace default bin directory
sed -i "s|/usr/local/bin/containerd|/usr/bin/containerd|" containerd.service
cp -p %{S:3} .

%generate_buildrequires
%go_vendor_license_buildrequires -c %{S:2}

%build
GO_LDFLAGS="" GO_BUILDFLAGS=""
%global makeflags %{expand:\\
    DATADIR=%{_datadir} \\
    DESTDIR=%{buildroot} \\
    EXTRA_LDFLAGS=%{gobuild_ldflags_shescaped} \\
    GO_BUILD_FLAGS=%{gobuild_baseflags_shescaped} \\
    MANDIR=%{_mandir} \\
    PREFIX=%{_prefix} \\
    REVISION=%{release} \\
    SHIM_CGO_ENABLED=1 \\
    VERSION=%{version} \\
}
%make_build %{makeflags} binaries man

%install
%go_vendor_license_install -c %{S:2}
%make_build %{makeflags} install install-man
install -Dpm 0644 containerd.service -t %{buildroot}%{_unitdir}
install -Dpm 0644 containerd.toml %{buildroot}%{_sysconfdir}/containerd/config.toml

%check
%go_vendor_license_check -c %{S:2}
%if %{with check}
%make_build %{makeflags} test
%endif

%files -f %{go_vendor_license_filelist}
%license vendor/modules.txt
%doc ROADMAP.md ADOPTERS.md BUILDING.md README.md RELEASES.md SCOPE.md
%{_bindir}/ctr
%{_bindir}/containerd
%{_bindir}/containerd-stress
%{_bindir}/containerd-shim*
%{_mandir}/man5/containerd-config.toml.5*
%{_mandir}/man8/ctr.8*
%{_mandir}/man8/containerd.8*
%{_mandir}/man8/containerd-config.8*
%dir %{_sysconfdir}/containerd
%config(noreplace) %{_sysconfdir}/containerd/config.toml
%{_unitdir}/containerd.service


%changelog
%autochangelog