sample_kmp_spec_file


Purpose

Create a standard KMP spec file for the Driver Backport Working Group.


Starting Point


Current Status

Once we can get both RH and SUSE to include a %kernel_module_package_moddir macro (as noted in
the comments below), version 1 of the standard spec file will be complete.

SUSE Enhancement Request #305255 has been filed to add the kernel_module_package_moddir macro.

Version 2 of the standard spec file will include more complex functionality as noted in the
"TODO for version 2:" comments below.

We need to perform testing on both SUSE and RH.

#
# samplekmp.spec
# Sample KMP spec file
#

# Following line included for SUSE "build" command; does not affect "rpmbuild"
# norootforbuild

Name:         samplekmp
BuildRequires: %kernel_module_package_buildreqs
License:      GPL
Group:        System/Kernel
Summary:      Sample Kernel Module Package
Version:      1.0
Release:      0
Source0:      %name-%version.tar.bz2
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
# Uncomment the following line to include a required firmware package
# Requires:   samplefirmware  

%kernel_module_package
# TODO for version 2:  Include a "-b" option to indicate that the modules should be in the initrd.

%description
This is a sample Kernel Module Package.

%prep
%setup
set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    make -C %{kernel_source} modules M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
# TODO:  Add the kernel_module_package_moddir macro to SUSE and RH (as agreed in
# Workgroup meeting on 2009-04-10)
export INSTALL_MOD_DIR=%kernel_module_package_moddir %{name}
for flavor in %flavors_to_build; do
    make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
done

%clean
rm -rf %{buildroot}

%changelog