1SUMMARY = "Linux dynamic kernel patching infrastructure"
2DESCRIPTION = "kpatch is a Linux dynamic kernel patching infrastructure which allows you to patch a running kernel without rebooting or restarting any processes."
3LICENSE = "GPL-2.0-only & LGPL-2.0-only"
4DEPENDS = "elfutils bash"
5
6SRC_URI = "git://github.com/dynup/kpatch.git;protocol=https;branch=master \
7	file://0001-kpatch-build-add-cross-compilation-support.patch \
8	file://0002-kpatch-build-allow-overriding-of-distro-name.patch \
9	"
10
11EXTRA_OEMAKE = " \
12	PREFIX=${prefix} \
13	BINDIR=${D}${bindir} \
14	SBINDIR=${D}${sbindir} \
15	LIBDIR=${D}${libdir} \
16	MANDIR=${D}${mandir}/man1 \
17	SYSTEMDDIR=${D}${systemd_system_unitdir} \
18	UPSTARTDIR=${D}${sysconfdir}/init \
19	DESTDIR=${D} \
20	ARCH=${TARGET_ARCH} \
21	BUILDMOD=no \
22	CC='${CC}' \
23	"
24
25S = "${WORKDIR}/git"
26
27do_install () {
28	oe_runmake install
29}
30
31PACKAGES =+ "kpatch-build"
32PROVIDES += "kpatch-build"
33
34COMPATIBLE_HOST = "(x86_64).*-linux"
35COMPATIBLE_HOST:libc-musl = "null"
36
37RDEPENDS:${PN} = "bash binutils"
38RDEPENDS:kpatch-build = "bash glibc-utils"
39
40FILES:${PN} = " \
41	${sbindir}/kpatch \
42	${systemd_system_unitdir}/kpatch.service \
43	${mandir}/man1/kpatch.1.gz \
44	${sysconfdir}/init/kpatch.conf \
45	"
46FILES:kpatch-build = " \
47	${bindir}/kpatch-build \
48	${libexecdir}/* \
49	${datadir}/kpatch \
50	${mandir}/man1/kpatch-build.1.gz \
51	"
52
53SYSTEMD_SERVICE:${PN} = "kpatch.service"
54