%endif
%build
+# if RPM_BUILD_NCPUS unset, set it
+if [ -z "$RPM_BUILD_NCPUS" ] ; then
+ RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
+ if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
+ RPM_BUILD_NCPUS=1
+ fi
+ if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
+ RPM_BUILD_NCPUS=8
+ fi
+fi
+
+
rm -rf $RPM_BUILD_ROOT
# Set an explicit path to our Linux tree, if we can.
cd $RPM_BUILD_DIR/lustre-%{version}
-./configure --with-linux='%{linuxdir}' %{disable_doc} --disable-liblustre
-make
+
+./configure \
+ --with-linux='%{linuxdir}' \
+ %{disable_doc} --disable-liblustre \
+ --sysconfdir=%{_sysconfdir} \
+ --mandir=%{_mandir}
+make -j $RPM_BUILD_NCPUS -s
+
%install
cd $RPM_BUILD_DIR/lustre-%{version}
-make install prefix=$RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
%ifarch alpha
# this hurts me
%attr(-, root, root) /usr/bin/lstripe
%attr(-, root, root) /usr/bin/mcreate
%attr(-, root, root) /usr/bin/munlink
-%attr(-, root, root) /usr/bin/mkdirmany
-%attr(-, root, root) /usr/bin/iopentest1
-%attr(-, root, root) /usr/bin/iopentest2
-%attr(-, root, root) /usr/lib/lustre/python/*
-%attr(-, root, root) /usr/lib/lustre/examples/llmount.sh
-%attr(-, root, root) /usr/lib/lustre/examples/llmountcleanup.sh
-%attr(-, root, root) /usr/lib/lustre/examples/llecho.sh
-%attr(-, root, root) /usr/lib/lustre/examples/local.sh
-%attr(-, root, root) /usr/lib/lustre/examples/uml.sh
-%attr(-, root, root) /usr/lib/lustre/examples/lov.sh
-%attr(-, root, root) /usr/lib/lustre/examples/echo.sh
-%attr(-, root, root) /usr/lib/lustre/examples/llechocleanup.sh
+%attr(-, root, root) /usr/lib/lustre/python
+%attr(-, root, root) /usr/share/lustre/examples
%attr(-, root, root) /etc/init.d/lustre
-%attr(-, root, root) /lib/libptlctl.a
-%attr(-, root, root) /lib/liblustreapi.a
-%attr(-, root, root) /usr/include/lustre/*.h
+%attr(-, root, root) /etc/init.d/lustrefs
+%attr(-, root, root) /usr/lib/libptlctl.a
+%attr(-, root, root) /usr/lib/liblustreapi.a
+%attr(-, root, root) /usr/include/lustre
+%attr(-, root, root) /usr/include/linux/*.h
+%attr(-, root, root) /usr/include/portals
+
+%attr(-, root, root) /usr/share/man/man?/*
%ifarch alpha
%attr(-, root, root) /usr/sbin/mcpload
%files -n lustre-modules
%attr(-, root, root) %doc COPYING
-%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/*.o
+%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
#portals modules
-%attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre/*.o
+%attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
%files -n lustre-source
%attr(-, root, root) /usr/src/lustre-%{version}
#%ifarch i386
#%files -n liblustre
#%attr(-, root, root) /lib/lustre
-#%attr(-, root, root) /lib/lustre/liblov.a
-#%attr(-, root, root) /lib/lustre/liblustreclass.a
-#%attr(-, root, root) /lib/lustre/libptlrpc.a
-#%attr(-, root, root) /lib/lustre/libobdecho.a
-#%attr(-, root, root) /lib/lustre/libldlm.a
-#%attr(-, root, root) /lib/lustre/libosc.a
#%attr(-, root, root) /usr/sbin/lctl
#%attr(-, root, root) /usr/sbin/lfind
#%attr(-, root, root) /usr/sbin/lstripe
%files -n lustre-ldap
%attr(-, root, root) /etc/openldap/slapd-lustre.conf
%attr(-, root, root) /etc/openldap/schema/lustre.schema
-%attr(-, root, root) /usr/lib/lustre/lustre2ldif.xsl
-%attr(-, root, root) /usr/lib/lustre/top.ldif
+%attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
+%attr(-, root, root) /usr/share/lustre/top.ldif
#%dir /var/lib/ldap/lustre
%attr(700, ldap, ldap) /var/lib/ldap/lustre
+
+%post
+/sbin/chkconfig --add lustre
+/sbin/chkconfig --add lustrefs
+
+%preun
+if [ $1 = 0 ]; then
+ /sbin/chkconfig --del lustre
+ /sbin/chkconfig --del lustrefs
+fi
+
%post -n lustre-modules
if [ ! -e /dev/obd ]; then
mknod /dev/obd c 10 241