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")
8 # for those uses that don't want the -smp/-bigsmp on the end of %kversion
9 %define krequires %(bash -c "echo %{kversion} | sed -e 's/-[^0-9]*smp$//'")
11 Summary: Lustre File System
16 Group: Utilities/System
17 Source: lustre-%{version}.tar.gz
18 URL: http://www.sun.com/software/products/lustre/index.xml
19 BuildRoot: %{_tmppath}/lustre-%{version}-root
20 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
21 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
22 Requires: %{name}-modules = %{version}
23 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
26 Userspace tools and files for the Lustre file system.
29 Summary: Kernel Lustre modules for Linux %{kversion}
30 Requires: modutils >= 2.4.10, kernel = %{krequires}
31 Group: Development/Kernel
34 Lustre file system, server and network drivers for Linux %{kversion}.
37 Summary: Object-Based Disk storage driver source
38 Group: Development/Kernel
41 Lustre sources for further development
43 # Since the RPMs we ship are to be used on both SLES and RHEL, we
44 # can't include any dependency information (since the package names
45 # are different on the two platforms).
47 # Instead, we can build these empty meta-packages that only include
48 # dependency information. These let people get the correct
49 # dependencies for their platform and lets them use tools like yum and
50 # red carpet to install the correct files.
52 # Unfortunately I have not seen this come up on the lists much, so I
53 # have disabled them (by commenting out their empty files section
54 # below) until it's clear that they resolve more confusion than they
58 Summary: Lustre dependencies meta-package for SLES
59 Group: Utilities/System
60 Provides: lustre-deps = %{version}
61 Requires: %{name} = %{version}, sles-release
62 Conflicts: %{name}-deps-rhel
64 %description deps-sles
65 This package has RPM dependencies appropriate for SLES systems.
68 Summary: Lustre dependencies meta-package for RHEL
69 Group: Utilities/System
70 Provides: lustre-deps = %{version}
71 Requires: %{name} = %{version}, redhat-release
72 Conflicts: %{name}-deps-sles
74 %description deps-rhel
75 This package has RPM dependencies appropriate for RHEL, RHL, and FC
79 Summary: Lustre testing framework
80 Group: Development/Kernel
81 Provides: %{name}-tests = %{version}
82 Requires: %{name} = %{version}, %{name}-modules = %{version}
85 This package contains a set of test binaries and scripts that are intended
86 to be used by the Lustre testing framework.
89 %setup -qn lustre-%{version}
92 # if RPM_BUILD_NCPUS unset, set it
93 if [ -z "$RPM_BUILD_NCPUS" ] ; then
94 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
95 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
98 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
103 rm -rf $RPM_BUILD_ROOT
105 # Set an explicit path to our Linux tree, if we can.
106 cd $RPM_BUILD_DIR/lustre-%{version}
107 ./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
108 --sysconfdir=%{_sysconfdir} \
109 --mandir=%{_mandir} \
111 make -j $RPM_BUILD_NCPUS -s
114 make install DESTDIR=$RPM_BUILD_ROOT
115 # hack to avoid changing the libsysio code for "make install"
116 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
117 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
118 rm -rf $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre-ldiskfs
120 # hack to include the llog_test module in lustre-tests
121 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
122 if [ -e ${llog_base}.ko ]; then
123 cp ${llog_base}.ko $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
124 elif [ -e ${llog_base}.o ]; then
125 cp ${llog_base}.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre
128 # Create the pristine source directory.
129 cd $RPM_BUILD_DIR/lustre-%{version}
130 mkdir -p $RPM_BUILD_ROOT/usr/src
132 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
133 make distdir distdir=lustre-source/lustre-%{version}
134 chmod -R go-w lustre-source/lustre-%{version}
136 cat >lustre.files <<EOF
137 %attr(-, root, root) /sbin/mount.lustre
138 %attr(-, root, root) /usr/sbin/*
139 %attr(-, root, root) /usr/bin/*
141 %attr(-, root, root) /usr/share/lustre
143 %attr(-, root, root) %{_libdir}/libptlctl.a
144 %attr(-, root, root) %{_libdir}/liblustreapi.a
145 %attr(-, root, root) /usr/include/lustre
147 %attr(-, root, root) %{_mandir}/man?/*
149 %attr(-, root, root) %{_libdir}/lustre/lc_common
152 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
153 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
156 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
157 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
158 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
161 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
162 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
165 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
166 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
167 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
170 # Have universal lustre headers
171 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
172 echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
174 echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
177 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
178 echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
181 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
182 echo '%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
183 modules_excludes="llog_test"
184 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
185 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
188 pushd $RPM_BUILD_ROOT >/dev/null
189 find lib/modules/%{kversion}/kernel -type f | awk "!/($modules_excludes)/ {print \"/\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
192 %files -f lustre.files
194 %files modules -f lustre-modules.files
195 %attr(-, root, root) %doc COPYING
198 %attr(-, root, root) /usr/src/lustre-%{version}
200 # uncomment these lines to enable deps packages
204 %files tests -f lustre-tests.files
207 if [ -f /boot/System.map-%{kversion} ]; then
208 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
210 depmod -ae %{kversion} || exit 0
213 Congratulations on finishing your Lustre installation! To register
214 your copy of Lustre and find out more about Lustre Support, Service,
215 and Training offerings please visit
217 http://www.sun.com/software/products/lustre/lustre_reg.jsp
220 # for update from < v1.4.6
222 for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ;
225 if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
226 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
227 TMPFILE=`mktemp $f.XXXXXX` && \
228 rm -f $TMPFILE && touch $TMPFILE && \
229 grep -v 'lustre llite' $f >> $TMPFILE && \
232 if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
233 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
234 TMPFILE=`mktemp $f.XXXXXX` && \
235 rm -f $TMPFILE && touch $TMPFILE && \
236 sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
243 if [ -f /boot/System.map-%{kversion} ]; then
244 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
246 depmod -ae %{kversion} || exit 0
250 if [ -f /boot/System.map-%{kversion} ]; then
251 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
253 depmod -ae %{kversion} || exit 0
257 if [ -f /boot/System.map-%{kversion} ]; then
258 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
260 depmod -ae %{kversion} || exit 0
264 rm -rf $RPM_BUILD_ROOT