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}
# 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
%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
# 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}
# %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
fi
done
-
%postun modules
if [ -f /boot/System.map-%{kversion} ]; then
depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
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