Whamcloud - gitweb
Replace /usr/sbin and /usr/bin filelists with wildcards.
[fs/lustre-release.git] / build / lustre.spec.in
index c10e8e9..da2a1c5 100644 (file)
@@ -3,6 +3,8 @@
 %define kversion @LINUXRELEASE@
 %define linuxdir @LINUX@
 %define enable_doc @ENABLE_DOC@
+%define enable_init_scripts @ENABLE_INIT_SCRIPTS@
+%define enable_gm @ENABLE_GM@
 
 Summary: Lustre Lite File System
 Name: lustre-lite
@@ -61,6 +63,7 @@ Configures openldap server for LDAP Lustre config database
 %prep
 %setup -qn lustre-%{version}
 #%setup -c -n lustre-%{version}-lib
+
 %if %{enable_doc}
   %define disable_doc ''
 %else
@@ -70,7 +73,7 @@ Configures openldap server for LDAP Lustre config database
 %build
 # if RPM_BUILD_NCPUS unset, set it
 if [ -z "$RPM_BUILD_NCPUS" ] ; then
-    RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
+    RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
     if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
         RPM_BUILD_NCPUS=1
     fi
@@ -84,16 +87,21 @@ rm -rf $RPM_BUILD_ROOT
 # Set an explicit path to our Linux tree, if we can.
 cd $RPM_BUILD_DIR/lustre-%{version}
 ./configure \
+       --enable-smfs \
        --with-linux='%{linuxdir}' \
        --with-linux-obj='@LINUX_OBJ@' \
+       --with-linux-config=@LINUX_CONFIG@ \
        %{disable_doc} --disable-liblustre \
        --sysconfdir=%{_sysconfdir} \
-       --mandir=%{_mandir}
+       --mandir=%{_mandir} \
+       --libdir=%{_libdir}
 make -j $RPM_BUILD_NCPUS -s
 
 %install
 cd $RPM_BUILD_DIR/lustre-%{version}
 make install DESTDIR=$RPM_BUILD_ROOT
+# hack to avoid changing the libsysio code for "make install"
+rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
 
 %ifarch alpha
 # this hurts me
@@ -119,41 +127,19 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
 
 %files
 %attr(-, root, root) /sbin/mount.lustre
-%attr(-, root, root) /usr/sbin/lmc
-%attr(-, root, root) /usr/sbin/lctl
-%attr(-, root, root) /usr/sbin/lconf
-%attr(-, root, root) /usr/sbin/lrun
-%attr(-, root, root) /usr/sbin/llmount
-%attr(-, root, root) /usr/sbin/lwizard
-%attr(-, root, root) /usr/sbin/wiretest
-%attr(-, root, root) /usr/sbin/lactive
-%attr(-, root, root) /usr/sbin/llanalyze
-%attr(-, root, root) /usr/sbin/gmnalnid
-%attr(-, root, root) /usr/sbin/llstat.pl
-%attr(-, root, root) /usr/sbin/llobdstat.pl
-%attr(-, root, root) /usr/sbin/load_ldap.sh
-%attr(-, root, root) /usr/sbin/acceptor
-%attr(-, root, root) /usr/sbin/ptlctl
-%attr(-, root, root) /usr/sbin/debugctl
-%attr(-, root, root) /usr/sbin/lload
-%attr(-, root, root) /usr/sbin/obdbarrier
-%attr(-, root, root) /usr/sbin/obdio
-%attr(-, root, root) /usr/sbin/routerstat
-%attr(-, root, root) /usr/sbin/wirecheck
-%attr(-, root, root) /usr/bin/lfs
-%attr(-, root, root) /usr/bin/lfind
-%attr(-, root, root) /usr/bin/lstripe
-%attr(-, root, root) /usr/bin/mcreate
-%attr(-, root, root) /usr/bin/munlink
-%attr(-, root, root) /usr/lib/lustre/python
+%attr(-, root, root) /usr/sbin/*
+%attr(-, root, root) /usr/bin/*
+%attr(-, root, root) %{_libdir}/lustre/python
 %attr(-, root, root) /usr/share/lustre/examples
 
+%if %{enable_init_scripts}
 %attr(-, root, root) /etc/init.d/lustre
 %attr(-, root, root) /etc/init.d/lustrefs
-%attr(-, root, root) /usr/lib/libptlctl.a
-%attr(-, root, root) /usr/lib/liblustreapi.a
+%endif
+
+%attr(-, root, root) %{_libdir}/libptlctl.a
+%attr(-, root, root) %{_libdir}/liblustreapi.a
 %attr(-, root, root) /usr/include/lustre
-%attr(-, root, root) /usr/include/portals
 %attr(-, root, root) /usr/include/linux/lustre_idl.h
 
 %attr(-, root, root) /usr/share/man/man?/*
@@ -163,7 +149,7 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
 %endif
 
 %files -n lustre-doc
-%attr(-, root, root) %doc COPYING FDL
+%attr(-, root, root) %doc COPYING lustre/FDL
 %if %{enable_doc}
 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
 %endif
@@ -209,13 +195,15 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
 %attr(700, ldap, ldap) /var/lib/ldap/lustre
 
 %post
-/sbin/chkconfig --add lustre
-/sbin/chkconfig --add lustrefs
+if [ -f /etc/init.d/lustre ] ; then
+       /sbin/chkconfig --add lustre
+       /sbin/chkconfig --add lustrefs
+fi
 
 %preun
-if [ $1 = 0 ]; then
-  /sbin/chkconfig --del lustre
-  /sbin/chkconfig --del lustrefs
+if [ $1 = 0 -a -f /etc/init.d/lustre ] ; then
+       /sbin/chkconfig --del lustre
+       /sbin/chkconfig --del lustrefs
 fi
 
 %post -n lustre-modules
@@ -225,10 +213,18 @@ fi
 if [ ! -e /dev/portals ]; then
    mknod /dev/portals c 10 240
 fi
-depmod -ae || exit 0
+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 -n lustre-modules
-depmod -ae || exit 0
+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