Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / build / lbuild-sles
1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
2
3 DEVEL_KERNEL_TYPE="source"
4
5 prepare_and_build_srpm() {
6
7     pushd $TOPDIR >/dev/null
8     # seems there is a bug (on Ubuntu at least) where all of the .specs
9     # are not put into SPECS
10     mv SOURCES/*.spec SPECS/
11
12     # generate our buildid
13     local buildid="lustre${EXTRA_VERSION##*_lustre}"
14
15     # do release specific spec editing
16     edit_specs
17
18     # XXX - need to flesh this out per the rhel5 method
19     local targets
20     for arch in $BUILD_ARCHS; do
21         targets="--target $arch $targets"
22         mkdir -p config/$(basearch $arch)
23         cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE
24     done
25
26     tar cjf SOURCES/config.tar.bz2 config
27     rm -rf config
28
29     # do we need any special rpm build options
30     local rpmbuildopt="-bb"
31     if $DO_SRC; then
32         rpmbuildopt="-ba"
33     fi
34
35     # XXX - ignore the kabi changes.  need to figure out what this is really
36     #       all about.
37     touch SOURCES/IGNORE-KABI-BADNESS
38
39
40 # XXX testing speedup hack - never let an inspection pass without this
41 #     commented out!  in fact it should be removed completely before a
42 #     landing.
43 #if false; then
44     # now build it
45     if ! $RPMBUILD $rpmbuildopt $targets \
46                    --define "_topdir $TOPDIR" \
47                    $TOPDIR/SPECS/kernel-$RPMSMPTYPE.spec >&2; then
48         fatal 1 "Failed to build kernel RPM"
49     fi
50 #fi
51
52     # for SLES, we also need to build the kernel-source rpm
53     if ! $RPMBUILD $rpmbuildopt $targets \
54                    --define "_topdir $TOPDIR" \
55                    $TOPDIR/SPECS/kernel-source.spec >&2; then
56         fatal 1 "Failed to build kernel source RPM"
57     fi
58
59 }
60
61 devel_kernel_name() {
62     local lustre=${1:-false}
63
64     if $lustre; then
65         echo "kernel-lustre-$DEVEL_KERNEL_TYPE"
66     else
67         echo "kernel-$DEVEL_KERNEL_TYPE"
68     fi
69
70 }
71
72 rpm_BUILD_kernel_dirname() {
73     local rpmsmptype="$1"
74     local lnxmaj="$2"
75     local lnxmin="$3"
76     local arch="$4"
77
78     local lustre=""
79     if $KERNEL_LUSTRE_NAMING; then
80         $lustre="-lustre"
81     fi
82     echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj}
83 }