-%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
+%attr(-, root, root) %{_libdir}/lustre/lc_common.sh
+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 [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
+ echo '%attr(-, root, root) %{_libdir}/libiam.a' >>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