# $Id$ Source10: kmodtool2 %define kmodtool bash %{SOURCE10} %{!?kversion: %define kversion 2.6.9-67.0.7.EL} # hint: this can he overridden with "--define kversion foo" on the rpmbuild command line, e.g. # --define "kversion 2.6.16-1.2096_FC5" %define kmod_name ppp %define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) %define upvar "" %ifarch i586 i686 x86_64 %define smpvar smp %endif %ifarch i686 %define hugememvar hugemem %define xenvar xenU %endif %ifarch x86_64 %define largesmpvar largesmp %define xenvar xenU %endif %{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?hugememvar} %{?largesmpvar} %{?xenvar}} # hint: this can he overridden with "--define kvariant foo bar" on the rpmbuild command line, e.g. # --define 'kvariant "" smp' Name: %{kmod_name}-kmod Version: 1.0.2 Release: 2.%(echo %{kverrel} | tr - _) Summary: %{kmod_name} kernel modules Group: System Environment/Kernel License: GPL Source0: kernel_ppp_mppe-%{version}-src.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: i586 i686 x86_64 %description %{summary}. %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)} %prep %setup -q -c cd kernel_ppp_mppe-%{version} ./pre_build.sh %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu} . . %{kverrel} patch -p1 < patches/linux-2.6.2-pad.patch patch -p1 < patches/02-ppp_generic.c.patch patch -p1 < patches/03-ppp_mppe_compress.c.patch patch -p1 < patches/04-ppp_mppe_compress.c_license.patch cd .. for kvariant in %{kvariants} ; do cp -a kernel_ppp_mppe-%{version} _kmod_build_$kvariant done %build rm -rf $RPM_BUILD_ROOT for kvariant in %{kvariants} ; do ks=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules_install \ INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/updates/'%{kmod_name} done chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko %clean rm -rf $RPM_BUILD_ROOT %changelog * Mon May 7 2007 Shad L. Lords - Update to use kmodtool * Fri Dec 01 2006 Shad L. Lords - Initial package.