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}
101 find_linux_devel_paths() {
104 LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
105 LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE
106 # XXX this has been commented out in th rhel5 build file for a while
107 # as it says there, it's probably not needed anymore and can be deleted
108 #LINUXRELEASE=$(find_linux_release "$LINUXOBJ")
109 #if [ -z "$LINUXRELEASE" ]; then
110 # echo "Failed to find linux release in $LINUXOBJ"
117 mcpu_rpmbuild_opt() {
119 echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'"