sed -i "s@^KERNEL_BUILDER_MAKEDIR:=.*@KERNEL_BUILDER_MAKEDIR:=/lib/modules/${KV_FULL}/build@" kmake.mk || die "Fail to set desired kernel version in the Makefile"
}
src_compile(){
use uspace && emake PREFIX="${EPREFIX}/usr"
localmodlist=(kyoutubeUnblock=net:::kmake )
localmodargs=(
KERNELDIR=${KV_OUT_DIR}
)
use modules && linux-mod-r1_src_compile
}
src_install(){
use uspace && emake \
PREFIX="${EPREFIX}/usr"\
DESTDIR="${D}"\
MANDIR="/usr/share/man"\
install
use modules && linux-mod-r1_src_install
use module-src && emake DESTDIR="${D}"PREFIX="${EPREFIX}/usr" -C src dkms-install
}
pkg_postinst(){
if use module-src && ! use modules;then
einfo
einfo "You have enabled the module-src USE flag without the modules USE"
einfo "flag. This means that sources are installed to"
einfo "${ROOT}/usr/src/kyoutubeUnblock instead of having the"
einfo "kernel module compiled. You will need to compile the module"
einfo "yourself. Most likely, you don't want this USE flag, and should"
einfo "rather use USE=modules"
einfo
fi
if use modules;then
linux-mod-r1_pkg_postinst
local old new
if[[$(uname -r) !="${KV_FULL}"]];then
ewarn
ewarn "You have just built kyoutubeUnblock for kernel ${KV_FULL}, yet the currently running"
ewarn "kernel is $(uname -r). If you intend to use this kyoutubeUnblock module on the currently"
ewarn "running machine, you will first need to reboot it into the kernel ${KV_FULL}, for"