2 %define version @VERSION@
3 %define kversion @LINUXRELEASE@
4 %define linuxdir @LINUX@
5 %define enable_doc @ENABLE_DOC@
6 %define enable_init_scripts @ENABLE_INIT_SCRIPTS@
7 %define enable_gm @ENABLE_GM@
9 Summary: Lustre Lite File System
14 Group: Utilities/System
15 Requires: lustre-modules, PyXML
16 Source: ftp://ftp.lustre.com/pub/lustre/lustre-%{version}.tar.gz
17 BuildRoot: /var/tmp/lustre-%{version}-root
20 The Lustre Lite Cluster File System: kernel drivers for file system,
21 servers and utilities.
23 %package -n lustre-modules
24 Summary: Kernel Lustre drivers for Linux %{kversion}
25 Requires: modutils >= 2.4.10
26 Group: Development/Kernel
28 %description -n lustre-modules
29 Lustre file System, server and network drivers for Linux %{kversion}.
31 %package -n lustre-source
32 Summary: Object-Based Disk storage driver source
33 Group: Development/Kernel
35 %description -n lustre-source
36 Lustre Lite Source for further development
38 %package -n lustre-doc
39 Summary: Documentation and sample configuration files
41 # FIXME: BuildArch overrides all the packages in rpm 4.0.4-7x
44 %description -n lustre-doc
45 Documentation and sample configuration files for Lustre
47 %package -n lustre-ldap
48 Summary: Configures openldap server for LDAP Lustre config database
50 Requires: openldap-servers, openldap-clients, python-ldap, 4Suite
52 %description -n lustre-ldap
53 Configures openldap server for LDAP Lustre config database
56 #%package -n liblustre
58 #Group: Development/Kernel
60 #%description -n liblustre
61 #Lustre lib binary package.
64 %setup -qn lustre-%{version}
65 #%setup -c -n lustre-%{version}-lib
68 %define disable_doc ''
70 %define disable_doc --disable-doc
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}
91 --with-linux='%{linuxdir}' \
92 --with-linux-obj='@LINUX_OBJ@' \
93 --with-linux-config=@LINUX_CONFIG@ \
94 %{disable_doc} --disable-liblustre \
95 --sysconfdir=%{_sysconfdir} \
98 make -j $RPM_BUILD_NCPUS -s
101 cd $RPM_BUILD_DIR/lustre-%{version}
102 make install DESTDIR=$RPM_BUILD_ROOT
103 # hack to avoid changing the libsysio code for "make install"
104 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
110 test -d $linuxdir && conf_flag=--with-linux=$linuxdir
112 ./configure --enable-rtscts-myrinet $conf_flag %{disable_doc}
114 cp linux/rtscts/rtscts.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/net/lustre/rtscts_myrinet.o
115 cp user/myrinet_utils/mcpload $RPM_BUILD_ROOT/usr/sbin/mcpload
118 # Create the pristine source directory.
119 cd $RPM_BUILD_DIR/lustre-%{version}
120 mkdir -p $RPM_BUILD_ROOT/usr/src
122 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
123 make distdir distdir=lustre-source/lustre-%{version}
125 # ldap database directory
126 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
129 %attr(-, root, root) /sbin/mount.lustre
130 %attr(-, root, root) /usr/sbin/*
131 %attr(-, root, root) /usr/bin/*
132 %attr(-, root, root) %{_libdir}/lustre/python
133 %attr(-, root, root) /usr/share/lustre/examples
135 %if %{enable_init_scripts}
136 %attr(-, root, root) /etc/init.d/lustre
137 %attr(-, root, root) /etc/init.d/lustrefs
140 %attr(-, root, root) %{_libdir}/libptlctl.a
141 %attr(-, root, root) %{_libdir}/liblustreapi.a
142 %attr(-, root, root) /usr/include/lustre
143 %attr(-, root, root) /usr/include/linux/lustre_idl.h
145 %attr(-, root, root) /usr/share/man/man?/*
148 %attr(-, root, root) /usr/sbin/mcpload
152 %attr(-, root, root) %doc COPYING lustre/FDL
154 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
156 #%attr(-, root, root) %doc tests/client-echo.cfg tests/client-mount.cfg
157 #%attr(-, root, root) %doc tests/client-mount2.cfg
158 #%attr(-, root, root) %doc tests/elan-client.cfg tests/elan-server.cfg
159 #%attr(-, root, root) %doc tests/ldlm.cfg tests/lustre.cfg
160 #%attr(-, root, root) %doc tests/mds.cfg tests/net-client.cfg
161 #%attr(-, root, root) %doc tests/net-local.cfg tests/net-server.cfg
162 #%attr(-, root, root) %doc tests/obdecho.cfg tests/obdfilter.cfg
164 %files -n lustre-modules
165 %attr(-, root, root) %doc COPYING
166 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
168 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
170 %files -n lustre-source
171 %attr(-, root, root) /usr/src/lustre-%{version}
175 #%attr(-, root, root) /lib/lustre
176 #%attr(-, root, root) /usr/sbin/lctl
177 #%attr(-, root, root) /usr/sbin/lfind
178 #%attr(-, root, root) /usr/sbin/lstripe
179 #%attr(-, root, root) /usr/sbin/obdio
180 #%attr(-, root, root) /usr/sbin/obdbarrier
181 #%attr(-, root, root) /usr/sbin/obdstat
182 #%attr(-, root, root) /usr/sbin/lload
183 #%attr(-, root, root) /usr/sbin/lconf
184 #%attr(-, root, root) /usr/sbin/lmc
185 #%attr(-, root, root) /usr/sbin/llanalyze
189 %files -n lustre-ldap
190 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
191 %attr(-, root, root) /etc/openldap/schema/lustre.schema
192 %attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
193 %attr(-, root, root) /usr/share/lustre/top.ldif
194 #%dir /var/lib/ldap/lustre
195 %attr(700, ldap, ldap) /var/lib/ldap/lustre
198 if [ -f /etc/init.d/lustre ] ; then
199 /sbin/chkconfig --add lustre
200 /sbin/chkconfig --add lustrefs
204 if [ $1 = 0 -a -f /etc/init.d/lustre ] ; then
205 /sbin/chkconfig --del lustre
206 /sbin/chkconfig --del lustrefs
209 %post -n lustre-modules
210 if [ ! -e /dev/obd ]; then
211 mknod /dev/obd c 10 241
213 if [ ! -e /dev/portals ]; then
214 mknod /dev/portals c 10 240
216 if [ -f /boot/System.map-%{kversion} ]; then
217 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
219 depmod -ae %{kversion} || exit 0
222 %postun -n lustre-modules
223 if [ -f /boot/System.map-%{kversion} ]; then
224 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
226 depmod -ae %{kversion} || exit 0
230 #rm -rf $RPM_BUILD_ROOT