Whamcloud - gitweb
d2296e0db64d55c4f8a7b389ce5bf5f3e9b0f0b3
[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
7 source ${0%/*}/lbuild-sles
8
9 edit_specs() {
10
11     # edit the SPECs with our changes
12     local spec
13     for spec in $RPMSMPTYPE source; do
14         #cp $TOPDIR/SPECS/kernel-$spec.spec{,.orig}
15         sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \
16                -e "s/^Release:.*/&_${buildid}/" \
17                -e "/^Provides:  *kernel = /a\
18 Provides:       kernel-$spec = %{version}-%{release}
19 " \
20                -e "s/^ExclusiveArch:.*/& ppc ppc64/" \
21                -e '/^# Apply the patches needed for this architecture\./a\
22 cp  %_sourcedir/linux-2.6.16-lustre.patch %_builddir/%{name}-%{version}/lustre.patch\
23 ! grep -q lustre.patch %_sourcedir/series.conf && echo -e "\\n\\tlustre.patch" >> %_sourcedir/series.conf' \
24                -e "/flavor=\${config/a\
25     [ \"\$flavor\" == \"$RPMSMPTYPE\" ] || continue" \
26                -e 's/\(.*\)\([^#].*\)fookernel-source/\1\2kernel-lustre-source/g' \
27                -e '/^%build/,/^%changelog/s/kernel-\({*\)source/kernel-\1lustre-source/g' \
28           SPECS/kernel-${spec}.spec
29
30     # XXX - a building-on-Ubuntu hack
31     if grep -q "Ubuntu" /etc/issue; then
32         sed -i -e '/^%_sourcedir\/install-configs %_sourcedir .*/i\
33 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' \
34                -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \
35                -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \
36                -e 's/ -a 109//' \
37           SPECS/kernel-${spec}.spec
38      fi
39     done
40 }