# Generated by go2rpm %bcond_with check %bcond_with bootstrap %global gomodulesmode GO111MODULE=on # https://github.com/containerd/containerd %global goipath github.com/containerd/containerd Version: 1.7.22 %gometa %global goname containerd %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} BuildRequires: btrfs-progs-devel BuildRequires: go-md2man BuildRequires: systemd-rpm-macros BuildRequires: libseccomp-devel Requires: runc %description %{common_description} %prep %goprep -k %autopatch -p1 # Used only for generation: rm -rf cmd/protoc-gen-go-fieldpath # Replace default bin directory sed -i "s|/usr/local/bin/containerd|/usr/bin/containerd|" containerd.service %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 %else rm -rf cmd %endif %install %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 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 %{with check} %check %gocheck -d pkg/cri/server -t integration -d platforms %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 %{_sharedstatedir}/containerd %dir %{_sharedstatedir}/containerd/opt %endif %changelog %autochangelog