Whamcloud - gitweb
~sigh~ rpm macros are not empty if undefined.
[fs/lustre-release.git] / build / lustre.spec.in
index 2c41cf0..78b770c 100644 (file)
@@ -6,7 +6,7 @@ Summary: Lustre File System
 Name: lustre
 Version: %{version}
 Release: @RELEASE@
-Copyright: GPL
+License: GPL
 Group: Utilities/System
 Source: lustre-%{version}.tar.gz
 URL: http://clusterfs.com/
@@ -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}
@@ -104,12 +104,12 @@ rm -f lustre-source
 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
 make distdir distdir=lustre-source/lustre-%{version}
 
-%files
+cat >lustre.files <<EOF
 %attr(-, root, root) /sbin/mount.lustre
 %attr(-, root, root) /usr/sbin/*
 %attr(-, root, root) /usr/bin/*
 %attr(-, root, root) %{_libdir}/lustre/python
-%attr(-, root, root) /usr/share/lustre/examples
+%attr(-, root, root) /usr/share/lustre/*
 
 %attr(-, root, root) /etc/init.d/lustre
 %attr(-, root, root) /etc/init.d/lustrefs
@@ -117,14 +117,32 @@ make distdir distdir=lustre-source/lustre-%{version}
 %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?/*
 
 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
 %attr(-, root, root) /etc/openldap/schema/lustre.schema
-%attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
-%attr(-, root, root) /usr/share/lustre/top.ldif
+EOF
+if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
+  echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
+  echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
+fi
+
+if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
+  echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
+  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
 %attr(-, root, root) %doc COPYING
@@ -152,18 +170,32 @@ fi
 rm -f %{_libdir}/lustre/python/Lustre/*.pyc
 
 %post modules
-if [ ! -e /dev/obd ]; then
-   mknod /dev/obd c 10 241
-fi
-if [ ! -e /dev/portals ]; then
-   mknod /dev/portals c 10 240
-fi
 if [ -f /boot/System.map-%{kversion} ]; then
        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
 else
        depmod -ae %{kversion} || exit 0
 fi
 
+# 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
+               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
+
+
 %postun modules
 if [ -f /boot/System.map-%{kversion} ]; then
        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0