2 %{!?version: %define version @VERSION@}
3 %{!?kversion: %define kversion @LINUXRELEASE@}
4 %{!?release: %define release @RELEASE@}
5 %{!?lustre_name: %define lustre_name lustre}
7 %define is_client %(bash -c "if [[ %{lustre_name} = *-client ]]; then echo -n '1'; else echo -n '0'; fi")
9 Summary: Lustre File System
14 Group: Utilities/System
15 Source: lustre-%{version}.tar.gz
16 URL: http://www.sun.com/software/products/lustre/index.xml
17 BuildRoot: %{_tmppath}/lustre-%{version}-root
18 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
19 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
20 Requires: %{name}-modules = %{version}
21 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
24 Userspace tools and files for the Lustre file system.
27 Summary: Kernel Lustre modules for Linux %{kversion}
28 Requires: modutils >= 2.4.10, kernel = %{kversion}
29 Group: Development/Kernel
32 Lustre file system, server and network drivers for Linux %{kversion}.
35 Summary: Object-Based Disk storage driver source
36 Group: Development/Kernel
39 Lustre sources for further development
41 # Since the RPMs we ship are to be used on both SLES and RHEL, we
42 # can't include any dependency information (since the package names
43 # are different on the two platforms).
45 # Instead, we can build these empty meta-packages that only include
46 # dependency information. These let people get the correct
47 # dependencies for their platform and lets them use tools like yum and
48 # red carpet to install the correct files.
50 # Unfortunately I have not seen this come up on the lists much, so I
51 # have disabled them (by commenting out their empty files section
52 # below) until it's clear that they resolve more confusion than they
56 Summary: Lustre dependencies meta-package for SLES
57 Group: Utilities/System
58 Provides: lustre-deps = %{version}
59 Requires: %{name} = %{version}, sles-release
60 Conflicts: %{name}-deps-rhel
62 %description deps-sles
63 This package has RPM dependencies appropriate for SLES systems.
66 Summary: Lustre dependencies meta-package for RHEL
67 Group: Utilities/System
68 Provides: lustre-deps = %{version}
69 Requires: %{name} = %{version}, redhat-release
70 Conflicts: %{name}-deps-sles
72 %description deps-rhel
73 This package has RPM dependencies appropriate for RHEL, RHL, and FC
77 Summary: Lustre testing framework
78 Group: Development/Kernel
79 Provides: %{name}-tests = %{version}
80 Requires: %{name} = %{version}, %{name}-modules = %{version}
83 This package contains a set of test binaries and scripts that are intended
84 to be used by the Lustre testing framework.
87 %setup -qn lustre-%{version}
90 # if RPM_BUILD_NCPUS unset, set it
91 if [ -z "$RPM_BUILD_NCPUS" ] ; then
92 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
93 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
96 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
101 rm -rf $RPM_BUILD_ROOT
103 # Set an explicit path to our Linux tree, if we can.
104 cd $RPM_BUILD_DIR/lustre-%{version}
105 ./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
106 --sysconfdir=%{_sysconfdir} \
107 --mandir=%{_mandir} \
109 make -j $RPM_BUILD_NCPUS -s
112 make install DESTDIR=$RPM_BUILD_ROOT
113 # hack to avoid changing the libsysio code for "make install"
114 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
115 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
116 rm -rf $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre-ldiskfs
118 # hack to include the llog_test module in lustre-tests
119 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
120 if [ -e ${llog_base}.ko ]; then
121 cp ${llog_base}.ko $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
122 elif [ -e ${llog_base}.o ]; then
123 cp ${llog_base}.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
126 # Create the pristine source directory.
127 cd $RPM_BUILD_DIR/lustre-%{version}
128 mkdir -p $RPM_BUILD_ROOT/usr/src
130 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
131 make distdir distdir=lustre-source/lustre-%{version}
132 chmod -R go-w lustre-source/lustre-%{version}
134 cat >lustre.files <<EOF
135 %attr(-, root, root) /sbin/mount.lustre
136 %attr(-, root, root) /usr/sbin/*
137 %attr(-, root, root) /usr/bin/*
139 %attr(-, root, root) /usr/share/lustre
141 %attr(-, root, root) %{_libdir}/libptlctl.a
142 %attr(-, root, root) %{_libdir}/liblustreapi.a
143 %attr(-, root, root) /usr/include/lustre
145 %attr(-, root, root) %{_mandir}/man?/*
147 %attr(-, root, root) %{_libdir}/lustre/lc_common
150 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
151 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
154 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
155 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
156 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
159 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
160 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
163 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
164 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
165 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
168 # Have universal lustre headers
169 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
170 echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
172 echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
175 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
176 echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
179 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
180 echo '%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
181 modules_excludes="llog_test"
182 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
183 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
186 pushd $RPM_BUILD_ROOT >/dev/null
187 find lib/modules/%{kversion}/kernel -type f | awk "!/($modules_excludes)/ {print \"/\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
190 %files -f lustre.files
192 %files modules -f lustre-modules.files
193 %attr(-, root, root) %doc COPYING
196 %attr(-, root, root) /usr/src/lustre-%{version}
198 # uncomment these lines to enable deps packages
202 %files tests -f lustre-tests.files
205 if [ -f /boot/System.map-%{kversion} ]; then
206 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
208 depmod -ae %{kversion} || exit 0
211 Congratulations on finishing your Lustre installation! To register
212 your copy of Lustre and find out more about Lustre Support, Service,
213 and Training offerings please visit
215 http://www.sun.com/software/products/lustre/lustre_reg.jsp
218 # for update from < v1.4.6
220 for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ;
223 if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
224 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
225 TMPFILE=`mktemp $f.XXXXXX` && \
226 rm -f $TMPFILE && touch $TMPFILE && \
227 grep -v 'lustre llite' $f >> $TMPFILE && \
230 if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
231 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
232 TMPFILE=`mktemp $f.XXXXXX` && \
233 rm -f $TMPFILE && touch $TMPFILE && \
234 sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
241 if [ -f /boot/System.map-%{kversion} ]; then
242 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
244 depmod -ae %{kversion} || exit 0
248 if [ -f /boot/System.map-%{kversion} ]; then
249 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
251 depmod -ae %{kversion} || exit 0
255 if [ -f /boot/System.map-%{kversion} ]; then
256 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
258 depmod -ae %{kversion} || exit 0
262 rm -rf $RPM_BUILD_ROOT