# create a clean copy in BUILD/ (for backward compatibility with
# other RPMs that bootstrap off of the kernel build)
cd $RPM_BUILD_DIR
- rm -rf linux-%{kversion}$Flavour
+ rm -rf linux-%{_target_cpu}-%{kversion}$Flavour
cp -rl kernel-%{kversion}/vanilla linux-%{_target_cpu}-%{kversion}$Flavour
cd linux-%{_target_cpu}-%{kversion}$Flavour
%if "%{_target_cpu}" == "x86_64"
%define kernel_arch %{_target_cpu}
-%else
+%endif
+%if "%{_target_cpu}" == "i586"
+%define kernel_arch i386
+%endif
+%if "%{_target_cpu}" == "i686"
%define kernel_arch i386
%endif
BuildKernel %make_target %kernel_arch
%endif
-%if %{buildsmp} && "%{_target_cpu}" != "i586"
+%if "%{_target_cpu}" == "i686"
+%if %{buildsmp}
BuildKernel %make_target %kernel_arch smp
%endif
-%if %{builduml} && "%{_target_cpu}" != "i586"
+%if %{builduml}
BuildKernel linux um uml
%endif
-%if %{buildxen} && "%{_target_cpu}" != "i586"
+%if %{buildxen}
BuildKernel vmlinuz %kernel_arch xenU
%endif
+%endif
+
+%if "%{_target_cpu}" == "x86_64"
+%if %{buildsmp}
+BuildKernel %make_target %kernel_arch smp
+%endif
+%endif
###
### install