Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions SPECS/containerd/containerd.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)
# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors
# SPDX-FileContributor: wangyf0611 <wangyufeng@iscas.ac.cn>
#
# SPDX-License-Identifier: MulanPSL-2.0

%define _name containerd
%define go_import_path github.com/containerd/containerd/v2
%global commit aad11006b869517fcd3009450b6f82da282e1a9b

Name: containerd
Version: 2.3.3
Release: %autorelease
Summary: Industry-standard container runtime
License: Apache-2.0
URL: https://containerd.io
VCS: git:https://github.com/containerd/containerd.git
#!RemoteAsset: sha256:fcff2096ef20f1bc1d939bc55a8b831ea3eface574463fd7dc770b33ffe317b2
Source0: https://github.com/containerd/containerd/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildSystem: golang

BuildRequires: go >= 1.26.3
BuildRequires: go-md2man
BuildRequires: go-rpm-macros
BuildRequires: make
BuildRequires: systemd-rpm-macros

Requires: runc
%{?systemd_requires}

%description
containerd is an industry-standard container runtime with an emphasis on
simplicity, robustness, and portability. It manages the complete container
lifecycle of its host system, including image transfer and storage, container
execution and supervision, low-level storage, and network attachments.

%prep
%autosetup -n %{name}-%{version}

%build
export GO111MODULE=on
export GOFLAGS="-mod=vendor -trimpath -modcacherw"
export GOCACHE=%{_builddir}/go-build-cache
%make_build VERSION=v%{version} REVISION=%{commit} binaries man

%install
%make_install PREFIX=%{_prefix} VERSION=v%{version} REVISION=%{commit} install
%make_install PREFIX=%{_prefix} VERSION=v%{version} REVISION=%{commit} install-man

install -Dpm0644 containerd.service %{buildroot}%{_unitdir}/containerd.service
sed -i 's#/usr/local/bin/containerd#%{_bindir}/containerd#' \
%{buildroot}%{_unitdir}/containerd.service

install -d %{buildroot}%{_sysconfdir}/containerd
bin/containerd config default > %{buildroot}%{_sysconfdir}/containerd/config.toml

%check
%{buildroot}%{_bindir}/containerd --version
%{buildroot}%{_bindir}/ctr --version
%{buildroot}%{_bindir}/containerd-shim-runc-v2 --help >/dev/null

%post
%systemd_post containerd.service

%preun
%systemd_preun containerd.service

%postun
%systemd_postun_with_restart containerd.service

%files
%license LICENSE NOTICE vendor/modules.txt
%doc README.md RELEASES.md docs/
%{_bindir}/containerd
%{_bindir}/containerd-shim-runc-v2
%{_bindir}/containerd-stress
%{_bindir}/ctr
%dir %{_sysconfdir}/containerd
%config(noreplace) %{_sysconfdir}/containerd/config.toml
%{_unitdir}/containerd.service
%{_mandir}/man5/containerd-config.toml.5*
%{_mandir}/man8/containerd.8*
%{_mandir}/man8/containerd-config.8*
%{_mandir}/man8/ctr.8*

%changelog
%autochangelog
Loading