1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
3 DEVEL_KERNEL_TYPE="source"
4 RPM_HELPERS_DIR="/usr/lib/rpm"
6 prepare_and_build_srpm() {
8 pushd $TOPDIR >/dev/null
9 # all of the specs but one are put into SOURCES, so let's just move
10 # the one lone one in SPECS into SOURCES and just reference them from
12 mv SPECS/*.spec SOURCES/
14 # generate our buildid
15 local buildid="lustre${EXTRA_VERSION##*_lustre}"
17 # do release specific spec editing
20 # XXX - need to flesh this out per the rhel5 method
22 for arch in $BUILD_ARCHS; do
23 targets="--target $arch $targets"
24 mkdir -p config/$(basearch $arch)
25 cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE
28 tar cjf SOURCES/config.tar.bz2 config
31 # do we need any special rpm build options
32 local rpmbuildopt="-bb"
37 # XXX - ignore the kabi changes. need to figure out what this is really
39 touch SOURCES/IGNORE-KABI-BADNESS
42 # XXX testing speedup hack - never let an inspection pass without this
43 # commented out! in fact it should be removed completely before a
47 if ! $RPMBUILD $rpmbuildopt $targets \
48 --define "_topdir $TOPDIR" \
49 $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
50 fatal 1 "Failed to build kernel RPM"
54 # for SLES, we also need to build the kernel-source rpm
55 if ! $RPMBUILD $rpmbuildopt $targets \
56 --define "_topdir $TOPDIR" \
57 $TOPDIR/SOURCES/kernel-source.spec 2>&1; then
58 fatal 1 "Failed to build kernel source RPM"
64 local lustre=${1:-false}
67 echo "kernel-lustre-$DEVEL_KERNEL_TYPE"
69 echo "kernel-$DEVEL_KERNEL_TYPE"
74 rpm_BUILD_kernel_dirname() {
81 if $KERNEL_LUSTRE_NAMING; then
84 echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj}
89 # because we build an i686 kernel, we need to know if the arch we are
90 # resolving for is for the patched or patchless kernel (which is i586)
91 # we really should be building an i586 kernel to match what Novell does
92 local for_patchless=${2:-true}
93 local canonical=${3:-false}
98 i?86) if $canonical; then
100 elif $(eval $for_patchless); then
110 find_linux_devel_paths() {
113 LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
114 LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
115 # XXX this has been commented out in th rhel5 build file for a while
116 # as it says there, it's probably not needed anymore and can be deleted
117 #LINUXRELEASE=$(find_linux_release "$LINUXOBJ")
118 #if [ -z "$LINUXRELEASE" ]; then
119 # echo "Failed to find linux release in $LINUXOBJ"
126 mcpu_rpmbuild_opt() {
128 echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'"