--- rpms/ppp-kmod/sme7/ppp-kmod.spec 2008/02/04 19:22:40 1.8 +++ rpms/ppp-kmod/sme7/ppp-kmod.spec 2009/10/28 18:42:41 1.24 @@ -1,16 +1,29 @@ -Source10: kmodtool2 -%define kmodtool bash %{SOURCE10} -%{!?kversion: %define kversion 2.6.9-67.0.4.EL} +# $Id: ppp-kmod.spec,v 1.23 2009/05/26 17:12:09 slords Exp $ + +# Define the kmod package name here. +%define kmod_name ppp + # 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-89.0.15.EL} -%define kmod_name ppp -%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) +Name: %{kmod_name}-kmod +Version: 1.0.2 +Release: 5%{?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 @@ -19,56 +32,81 @@ 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: 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 + +# 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 -chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko + +%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 + +# Strip the module(s). +find ${INSTALL_MOD_PATH} -type f -name \*.ko -exec strip --strip-debug \{\} \; +# %clean rm -rf $RPM_BUILD_ROOT %changelog +* Tue Oct 26 2009 Shad L. Lords 1.0.2-5.sme +- Make preuninstall script not fail on upgrade + +* Tue May 26 2009 Shad L. Lords 1.0.2-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] + * Mon May 7 2007 Shad L. Lords - Update to use kmodtool * Fri Dec 01 2006 Shad L. Lords - Initial package. -