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@
8 Summary: Lustre Lite File System
13 Group: Utilities/System
14 Requires: lustre-modules, PyXML
15 Source: ftp://ftp.lustre.com/pub/lustre/lustre-%{version}.tar.gz
16 BuildRoot: /var/tmp/lustre-%{version}-root
19 The Lustre Lite Cluster File System: kernel drivers for file system,
20 servers and utilities.
22 %package -n lustre-modules
23 Summary: Kernel Lustre drivers for Linux %{kversion}
24 Requires: modutils >= 2.4.10
25 Group: Development/Kernel
27 %description -n lustre-modules
28 Lustre file System, server and network drivers for Linux %{kversion}.
30 %package -n lustre-source
31 Summary: Object-Based Disk storage driver source
32 Group: Development/Kernel
34 %description -n lustre-source
35 Lustre Lite Source for further development
37 %package -n lustre-doc
38 Summary: Documentation and sample configuration files
40 # FIXME: BuildArch overrides all the packages in rpm 4.0.4-7x
43 %description -n lustre-doc
44 Documentation and sample configuration files for Lustre
46 %package -n lustre-ldap
47 Summary: Configures openldap server for LDAP Lustre config database
49 Requires: openldap-servers, openldap-clients, python-ldap, 4Suite
51 %description -n lustre-ldap
52 Configures openldap server for LDAP Lustre config database
55 #%package -n liblustre
57 #Group: Development/Kernel
59 #%description -n liblustre
60 #Lustre lib binary package.
63 %setup -qn lustre-%{version}
64 #%setup -c -n lustre-%{version}-lib
67 %define disable_doc ''
69 %define disable_doc --disable-doc
73 # if RPM_BUILD_NCPUS unset, set it
74 if [ -z "$RPM_BUILD_NCPUS" ] ; then
75 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
76 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
79 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
84 rm -rf $RPM_BUILD_ROOT
86 # Set an explicit path to our Linux tree, if we can.
87 cd $RPM_BUILD_DIR/lustre-%{version}
89 --with-linux='%{linuxdir}' \
90 --with-linux-obj='@LINUX_OBJ@' \
91 --with-linux-config=@LINUX_CONFIG@ \
92 %{disable_doc} --disable-liblustre \
93 --sysconfdir=%{_sysconfdir} \
96 make -j $RPM_BUILD_NCPUS -s
99 cd $RPM_BUILD_DIR/lustre-%{version}
100 make install DESTDIR=$RPM_BUILD_ROOT
101 # hack to avoid changing the libsysio code for "make install"
102 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
108 test -d $linuxdir && conf_flag=--with-linux=$linuxdir
110 ./configure --enable-rtscts-myrinet $conf_flag %{disable_doc}
112 cp linux/rtscts/rtscts.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/net/lustre/rtscts_myrinet.o
113 cp user/myrinet_utils/mcpload $RPM_BUILD_ROOT/usr/sbin/mcpload
116 # Create the pristine source directory.
117 cd $RPM_BUILD_DIR/lustre-%{version}
118 mkdir -p $RPM_BUILD_ROOT/usr/src
120 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
121 make distdir distdir=lustre-source/lustre-%{version}
123 # ldap database directory
124 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
127 %attr(-, root, root) /sbin/mount.lustre
128 %attr(-, root, root) /usr/sbin/lmc
129 %attr(-, root, root) /usr/sbin/lctl
130 %attr(-, root, root) /usr/sbin/lconf
131 %attr(-, root, root) /usr/sbin/lrun
132 %attr(-, root, root) /usr/sbin/llmount
133 %attr(-, root, root) /usr/sbin/lwizard
134 %attr(-, root, root) /usr/sbin/wiretest
135 %attr(-, root, root) /usr/sbin/lactive
136 %attr(-, root, root) /usr/sbin/llanalyze
137 %attr(-, root, root) /usr/sbin/gmnalnid
138 %attr(-, root, root) /usr/sbin/llstat.pl
139 %attr(-, root, root) /usr/sbin/llobdstat.pl
140 %attr(-, root, root) /usr/sbin/load_ldap.sh
141 %attr(-, root, root) /usr/sbin/acceptor
142 %attr(-, root, root) /usr/sbin/ptlctl
143 %attr(-, root, root) /usr/sbin/debugctl
144 %attr(-, root, root) /usr/sbin/lload
145 %attr(-, root, root) /usr/sbin/obdbarrier
146 %attr(-, root, root) /usr/sbin/obdio
147 %attr(-, root, root) /usr/sbin/routerstat
148 %attr(-, root, root) /usr/sbin/wirecheck
149 %attr(-, root, root) /usr/bin/lfs
150 %attr(-, root, root) /usr/bin/lfind
151 %attr(-, root, root) /usr/bin/lstripe
152 %attr(-, root, root) /usr/bin/mcreate
153 %attr(-, root, root) /usr/bin/munlink
154 %attr(-, root, root) %{_libdir}/lustre/python
155 %attr(-, root, root) /usr/share/lustre/examples
157 %if %{enable_init_scripts}
158 %attr(-, root, root) /etc/init.d/lustre
159 %attr(-, root, root) /etc/init.d/lustrefs
162 %attr(-, root, root) %{_libdir}/libptlctl.a
163 %attr(-, root, root) %{_libdir}/liblustreapi.a
164 %attr(-, root, root) /usr/include/lustre
165 %attr(-, root, root) /usr/include/portals
166 %attr(-, root, root) /usr/include/linux/lustre_idl.h
168 %attr(-, root, root) /usr/share/man/man?/*
171 %attr(-, root, root) /usr/sbin/mcpload
175 %attr(-, root, root) %doc COPYING lustre/FDL
177 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
179 #%attr(-, root, root) %doc tests/client-echo.cfg tests/client-mount.cfg
180 #%attr(-, root, root) %doc tests/client-mount2.cfg
181 #%attr(-, root, root) %doc tests/elan-client.cfg tests/elan-server.cfg
182 #%attr(-, root, root) %doc tests/ldlm.cfg tests/lustre.cfg
183 #%attr(-, root, root) %doc tests/mds.cfg tests/net-client.cfg
184 #%attr(-, root, root) %doc tests/net-local.cfg tests/net-server.cfg
185 #%attr(-, root, root) %doc tests/obdecho.cfg tests/obdfilter.cfg
187 %files -n lustre-modules
188 %attr(-, root, root) %doc COPYING
189 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
191 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
193 %files -n lustre-source
194 %attr(-, root, root) /usr/src/lustre-%{version}
198 #%attr(-, root, root) /lib/lustre
199 #%attr(-, root, root) /usr/sbin/lctl
200 #%attr(-, root, root) /usr/sbin/lfind
201 #%attr(-, root, root) /usr/sbin/lstripe
202 #%attr(-, root, root) /usr/sbin/obdio
203 #%attr(-, root, root) /usr/sbin/obdbarrier
204 #%attr(-, root, root) /usr/sbin/obdstat
205 #%attr(-, root, root) /usr/sbin/lload
206 #%attr(-, root, root) /usr/sbin/lconf
207 #%attr(-, root, root) /usr/sbin/lmc
208 #%attr(-, root, root) /usr/sbin/llanalyze
212 %files -n lustre-ldap
213 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
214 %attr(-, root, root) /etc/openldap/schema/lustre.schema
215 %attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
216 %attr(-, root, root) /usr/share/lustre/top.ldif
217 #%dir /var/lib/ldap/lustre
218 %attr(700, ldap, ldap) /var/lib/ldap/lustre
221 if [ -f /etc/init.d/lustre ] ; then
222 /sbin/chkconfig --add lustre
223 /sbin/chkconfig --add lustrefs
227 if [ $1 = 0 -a -f /etc/init.d/lustre ] ; then
228 /sbin/chkconfig --del lustre
229 /sbin/chkconfig --del lustrefs
232 %post -n lustre-modules
233 if [ ! -e /dev/obd ]; then
234 mknod /dev/obd c 10 241
236 if [ ! -e /dev/portals ]; then
237 mknod /dev/portals c 10 240
241 %postun -n lustre-modules
245 #rm -rf $RPM_BUILD_ROOT