2 %define version @VERSION@
3 %define kversion @LINUXRELEASE@
5 Summary: Lustre File System
10 Group: Utilities/System
11 Source: lustre-%{version}.tar.gz
12 URL: http://clusterfs.com/
13 BuildRoot: %{_tmppath}/lustre-%{version}-root
14 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
15 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
16 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
19 Userspace tools and files for the Lustre file system.
22 Summary: Kernel Lustre modules for Linux %{kversion}
23 Requires: modutils >= 2.4.10
24 Group: Development/Kernel
27 Lustre file system, server and network drivers for Linux %{kversion}.
30 Summary: Object-Based Disk storage driver source
31 Group: Development/Kernel
34 Lustre sources for further development
36 # Since the RPMs we ship are to be used on both SLES and RHEL, we
37 # can't include any dependency information (since the package names
38 # are different on the two platforms).
40 # Instead, we can build these empty meta-packages that only include
41 # dependency information. These let people get the correct
42 # dependencies for their platform and lets them use tools like yum and
43 # red carpet to install the correct files.
45 # Unfortunately I have not seen this come up on the lists much, so I
46 # have disabled them (by commenting out their empty files section
47 # below) until it's clear that they resolve more confusion than they
51 Summary: Lustre dependencies meta-package for SLES
52 Group: Utilities/System
53 Provides: lustre-deps = %{version}
54 Requires: lustre = %{version}, sles-release
55 Conflicts: lustre-deps-rhel
57 %description deps-sles
58 This package has RPM dependencies appropriate for SLES systems.
61 Summary: Lustre dependencies meta-package for RHEL
62 Group: Utilities/System
63 Provides: lustre-deps = %{version}
64 Requires: lustre = %{version}, redhat-release
65 Conflicts: lustre-deps-sles
67 %description deps-rhel
68 This package has RPM dependencies appropriate for RHEL, RHL, and FC
72 Summary: Lustre testing framework
73 Group: Development/Kernel
74 Provides: lustre-tests = %{version}
75 Requires: lustre = %{version}
78 This package contains a set of test binaries and scripts that are intended
79 to be used by the Lustre testing framework.
82 %setup -qn lustre-%{version}
85 # if RPM_BUILD_NCPUS unset, set it
86 if [ -z "$RPM_BUILD_NCPUS" ] ; then
87 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
88 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
91 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
96 rm -rf $RPM_BUILD_ROOT
98 # Set an explicit path to our Linux tree, if we can.
99 cd $RPM_BUILD_DIR/lustre-%{version}
100 ./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
101 --sysconfdir=%{_sysconfdir} \
102 --mandir=%{_mandir} \
104 make -j $RPM_BUILD_NCPUS -s
107 make install DESTDIR=$RPM_BUILD_ROOT
108 # hack to avoid changing the libsysio code for "make install"
109 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
110 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
111 rm -rf $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/fs/lustre-ldiskfs
113 # Create the pristine source directory.
114 cd $RPM_BUILD_DIR/lustre-%{version}
115 mkdir -p $RPM_BUILD_ROOT/usr/src
117 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
118 make distdir distdir=lustre-source/lustre-%{version}
120 cat >lustre.files <<EOF
121 %attr(-, root, root) /sbin/mount.lustre
122 %attr(-, root, root) /usr/sbin/*
123 %attr(-, root, root) /usr/bin/*
125 %attr(-, root, root) /usr/share/lustre/*
127 %attr(-, root, root) %{_libdir}/libptlctl.a
128 %attr(-, root, root) %{_libdir}/liblustreapi.a
129 %attr(-, root, root) /usr/include/lustre
131 %attr(-, root, root) %{_mandir}/man?/*
133 %attr(-, root, root) %{_libdir}/lustre/lc_common
136 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
137 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
138 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
141 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
142 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
145 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
146 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
147 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
150 # Have universal lustre headers
151 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
152 echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
153 echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
155 echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
158 %files -f lustre.files
161 %attr(-, root, root) %doc COPYING
162 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
163 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
166 %attr(-, root, root) /usr/src/lustre-%{version}
168 # uncomment these lines to enable deps packages
173 %attr(-, root, root) %{_libdir}/lustre/tests/*
176 if [ -f /boot/System.map-%{kversion} ]; then
177 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
179 depmod -ae %{kversion} || exit 0
182 # for update from < v1.4.6
184 for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ;
187 if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
188 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
189 TMPFILE=`mktemp $f.XXXXXX` && \
190 rm -f $TMPFILE && touch $TMPFILE && \
191 grep -v 'lustre llite' $f >> $TMPFILE && \
194 if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
195 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
196 TMPFILE=`mktemp $f.XXXXXX` && \
197 rm -f $TMPFILE && touch $TMPFILE && \
198 sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
206 if [ -f /boot/System.map-%{kversion} ]; then
207 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
209 depmod -ae %{kversion} || exit 0
213 rm -rf $RPM_BUILD_ROOT