diff --git a/1001-change-the-install-dir-to-system-path.patch b/1001-change-the-install-dir-to-system-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..d4b71c088a9e360669df2e46ae1aff0db384e51c --- /dev/null +++ b/1001-change-the-install-dir-to-system-path.patch @@ -0,0 +1,25 @@ +From 504fe902db6344ff15e993066d05a25e05c79361 Mon Sep 17 00:00:00 2001 +From: happy_orange +Date: Thu, 8 Dec 2022 09:59:02 +0800 +Subject: [PATCH 1/1] change the local path to os path + +--- + Makefile.inc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 15049f3..ad6ab9b 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -5,7 +5,7 @@ INSTALL = /usr/bin/install + + ARCH = $(shell uname -m) + +-PREFIX ?= /usr/local ++PREFIX ?= /usr + LIBDIR ?= lib + LIBEXEC ?= libexec + BINDIR = $(DESTDIR)$(PREFIX)/bin +-- +2.31.1 + diff --git a/kpatch-build-v1.0.0.tar.gz b/kpatch-build-v1.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a2b96577adb11b294bec28bba7fe1dc56561e76e Binary files /dev/null and b/kpatch-build-v1.0.0.tar.gz differ diff --git a/kpatch-build.spec b/kpatch-build.spec new file mode 100644 index 0000000000000000000000000000000000000000..0fd721f53e19975682212b56705912608fa4e780 --- /dev/null +++ b/kpatch-build.spec @@ -0,0 +1,66 @@ +%define anolis_release 1 +%define debug_package %{nil} + +Name: kpatch-build +Version: 1.0.0 +Release: %{anolis_release}%{?dist} +Summary: kpatch - live kernel patching +License: GPLv2 +URL: https://gitee.com/anolis/kpatch-build +Source0: https://gitee.com/anolis/kpatch-build/archive/refs/tags/%{name}-v%{version}.tar.gz + +BuildRequires: kernel-devel make gcc patch +BuildRequires: bison flex openssl-devel elfutils elfutils-devel dwarves + +Requires: bison flex openssl-devel elfutils elfutils-devel dwarves +Requires: kernel-devel gcc patch make + +Patch1001: 1001-change-the-install-dir-to-system-path.patch + +%description +kpatch-build is a hot patch creation tool that can perform CVE and +Bug fixes on the operating system kernel without restarting the +system and interrupting business. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -n %{name}-v%{version} -p1 + +%build +cd kpatch-build +make BUILDMOD=no + +%install +pushd kpatch-build +%make_install +popd + +install -d %{buildroot}/%{_datadir}/kpatch/patch +install -m 644 kmod/patch/* %{buildroot}/%{_datadir}/kpatch/patch + +%files +%license COPYING +%{_bindir}/kpatch-build +%dir %{_libexecdir}/kpatch +%{_libexecdir}/kpatch/create-diff-object +%{_libexecdir}/kpatch/create-klp-module +%{_libexecdir}/kpatch/create-kpatch-module +%{_libexecdir}/kpatch/kpatch-cc +%dir %{_datadir}/kpatch/patch +%{_datadir}/kpatch/patch/* + +%files doc +%doc README.md README.en.md +%doc doc/INSTALL.md doc/patch-author-guide.md +%doc doc/arm64-upstream-prerequisites.md + +%changelog +* Tue Jun 20 2022 happy_orange - 1.0.0-1 +- package init.