%define taglevel 18
%define release %{kernel_version}.%{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
-# use any of these two if found
+
+# guess which convention is used; k27 and before used dash, k32 uses dot
%define kernelpath_dash /usr/src/kernels/%{kernel_version}-%{kernel_release}-%{kernel_arch}
%define kernelpath_dot /usr/src/kernels/%{kernel_version}-%{kernel_release}.%{kernel_arch}
+%define kernelpath %( [ -d %{kernelpath_dot} ] && echo %{kernelpath_dot} || echo %{kernelpath_dash} )
+
# the k32 kernel currently builds e.g. /lib/modules/2.6.32-0.onelab.2010.12.07-i686
-# the extra star should address the -i686 part, that k27 does not have
-%define kernel_id %{kernel_version}-%{kernel_release}*
+# the k27 and before does not have the -i686 part
+%define kernel_id_old %{kernel_version}-%{kernel_release}
+%define kernel_id_new %{kernel_version}-%{kernel_release}-%{_target_cpu}
+%define kernel_id %( [ -d %{kernelpath_dot} ] && echo %{kernel_id_new} || echo %{kernel_id_old} )
Summary: ipfw and dummynet for Linux
Name: %{name}
# clean the rpm build directory
rm -rf $RPM_BUILD_ROOT
-# with the new build, we use the kernel-devel rpm for building
-# guess which convention is used; k27 and before used dash, k32 uses dot
-%define kernelpath %( [ -d %{kernelpath_dot} ] && echo %{kernelpath_dot} || echo %{kernelpath_dash} )
-
%__make KERNELPATH=%kernelpath clean
%__make KERNELPATH=%kernelpath IPFW_PLANETLAB=1