Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / build / lbuild-sles10
1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
2
3 # increment this if you have made a change that should force a new kernel
4 # to build built
5 #BUILD_GEN=1
6 #BUILD_GEN=2    # bz19952: remove -lustre tag from kernel RPM names
7 BUILD_GEN=3     # bz19975 enable the building of src.rpms by default
8
9 source ${0%/*}/lbuild-sles
10
11 edit_specs() {
12
13     # edit the SPECs with our changes
14     local spec
15     for spec in $RPMSMPTYPE source; do
16         #cp $TOPDIR/SOURCES/kernel-$spec.spec{,.orig}
17         sed -i -e "s/^Release:.*/&_${buildid}/" \
18                -e "s/^ExclusiveArch:.*/& ppc ppc64/" \
19                -e '/^# Apply the patches needed for this architecture\./a\
20 cp  %_sourcedir/linux-2.6.16-lustre.patch %_builddir/%{name}-%{version}/lustre.patch\
21 ! grep -q lustre.patch %_sourcedir/series.conf && echo -e "\\n\\tlustre.patch" >> %_sourcedir/series.conf' \
22                -e "/flavor=\${config/a\
23     [ \"\$flavor\" == \"$RPMSMPTYPE\" ] || continue" \
24           SOURCES/kernel-${spec}.spec
25
26         if $KERNEL_LUSTRE_NAMING; then
27             # these are all of the changes needed because we change the package names
28             # to kernel-lustre-*.  these should all go away when we stop this insanity
29             sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \
30                    -e "/^Provides:  *kernel = /a\
31 Provides:       kernel-$spec = %{version}-%{release}
32 " \
33                    -e 's/\(.*\)\([^#].*\)fookernel-source/\1\2kernel-lustre-source/g' \
34                    -e '/^%build/,/^%changelog/s/kernel-\({*\)source/kernel-\1lustre-source/g' \
35               SOURCES/kernel-${spec}.spec
36         fi
37
38     # XXX - a building-on-Ubuntu hack
39     if grep -q "Ubuntu" /etc/issue; then
40         sed -i -e '/^%_sourcedir\/install-configs %_sourcedir .*/i\
41 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' \
42                -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \
43                -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \
44                -e 's/ -a 109//' \
45           SOURCES/kernel-${spec}.spec
46      fi
47     done
48 }