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
15 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
18 Userspace tools and files for the Lustre file system.
21 Summary: Kernel Lustre modules for Linux %{kversion}
22 Requires: modutils >= 2.4.10
23 Group: Development/Kernel
26 Lustre file system, server and network drivers for Linux %{kversion}.
29 Summary: Object-Based Disk storage driver source
30 Group: Development/Kernel
33 Lustre sources for further development
35 # Since the RPMs we ship are to be used on both SLES and RHEL, we
36 # can't include any dependency information (since the package names
37 # are different on the two platforms).
39 # Instead, we can build these empty meta-packages that only include
40 # dependency information. These let people get the correct
41 # dependencies for their platform and lets them use tools like yum and
42 # red carpet to install the correct files.
44 # Unfortunately I have not seen this come up on the lists much, so I
45 # have disabled them (by commenting out their empty files section
46 # below) until it's clear that they resolve more confusion than they
50 Summary: Lustre dependencies meta-package for SLES
51 Group: Utilities/System
52 Provides: lustre-deps = %{version}
53 Requires: lustre = %{version}, sles-release
54 Conflicts: lustre-deps-rhel
56 %description deps-sles
57 This package has RPM dependencies appropriate for SLES systems.
60 Summary: Lustre dependencies meta-package for RHEL
61 Group: Utilities/System
62 Provides: lustre-deps = %{version}
63 Requires: lustre = %{version}, redhat-release
64 Conflicts: lustre-deps-sles
66 %description deps-rhel
67 This package has RPM dependencies appropriate for RHEL, RHL, and FC
71 %setup -qn lustre-%{version}
74 # if RPM_BUILD_NCPUS unset, set it
75 if [ -z "$RPM_BUILD_NCPUS" ] ; then
76 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
77 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
80 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
85 rm -rf $RPM_BUILD_ROOT
87 # Set an explicit path to our Linux tree, if we can.
88 cd $RPM_BUILD_DIR/lustre-%{version}
89 ./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
90 --sysconfdir=%{_sysconfdir} \
93 make -j $RPM_BUILD_NCPUS -s
96 make install DESTDIR=$RPM_BUILD_ROOT
97 # hack to avoid changing the libsysio code for "make install"
98 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
100 # Create the pristine source directory.
101 cd $RPM_BUILD_DIR/lustre-%{version}
102 mkdir -p $RPM_BUILD_ROOT/usr/src
104 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
105 make distdir distdir=lustre-source/lustre-%{version}
107 cat >lustre.files <<EOF
108 %attr(-, root, root) /sbin/mount.lustre
109 %attr(-, root, root) /usr/sbin/*
110 %attr(-, root, root) /usr/bin/*
112 %attr(-, root, root) /usr/share/lustre/*
114 %attr(-, root, root) %{_libdir}/libptlctl.a
115 %attr(-, root, root) %{_libdir}/liblustreapi.a
116 %attr(-, root, root) /usr/include/lustre
118 %attr(-, root, root) %{_mandir}/man?/*
120 %attr(-, root, root) %{_libdir}/lustre/lc_common.sh
123 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
124 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
125 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
128 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/utils/libiam.c ] ; then
129 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
132 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
133 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
134 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
137 # Have universal lustre headers
138 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
139 echo '%attr(-, root, root) /usr/include/lustre/lustre_idl.h' >>lustre.files
140 echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
141 echo '%attr(-, root, root) /usr/include/linux/lustre_user.h' >>lustre.files
143 echo '%attr(-, root, root) /usr/include/linux/lustre_idl.h' >>lustre.files
146 %files -f lustre.files
149 %attr(-, root, root) %doc COPYING
150 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
151 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
154 %attr(-, root, root) /usr/src/lustre-%{version}
156 # uncomment these lines to enable deps packages
161 if [ -f /boot/System.map-%{kversion} ]; then
162 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
164 depmod -ae %{kversion} || exit 0
167 # for update from < v1.4.6
169 for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ;
172 if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
173 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
174 TMPFILE=`mktemp $f.XXXXXX` && \
175 rm -f $TMPFILE && touch $TMPFILE && \
176 grep -v 'lustre llite' $f >> $TMPFILE && \
179 if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
180 [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
181 TMPFILE=`mktemp $f.XXXXXX` && \
182 rm -f $TMPFILE && touch $TMPFILE && \
183 sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
191 if [ -f /boot/System.map-%{kversion} ]; then
192 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
194 depmod -ae %{kversion} || exit 0
198 rm -rf $RPM_BUILD_ROOT