2 %define version @VERSION@
3 %define kversion @LINUXRELEASE@
4 %define sles10build @SLES10BUILD@
6 Summary: Lustre File System
11 Group: Utilities/System
12 Source: lustre-%{version}.tar.gz
13 URL: http://clusterfs.com/
14 BuildRoot: %{_tmppath}/lustre-%{version}-root
15 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
16 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
17 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
20 Userspace tools and files for the Lustre file system.
23 Summary: Kernel Lustre modules for Linux %{kversion}
24 Requires: modutils >= 2.4.10
25 Group: Development/Kernel
31 Lustre file system, server and network drivers for Linux %{kversion}.
34 Summary: Object-Based Disk storage driver source
35 Group: Development/Kernel
38 Lustre sources for further development
40 # Since the RPMs we ship are to be used on both SLES and RHEL, we
41 # can't include any dependency information (since the package names
42 # are different on the two platforms).
44 # Instead, we can build these empty meta-packages that only include
45 # dependency information. These let people get the correct
46 # dependencies for their platform and lets them use tools like yum and
47 # red carpet to install the correct files.
49 # Unfortunately I have not seen this come up on the lists much, so I
50 # have disabled them (by commenting out their empty files section
51 # below) until it's clear that they resolve more confusion than they
55 Summary: Lustre dependencies meta-package for SLES
56 Group: Utilities/System
57 Provides: lustre-deps = %{version}
58 Requires: lustre = %{version}, sles-release
59 Conflicts: lustre-deps-rhel
61 %description deps-sles
62 This package has RPM dependencies appropriate for SLES systems.
65 Summary: Lustre dependencies meta-package for RHEL
66 Group: Utilities/System
67 Provides: lustre-deps = %{version}
68 Requires: lustre = %{version}, redhat-release
69 Conflicts: lustre-deps-sles
71 %description deps-rhel
72 This package has RPM dependencies appropriate for RHEL, RHL, and FC
76 Summary: Lustre testing framework
77 Group: Development/Kernel
78 Provides: lustre-tests = %{version}
79 Requires: lustre = %{version}
82 This package contains a set of test binaries and scripts that are intended
83 to be used by the Lustre testing framework.
86 %setup -qn lustre-%{version}
89 # if RPM_BUILD_NCPUS unset, set it
90 if [ -z "$RPM_BUILD_NCPUS" ] ; then
91 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
92 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
95 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
100 rm -rf $RPM_BUILD_ROOT
102 # Set an explicit path to our Linux tree, if we can.
103 cd $RPM_BUILD_DIR/lustre-%{version}
104 ./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
105 --sysconfdir=%{_sysconfdir} \
106 --mandir=%{_mandir} \
108 make -j $RPM_BUILD_NCPUS -s
111 make install DESTDIR=$RPM_BUILD_ROOT
112 # hack to avoid changing the libsysio code for "make install"
113 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
114 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
115 rm -rf $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre-ldiskfs
117 # hack to include the llog_test module in lustre-tests
118 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
119 if [ -e ${llog_base}.ko ]; then
120 cp ${llog_base}.ko $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
121 elif [ -e ${llog_base}.o ]; then
122 cp ${llog_base}.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
125 # Create the pristine source directory.
126 cd $RPM_BUILD_DIR/lustre-%{version}
127 mkdir -p $RPM_BUILD_ROOT/usr/src
129 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
130 make distdir distdir=lustre-source/lustre-%{version}
132 cat >lustre.files <<EOF
133 %attr(-, root, root) /sbin/mount.lustre
134 %attr(-, root, root) /usr/sbin/*
135 %attr(-, root, root) /usr/bin/*
137 %attr(-, root, root) /usr/share/lustre/*
139 %attr(-, root, root) %{_libdir}/libptlctl.a
140 %attr(-, root, root) %{_libdir}/liblustreapi.a
141 %attr(-, root, root) /usr/include/lustre
143 %attr(-, root, root) %{_mandir}/man?/*
145 %attr(-, root, root) %{_libdir}/lustre/lc_common
148 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
149 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
150 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
153 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
154 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
157 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
158 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
159 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
162 # Have universal lustre headers
163 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
164 echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
165 echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
167 echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
170 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
171 echo '%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
172 modules_excludes="llog_test"
173 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
174 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
177 pushd $RPM_BUILD_ROOT >/dev/null
178 find lib/modules/%{kversion}/kernel -type f | awk "!/($modules_excludes)/ {print \"/\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
181 %files -f lustre.files
183 %files modules -f lustre-modules.files
184 %attr(-, root, root) %doc COPYING
187 %attr(-, root, root) /usr/src/lustre-%{version}
189 # uncomment these lines to enable deps packages
193 %files tests -f lustre-tests.files
196 if [ -f /boot/System.map-%{kversion} ]; then
197 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
199 depmod -ae %{kversion} || exit 0
202 # for update from < v1.4.6
204 for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ;
207 if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
208 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
209 TMPFILE=`mktemp $f.XXXXXX` && \
210 rm -f $TMPFILE && touch $TMPFILE && \
211 grep -v 'lustre llite' $f >> $TMPFILE && \
214 if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
215 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
216 TMPFILE=`mktemp $f.XXXXXX` && \
217 rm -f $TMPFILE && touch $TMPFILE && \
218 sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
226 if [ -f /boot/System.map-%{kversion} ]; then
227 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
229 depmod -ae %{kversion} || exit 0
233 rm -rf $RPM_BUILD_ROOT