File cryptodev-kmp.spec of Package cryptodev-kmp

%define bname cryptodev
Name: %bname-kmp
Version: 1.8
Release: 1
Summary: Linux /dev/crypto device driver
License: GPL-2.0+
Group: System/Kernel
URL: http://%bname-linux.org/
#Git-Clone: https://github.com/cryptodev-linux/cryptodev-linux.git
BuildRequires: kernel-syms >= 2.6.20
BuildRequires: modutils
BuildRequires: kernel-source-%bname = %version

%kernel_module_package -n %bname -p %name-preamble

%define strip_mod_opts --strip-unneeded -R .comment

%description
%summary.


%package KMP
Summary: Linux /dev/crypto device driver module
Group: System/Kernel

%description KMP
%summary.


%prep
echo %flavors_to_build
%setup -cT
tar -xf /usr/src/kernel/%bname-%version.tar*
for flavor in %flavors_to_build; do
	mkdir obj-$flavor
	cp -al %{bname}* obj-$flavor/
done
rm -rf %{bname}*


%build
cat <<"__EOF__" | make %{?_smp_mflags} -f - all
all: %flavors_to_build

%flavors_to_build:
	$(MAKE) -C obj-$@/%{bname}* KERNEL_DIR="/usr/src/linux-obj/%_target_cpu/$@"
__EOF__


%install
for flavor in %flavors_to_build; do
	cd obj-$flavor/%{bname}*
	make -C /usr/src/linux-obj/%_target_cpu/$flavor \
		INSTALL_MOD_PATH="%buildroot" \
		INSTALL_MOD_DIR=crypto \
		%{!?_enable_debug:%{?strip_mod_opts:INSTALL_MOD_STRIP="%strip_mod_opts"}} \
		SUBDIRS=$PWD \
		modules_install
	cd -
done


%changelog