diff --git a/containerd.spec b/containerd.spec index bd66c5ad99b8eca68f20d8093d6663e92d7203eb..35ee43ba2d8334b573a122bc9be9335888e37adf 100644 --- a/containerd.spec +++ b/containerd.spec @@ -1,50 +1,34 @@ -%define anolis_release 1 +%define anolis_release 2 %bcond_without check -# https://github.com/containerd/containerd -%global goipath github.com/containerd/containerd -Version: 1.6.20 +%global goipath github.com/containerd/containerd -%gometa - -%global goname containerd -%global godevelname containerd-devel - -%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.} - -%global golicenses LICENSE NOTICE -%global godocs docs ROADMAP.md SCOPE.md code-of-conduct.md\\\ - BUILDING.md README.md RELEASES.md - -Name: %{goname} +Name: containerd +Version: 1.6.20 Release: %{anolis_release}%{?dist} Summary: Open and reliable container runtime - -# Upstream license specification: Apache-2.0 License: ASL 2.0 -URL: %{gourl} -Source0: %{gosource} +URL: https://github.com/containerd/containerd +Source0: https://github.com/containerd/containerd/archive/refs/tags/v%{version}.tar.gz Source1: containerd.service Source2: containerd.toml # Carve out code requiring github.com/Microsoft/hcsshim Patch0: 0001-Revert-commit-for-Windows-metrics.patch Patch1: 0002-Remove-windows-only-dep.patch -BuildRequires: btrfs-progs-devel -BuildRequires: systemd-rpm-macros -BuildRequires: go-md2man +BuildRequires: btrfs-progs-devel systemd-rpm-macros go-md2man Requires: runc %description -%{common_description} +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. +%gometa %gopkg %package doc @@ -74,12 +58,15 @@ go-md2man -in docs/man/containerd-config.toml.5.md -out _man/containerd-config.t rm %{gobuilddir}/bin/gen-manpages %install -install -m 0755 -vd %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ -install -D -p -m 0644 _man/containerd.8 %{buildroot}%{_mandir}/man8/containerd.8 -install -D -p -m 0644 _man/containerd-config.8 %{buildroot}%{_mandir}/man8/containerd-config.8 -install -D -p -m 0644 _man/ctr.8 %{buildroot}%{_mandir}/man8/ctr.8 -install -D -p -m 0644 _man/containerd-config.toml.5 %{buildroot}%{_mandir}/man5/containerd-config.toml.5 +for file in containerd.8 containerd-config.8 ctr.8 containerd-config.toml.5; do + if [ $file == "containerd-config.toml.5" ]; then + install -D -p -m 0644 _man/$file %{buildroot}%{_mandir}/man5/$file + else + install -D -p -m 0644 _man/$file %{buildroot}%{_mandir}/man8/$file + fi +done install -D -p -m 0644 %{S:1} %{buildroot}%{_unitdir}/containerd.service install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml @@ -101,7 +88,6 @@ install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml %files %license LICENSE NOTICE - %{_bindir}/* %dir %{abidir} %{abidir}/*-option.list @@ -114,10 +100,13 @@ install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml %config(noreplace) %{_sysconfdir}/containerd/config.toml %files doc -%doc docs ROADMAP.md SCOPE.md code-of-conduct.md BUILDING.md -%doc README.md RELEASES.md +%doc README.md RELEASES.md docs ROADMAP.md SCOPE.md +%doc code-of-conduct.md BUILDING.md %changelog +* Mon Apr 10 2023 yuanhui - 1.6.20-2 +- Optimize the spec file + * Fri Apr 07 2023 Funda Wang - 1.6.20-1 - New version 1.6.20 diff --git a/containerd-1.6.20.tar.gz b/v1.6.20.tar.gz similarity index 100% rename from containerd-1.6.20.tar.gz rename to v1.6.20.tar.gz