- -e 's/\(.*\)\([^#].*\)fookernel-source/\1\2kernel-lustre-source/g' \
- -e '/^%build/,/^%changelog/s/kernel-\({*\)source/kernel-\1lustre-source/g' \
- SPECS/kernel-${spec}.spec
+ -e "s/^\(BuildRequires: kernel-dummy\)/# \1/" \
+ SOURCES/kernel-${spec}.spec
+
+ if $KERNEL_LUSTRE_NAMING; then
+ # these are all of the changes needed because we change the package names
+ # to kernel-lustre-*. these should all go away when we stop this insanity
+ sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \
+ -e "/^Provides: *kernel = /a\
+Provides: kernel-$spec = %{version}-%{release}
+" \
+ -e 's/^\([ ][ ]*-i %_builddir\/kernel-\)\(source-2.6.27.21\/\$patch; then\)/\1lustre-\2/' \
+ -e '/^%build/,/^%changelog/s/\(kernel-\)\(source\.files\)/\1lustre-\2/g' \
+ -e '/--no-backup-if-mismatch/,/fi/s/kernel-source-/kernel-lustre-source-/g' \
+ -e "s/^\(%package -n kernel-\)\(.*\)/\1lustre-\2/" \
+ -e "s/^\(%description -n kernel-\)\(.*\)/\1lustre-\2/" \
+ -e "s/^\(%files -n kernel-\)\(.*\)/\1lustre-\2/" \
+ -e "s/^\(Provides:.*kernel-\)\(.*\)/\1lustre-\2/" \
+ -e "s/^\(Requires:.*kernel-\)\(.*\)/\1lustre-\2/" \
+ -e "s/^\(Supplements:.*kernel-\)\(.*\)/\1lustre-\2/" \
+ SOURCES/kernel-${spec}.spec
+ fi