File lime-kmp.spec of Package lime-kmp

#
# spec file for package lime-kmp
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2020 LISA GmbH, Bingen, Germany
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define modname	lime

Name:           lime-kmp
Version:        1.9+git.20200809T155235.fa37b69
Release:        0
Summary:        LiME ~ Linux Memory Extractor
Group:          System/Kernel
License:        GPL-2.0
URL:            https://github.com/504ensicslabs/lime
Source:         %{modname}-%{version}.tar.xz
Source1:        %{name}-preamble
BuildRequires:  kernel-syms >= 2.6.20
BuildRequires:  modutils

%{?kernel_module_package:%kernel_module_package -n %modname -p %name-preamble}

%description
A Loadable Kernel Module (LKM) which allows for volatile memory acquisition
from Linux and Linux-based devices, such as Android. This makes LiME unique as
it is the first tool that allows for full memory captures on Android devices.
It also minimizes its interaction between user and kernel space processes
during acquisition, which allows it to produce memory captures that are more
forensically sound than those of other tools designed for Linux memory
acquisition.

%package KMP
Summary:        LiME ~ Linux Memory Extractor
Group:          System/Kernel

%description KMP
A Loadable Kernel Module (LKM) which allows for volatile memory acquisition
from Linux and Linux-based devices, such as Android. This makes LiME unique as
it is the first tool that allows for full memory captures on Android devices.
It also minimizes its interaction between user and kernel space processes
during acquisition, which allows it to produce memory captures that are more
forensically sound than those of other tools designed for Linux memory
acquisition.

%prep
echo %flavors_to_build
%autosetup -n %modname-%version -p1
# massage makefile: don't strip, don't rename module
sed -i -e '/strip.*\.ko/d' -e '/mv.*\.ko/d' src/Makefile

%build
for flavor in %flavors_to_build; do
	cp -a src obj-$flavor
	pushd obj-$flavor
	kver=$(make -si -C /usr/src/linux-obj/%_target_cpu/$flavor %linux_make_arch kernelrelease 2>/dev/null)
	make %{?_smp_mflags} KVER=$kver KDIR=/usr/src/linux-obj/%_target_cpu/$flavor modules
	popd
done

%install
export INSTALL_MOD_PATH="%buildroot"

for flavor in %flavors_to_build; do
	pushd obj-$flavor
	kver=$(make -si -C /usr/src/linux-obj/%_target_cpu/$flavor/ %linux_make_arch kernelrelease 2>/dev/null)
	make %{?_smp_mflags} KVER=$kver KDIR=/usr/src/linux-obj/%_target_cpu/$flavor modules_install
	popd
done

%changelog
openSUSE Build Service is sponsored by