--- rpms/appletalk-kmod/sme7/appletalk-kmod.spec 2009/04/13 14:43:10 1.20 +++ rpms/appletalk-kmod/sme7/appletalk-kmod.spec 2010/04/21 16:05:43 1.25 @@ -1,18 +1,29 @@ -# $Id: appletalk-kmod.spec,v 1.19 2009/01/15 18:29:22 slords Exp $ +# $Id: appletalk-kmod.spec,v 1.24 2009/10/28 18:42:31 slords Exp $ + +# Define the kmod package name here. +%define kmod_name appletalk -Source10: kmodtool2 -%define kmodtool bash %{SOURCE10} -%{!?kversion: %define kversion 2.6.9-78.0.13.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-89.0.15.EL} -%define kmod_name appletalk -%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) +Name: %{kmod_name}-kmod +Version: 1.0 +Release: 6%{?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: %{kmod_name}-%{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,26 +32,17 @@ 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 -Release: 3.%(echo %{kverrel} | tr - _) -Summary: %{kmod_name} kernel modules - -Group: System Environment/Kernel -License: GPL -Source0: %{kmod_name}-%{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 for kvariant in %{kvariants} ; do @@ -52,20 +54,58 @@ for kvariant in %{kvariants} ; do 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 \ - CONFIG_ATALK=m CONFIG_PROC_FS=y CONFIG_SYSCTL=y - 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} CONFIG_ATALK=m CONFIG_PROC_FS=y CONFIG_SYSCTL=y 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 .. + + mkdir -p ${INSTALL_MOD_PATH}/usr/share/doc/kmod-%{kmod_name}/%{kversion}/ + find ${INSTALL_MOD_PATH}/lib/modules/"%{kversion}${kvariant:+$kvariant}"/ -type f -name \*.ko | sed "s,${INSTALL_MOD_PATH},," \ + > ${INSTALL_MOD_PATH}/usr/share/doc/kmod-%{kmod_name}/%{kversion}/"modules${kvariant:+-$kvariant}" +done + +# Strip the module(s). +find ${INSTALL_MOD_PATH} -type f -name \*.ko -exec strip --strip-debug \{\} \; +# %clean rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 21 2010 Shad L. Lords 1.0-6.sme +- Update scriptlets to not call rpm [SME: 5448] + +* Tue Oct 26 2009 Shad L. Lords 1.0-5.sme +- Make preuninstall script not fail on upgrade + +* Tue May 26 2009 Shad L. Lords 1.0-4.sme +- Initial build of the kABI-tracking version from 1.0. +- Modified spec and kmodtool(-appletalk) +- 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]