Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
flashcache-kmod
> flashcache-kmod.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File flashcache-kmod.spec of Package flashcache-kmod
%define buildforkernels current %define kmodtool sh %{_sourcedir}/kmodtool.flashcache %define bundle_name src # Define the kmod package name here. %define kmod_name flashcache # If kversion isn't defined on the rpmbuild line, define it here. %{!?kversion: %define kversion 2.6.32-279.el6.%{_target_cpu}} Name: %{kmod_name}-kmod Version: 0.1 Release: 16%{?dist} Group: System Environment/Kernel License: GPLv2 Summary: %{kmod_name} kernel module URL: http://www.intel.com/ BuildRequires: redhat-rpm-config ExclusiveArch: x86_64 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # Sources. Source0: %{kmod_name}.tar.bz2 Source10: kmodtool.flashcache Patch0: make.diff # get the needed BuildRequires (in parts depending on what we build for) %{!?kernels:BuildRequires: buildsys-build-cloudlinux-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} } # kmodtool does its magic here %{expand:%(%{kmodtool} --target %{_target_cpu} --noakmod --repo cloudlinux --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } # Disable the building of the debug package(s). %define debug_package %{nil} %description This package provides the %{kmod_name} kernel modules for Flashcache. %prep %setup -q -n %{kmod_name} %patch0 -p1 for kernel_version in %{?kernel_versions} ; do %{__cp} -a %{bundle_name} _kmod_build_${kernel_version%%___*} done %build for kernel_version in %{?kernel_versions} ; do pushd _kmod_build_${kernel_version%%___*}/ echo "Building Modules" %{__make} modules KERNEL_TREE=${kernel_version##*___} popd done %install for kernel_version in %{?kernel_versions} ; do pushd _kmod_build_${kernel_version%%___*}/ %{__install} -d %{buildroot}/lib/modules/${kernel_version%%___*}/extra/%{kmod_name}/ %{__install} %{kmod_name}.ko %{buildroot}/lib/modules/${kernel_version%%___*}/extra/%{kmod_name}/ popd done # Set the module(s) to be executable, so that they will be stripped when packaged. find %{buildroot} -type f -name \*.ko -exec %{__chmod} u+x \{\} \; # Remove the unrequired files. %{__rm} -f %{buildroot}/lib/modules/%{kversion}/modules.* %clean %{__rm} -rf %{buildroot} %changelog