-%define KMOD_PATH %{_libdir}/stability-monitor/proc-tsm.ko
+%define KMOD_PATH %{_libdir}/stability-monitor
+%define TSM_PATH %{KMOD_PATH}/proc-tsm.ko
Name: stability-monitor-kmod-rpi3
-Version: 6.0.2
+Version: 6.1.1
Release: 0
License: GPL-2.0+
Source0: %{name}-%{version}.tar.xz
Summary: Stability monitoring kernel module
Group: System/Monitoring
ExclusiveArch: armv7l
+BuildRequires: module-init-tools
BuildRequires: arm-rpi3-linux-kernel-devel
-Provides: %{KMOD_PATH}
+Provides: %{TSM_PATH}
%description
This package provides kernel module for stability monitoring daemon.
cp %{SOURCE1} ./%{name}.manifest
%build
-make -C kernel KMOD_PATH=%KMOD_PATH KERNELDIR=/boot/kernel/devel/kernel-devel-arm-rpi3/
+make -C kernel clean KERNELDIR=/boot/kernel/devel/kernel-devel-arm-rpi3
+make -C kernel KERNELDIR=/boot/kernel/devel/kernel-devel-arm-rpi3/
+make -C kernel modules_install KERNELDIR=/boot/kernel/devel/kernel-devel-arm-rpi3 INSTALL_MOD_STRIP=1
%install
-install -D kernel/proc-tsm.ko %{buildroot}/%KMOD_PATH
+install -D kernel/proc-tsm.ko %{buildroot}/%TSM_PATH
+pushd lib/modules
+find -name "*.ko" -exec cp -a --parents {} %{buildroot}/%{KMOD_PATH}/ \;
+popd
install -D config/stability-monitor.conf %{buildroot}/etc/modprobe.d/stability-monitor.conf
%clean
rm -rf %{buildroot}
make -C kernel clean KERNELDIR=/boot/kernel/devel/kernel-devel-arm-rpi3
+rm -rf %{_builddir}/%{Name}-%{version}/lib
%files
%manifest %{name}.manifest
%license COPYING
-%KMOD_PATH
+%{KMOD_PATH}/*
/etc/modprobe.d/stability-monitor.conf