Whamcloud - gitweb
~sigh~ rpm macros are not empty if undefined.
[fs/lustre-release.git] / build / lustre.spec.in
index 583c895..78b770c 100644 (file)
@@ -86,7 +86,7 @@ rm -rf $RPM_BUILD_ROOT
 
 # Set an explicit path to our Linux tree, if we can.
 cd $RPM_BUILD_DIR/lustre-%{version}
-./configure @ac_configure_args@ \
+./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
        --sysconfdir=%{_sysconfdir} \
        --mandir=%{_mandir} \
        --libdir=%{_libdir}
@@ -117,7 +117,6 @@ cat >lustre.files <<EOF
 %attr(-, root, root) %{_libdir}/libptlctl.a
 %attr(-, root, root) %{_libdir}/liblustreapi.a
 %attr(-, root, root) /usr/include/lustre
-%attr(-, root, root) /usr/include/linux/lustre_idl.h
 
 %attr(-, root, root) %{_mandir}/man?/*
 
@@ -134,6 +133,15 @@ if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
   echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
 fi
 
+# Have universal lustre headers 
+if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
+  echo '%attr(-, root, root) /usr/include/lustre/lustre_idl.h' >>lustre.files
+  echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
+  echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
+else
+  echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
+fi
+
 %files -f lustre.files
 
 %files modules
@@ -167,21 +175,26 @@ if [ -f /boot/System.map-%{kversion} ]; then
 else
        depmod -ae %{kversion} || exit 0
 fi
-for ext in .local "" ; do
-       f=/etc/modprobe.conf$ext
-       if [ -f $f ] && ! grep llite $f >/dev/null 2>/dev/null ; then
-               cat >> $f <<EOF
+
+# for update from < v1.4.6
+
+for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ; 
+do
+       if [ -f $f ]; then
+               if ! grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
+                       cat >> $f <<-EOF
 alias lustre llite
 EOF
-               break
+               fi
+               if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
+                       [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
+                       TMPFILE=`mktemp $f.XXXXXX` && \
+                       sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f > $TMPFILE && \
+                       mv $TMPFILE $f
+               fi
        fi
 done
-f=/etc/modules.conf
-if [ -f $f ] && ! grep llite $f >/dev/null 2>/dev/null ; then
-       cat >> $f <<EOF
-alias lustre llite
-EOF
-fi
+
 
 %postun modules
 if [ -f /boot/System.map-%{kversion} ]; then