+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
+
+%if %{build_lustre_tests}
+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
+%endif
+
+pushd $RPM_BUILD_ROOT >/dev/null
+find lib/modules/%{kversion}/kernel -type f | awk "!/(ZZZZZZZZZZ$modules_excludes)/ {print \"%attr(-, root, root) /\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
+popd >/dev/null
+