--- rpms/ppp-kmod/sme7/ppp-kmod.spec 2009/05/02 10:09:04 1.22 +++ rpms/ppp-kmod/sme7/ppp-kmod.spec 2009/05/26 17:12:09 1.23 @@ -1,18 +1,29 @@ -# $Id: ppp-kmod.spec,v 1.21 2009/04/20 20:12:32 snetram Exp $ +# $Id: ppp-kmod.spec,v 1.22 2009/05/02 10:09:04 bytegw Exp $ + +# Define the kmod package name here. +%define kmod_name ppp -Source10: kmodtool2 -%define kmodtool bash %{SOURCE10} -%{!?kversion: %define kversion 2.6.9-78.0.22.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" +%{!?kversion: %define kversion 2.6.9-78.0.22.EL} -%define kmod_name ppp -%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) +Name: %{kmod_name}-kmod +Version: 1.0.2 +Release: 4%{?dist} +Group: System Environment/Kernel +License: GPL +Summary: %{kmod_name} kernel modules + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +ExclusiveArch: i586 i686 x86_64 + +# Sources. +Source0: kernel_ppp_mppe-%{version}-src.tgz +Source10: kmodtool-%{kmod_name} +# Define the variants for each architecture. %define upvar "" -%ifarch i586 i686 x86_64 -%define smpvar smp -%endif +%define smpvar smp %ifarch i686 %define hugememvar hugemem %define xenvar xenU @@ -21,53 +32,73 @@ Source10: kmodtool2 %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: 3.%(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 + +# If kvariants isn't defined on the rpmbuild line, build all variants for this architecture. +%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?hugememvar} %{?largesmpvar}} + +# Magic hidden here. +%define kmodtool sh %{SOURCE10} +%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants} 2>/dev/null)} %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} +pushd kernel_ppp_mppe-%{version} +./pre_build.sh lib/modules/"%{kversion}${kvariant:+$kvariant}"/build . . %{kversion}${kvariant:+$kvariant} 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 .. +popd 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} +# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} +# pushd _kmod_build_$kvariant +# make -C "${ksrc}" modules M=$PWD +# popd + ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build + cd _kmod_build_$kvariant + # make TOPDIR=${ksrc} modules %{?_smp_mflags} + make -C "${ksrc}" SUBDIRS=${PWD} modules %{?_smp_mflags} + cd .. +done + +%install +export INSTALL_MOD_PATH=$RPM_BUILD_ROOT +export INSTALL_MOD_DIR=extra/%{kmod_name} +for kvariant in %{kvariants} ; do +# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} +# pushd _kmod_build_$kvariant +# make -C "${ksrc}" modules_install M=$PWD +# install -d ${INSTALL_MOD_PATH}/usr/lib/debug +# popd + ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build + cd _kmod_build_$kvariant + make -C ${ksrc} SUBDIRS=`pwd` INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/extra/'%{kmod_name} modules_install + # make TOPDIR=${ksrc} INSTALL_MOD_PATH=$RPM_BUILD_ROOT INSTALL_MOD_DIR=extra/%{kmod_name}/ modules_install %{?_smp_mflags} + cd .. done -chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko + +# Strip the module(s). +find ${INSTALL_MOD_PATH} -type f -name \*.ko -exec strip --strip-debug \{\} \; +# %clean rm -rf $RPM_BUILD_ROOT %changelog +* Tue May 26 2009 Shad L. Lords 1.0.4-4.sme +- Initial build of the kABI-tracking version from 1.0.4. +- Modified spec and kmodtool(-ppp) +- Note: weak-modules became available as of CentOS-4.7 +- Strip the module(s) added + * Thu Feb 5 2009 Shad L. Lords - Fix post scripts [SME: 4864] @@ -76,4 +107,3 @@ rm -rf $RPM_BUILD_ROOT * Fri Dec 01 2006 Shad L. Lords - Initial package. -