1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
3 # increment this if you have made a change that should force a new kernel
6 BUILD_GEN=2 # bz19952: remove -lustre tag from kernel RPM names
8 source ${0%/*}/lbuild-sles
12 # edit the SPECs with our changes
14 for spec in $RPMSMPTYPE source; do
15 #cp $TOPDIR/SPECS/kernel-$spec.spec{,.orig}
16 sed -i -e "s/^Release:.*/&_${buildid}/" \
17 -e "s/^ExclusiveArch:.*/& ppc ppc64/" \
18 -e '/^# Apply the patches needed for this architecture\./a\
19 cp %_sourcedir/linux-2.6.16-lustre.patch %_builddir/%{name}-%{version}/lustre.patch\
20 ! grep -q lustre.patch %_sourcedir/series.conf && echo -e "\\n\\tlustre.patch" >> %_sourcedir/series.conf' \
21 -e "/flavor=\${config/a\
22 [ \"\$flavor\" == \"$RPMSMPTYPE\" ] || continue" \
23 SPECS/kernel-${spec}.spec
25 if $KERNEL_LUSTRE_NAMING; then
26 # these are all of the changes needed because we change the package names
27 # to kernel-lustre-*. these should all go away when we stop this insanity
28 sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \
29 -e "/^Provides: *kernel = /a\
30 Provides: kernel-$spec = %{version}-%{release}
32 -e 's/\(.*\)\([^#].*\)fookernel-source/\1\2kernel-lustre-source/g' \
33 -e '/^%build/,/^%changelog/s/kernel-\({*\)source/kernel-\1lustre-source/g' \
34 SPECS/kernel-${spec}.spec
37 # XXX - a building-on-Ubuntu hack
38 if grep -q "Ubuntu" /etc/issue; then
39 sed -i -e '/^%_sourcedir\/install-configs %_sourcedir .*/i\
40 curl ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17-mm1/broken-out/i386-use-c-code-for-current_thread_info.patch | patch -p1' \
41 -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \
42 -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \
44 SPECS/kernel-${spec}.spec