[packages/containerd] package systemd unit

atler atler at pld-linux.org
Wed Aug 21 19:18:48 CEST 2024


commit 2d418daca74a761445b6bf01e33abccb9b21385c
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Aug 21 18:49:03 2024 +0200

    package systemd unit

 containerd.spec | 21 ++++++++++++++++++++-
 systemd.patch   | 11 +++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
---
diff --git a/containerd.spec b/containerd.spec
index c9c4cf0..ab8d1a1 100644
--- a/containerd.spec
+++ b/containerd.spec
@@ -1,11 +1,12 @@
 Summary:	An open and reliable container runtime
 Name:		containerd
 Version:	1.6.0
-Release:	1
+Release:	2
 License:	Apache v2.0
 Group:		Applications
 Source0:	https://github.com/containerd/containerd/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	aa0371db45d4e149e65ccbbddcbed8b1
+Patch0:		systemd.patch
 URL:		https://containerd.io/
 BuildRequires:	btrfs-progs-devel
 BuildRequires:	golang >= 1.16
@@ -26,6 +27,7 @@ etc.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__make} binaries \
@@ -35,13 +37,29 @@ etc.
 %install
 rm -rf $RPM_BUILD_ROOT
 
+install -d $RPM_BUILD_ROOT%{systemdunitdir}
+
 %{__make} install \
 	DESTDIR="$RPM_BUILD_ROOT" \
 	PREFIX="%{_prefix}"
 
+cp -p containerd.service $RPM_BUILD_ROOT%{systemdunitdir}
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+%systemd_post containerd.service
+
+%preun
+%systemd_preun containerd.service
+
+%postun
+%systemd_reload
+
+%triggerpostun -- %{name} < 1.6.0-2
+%systemd_trigger containerd.service
+
 %files
 %defattr(644,root,root,755)
 %doc {ADOPTERS,BUILDING,README,RELEASES,ROADMAP,SCOPE}.md
@@ -51,3 +69,4 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/containerd-shim-runc-v2
 %attr(755,root,root) %{_bindir}/containerd-stress
 %attr(755,root,root) %{_bindir}/ctr
+%{systemdunitdir}/containerd.service
diff --git a/systemd.patch b/systemd.patch
new file mode 100644
index 0000000..d38092e
--- /dev/null
+++ b/systemd.patch
@@ -0,0 +1,11 @@
+--- containerd-1.6.0/containerd.service.orig	2024-08-21 10:56:47.520768807 +0200
++++ containerd-1.6.0/containerd.service	2024-08-21 18:44:14.468072341 +0200
+@@ -19,7 +19,7 @@
+ 
+ [Service]
+ ExecStartPre=-/sbin/modprobe overlay
+-ExecStart=/usr/local/bin/containerd
++ExecStart=/usr/bin/containerd
+ 
+ Type=notify
+ Delegate=yes
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/containerd.git/commitdiff/fcf2f188ab7cccd60cba95a5914309fd74286355



More information about the pld-cvs-commit mailing list