# Generated by go2rpm # arm support not fully implemented: not implemented %ifnarch %{arm} %bcond_without check %endif %bcond_without bootstrap # https://github.com/containerd/containerd %global goipath github.com/containerd/containerd Version: 1.7.0~beta.0 %global commit 3fefb98f9924593433998f906c3dfdee8e8a8a17 %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} Release: %autorelease Summary: Open and reliable container runtime License: Apache-2.0 URL: %{gourl} Source0: %{gosource} 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: go-md2man BuildRequires: systemd-rpm-macros Requires: runc %description %{common_description} %gopkg %prep %goprep %autopatch -p1 # Used only for generation: rm -rf cmd/protoc-gen-gogoctrd # Replace default bin directory sed -i "s|/usr/local/bin/containerd|/usr/bin/containerd|" containerd.service %if %{without bootstrap} %generate_buildrequires %go_generate_buildrequires %endif %if %{without bootstrap} %build export LDFLAGS="-X %{goipath}/version.Version=%{version} " for cmd in cmd/* ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done mkdir _man go-md2man -in docs/man/containerd-config.8.md -out _man/containerd-config.8 go-md2man -in docs/man/containerd-config.toml.5.md -out _man/containerd-config.toml.5 %{gobuilddir}/bin/gen-manpages containerd.8 _man %{gobuilddir}/bin/gen-manpages ctr.8 _man rm %{gobuilddir}/bin/gen-manpages %endif %install %gopkginstall %if %{without bootstrap} install -m 0755 -vd %{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 install -D -p -m 0644 containerd.service %{buildroot}%{_unitdir}/containerd.service install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml mkdir -p %{buildroot}%{_sharedstatedir}/containerd/opt %endif %post %systemd_post containerd.service %preun %systemd_preun containerd.service %postun %systemd_postun_with_restart containerd.service %if %{without bootstrap} %if %{with check} %check %gocheck -d pkg/cri/server -t integration -d platforms %endif %endif %if %{without bootstrap} %files %license LICENSE NOTICE %doc docs ROADMAP.md SCOPE.md code-of-conduct.md BUILDING.md %doc README.md RELEASES.md %{_bindir}/* %{_mandir}/man8/containerd.8* %{_mandir}/man8/containerd-config.8* %{_mandir}/man8/ctr.8* %{_mandir}/man5/containerd-config.toml.5* %{_unitdir}/containerd.service %dir %{_sysconfdir}/containerd %config(noreplace) %{_sysconfdir}/containerd/config.toml %dir %{_sharedstatedir}/containerd %dir %{_sharedstatedir}/containerd/opt %endif %gopkgfiles %changelog %autochangelog