Whamcloud - gitweb
b=18696
[fs/lustre-release.git] / lustre.spec.in
index 39886fd..1cd2ddd 100644 (file)
@@ -9,7 +9,7 @@ Release: @RELEASE@
 License: GPL
 Group: Utilities/System
 Source: lustre-%{version}.tar.gz
-URL: http://clusterfs.com/
+URL: http://www.sun.com/software/products/lustre/index.xml
 BuildRoot: %{_tmppath}/lustre-%{version}-root
 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
@@ -72,7 +72,7 @@ systems.
 Summary: Lustre testing framework
 Group: Development/Kernel
 Provides: lustre-tests = %{version}
-Requires: lustre = %{version}
+Requires: lustre = %{version}, lustre-modules = %{version}
 
 %description tests
 This package contains a set of test binaries and scripts that are intended
@@ -110,12 +110,21 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
 rm -rf $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre-ldiskfs
 
+# hack to include the llog_test module in lustre-tests
+llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
+if [ -e ${llog_base}.ko ]; then
+  cp ${llog_base}.ko $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
+elif [ -e ${llog_base}.o ]; then
+  cp ${llog_base}.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
+fi
+
 # Create the pristine source directory.
 cd $RPM_BUILD_DIR/lustre-%{version}
 mkdir -p $RPM_BUILD_ROOT/usr/src
 rm -f lustre-source
 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
 make distdir distdir=lustre-source/lustre-%{version}
+chmod -R go-w lustre-source/lustre-%{version}
 
 cat >lustre.files <<EOF
 %attr(-, root, root) /sbin/mount.lustre
@@ -133,6 +142,10 @@ cat >lustre.files <<EOF
 %attr(-, root, root) %{_libdir}/lustre/lc_common
 EOF
 
+if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
+  echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
+fi
+
 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
@@ -149,18 +162,30 @@ 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/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
 
+if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
+  echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
+fi
+
+echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
+echo '%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
+modules_excludes="llog_test"
+if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
+  echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
+fi
+
+pushd $RPM_BUILD_ROOT >/dev/null
+find lib/modules/%{kversion}/kernel -type f | awk "!/($modules_excludes)/ {print \"/\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
+popd >/dev/null
+
 %files -f lustre.files
 
-%files modules
+%files modules -f lustre-modules.files
 %attr(-, root, root) %doc COPYING
-%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
-%attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
 
 %files source
 %attr(-, root, root) /usr/src/lustre-%{version}
@@ -169,8 +194,7 @@ fi
 # %files deps-sles
 # %files deps-rhel
 
-%files tests
-%attr(-, root, root) %{_libdir}/lustre/tests/*
+%files tests -f lustre-tests.files
 
 %post modules
 if [ -f /boot/System.map-%{kversion} ]; then
@@ -178,6 +202,13 @@ if [ -f /boot/System.map-%{kversion} ]; then
 else
        depmod -ae %{kversion} || exit 0
 fi
+cat <<EOF
+Congratulations on finishing your Lustre installation!  To register  
+your copy of Lustre and find out more about Lustre Support, Service,  
+and Training offerings please visit
+
+http://www.sun.com/software/products/lustre/lustre_reg.jsp
+EOF
 
 # for update from < v1.4.6
 
@@ -201,7 +232,6 @@ do
        fi
 done
 
-
 %postun modules
 if [ -f /boot/System.map-%{kversion} ]; then
        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
@@ -209,5 +239,19 @@ else
        depmod -ae %{kversion} || exit 0
 fi
 
+%post tests
+if [ -f /boot/System.map-%{kversion} ]; then
+       depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
+else
+       depmod -ae %{kversion} || exit 0
+fi
+
+%postun tests
+if [ -f /boot/System.map-%{kversion} ]; then
+       depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
+else
+       depmod -ae %{kversion} || exit 0
+fi
+
 %clean
 rm -rf $RPM_BUILD_ROOT