Whamcloud - gitweb
Branch: b1_2
[fs/lustre-release.git] / build / lustre.spec.in
1 # lustre.spec
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@
8
9 Summary: Lustre Lite File System
10 Name: lustre-lite
11 Version: %{version}
12 Release: @RELEASE@
13 Copyright: GPL
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
18
19 %description
20 The Lustre Lite Cluster File System: kernel drivers for file system,
21 servers and utilities.
22
23 %package -n lustre-modules
24 Summary: Kernel Lustre drivers for Linux %{kversion}
25 Requires: modutils >= 2.4.10
26 Group: Development/Kernel
27
28 %description -n lustre-modules
29 Lustre file System, server and network drivers for Linux %{kversion}.
30
31 %package -n lustre-source
32 Summary: Object-Based Disk storage driver source
33 Group: Development/Kernel
34
35 %description -n lustre-source
36 Lustre Lite Source for further development
37
38 %package -n lustre-doc
39 Summary: Documentation and sample configuration files
40 Group: Documentation
41 # FIXME: BuildArch overrides all the packages in rpm 4.0.4-7x
42 #BuildArch: noarch
43
44 %description -n lustre-doc
45 Documentation and sample configuration files for Lustre
46
47 %package -n lustre-ldap
48 Summary: Configures openldap server for LDAP Lustre config database
49 Group: Configuration
50 Requires: openldap-servers, openldap-clients, python-ldap, 4Suite
51
52 %description -n lustre-ldap
53 Configures openldap server for LDAP Lustre config database
54
55
56 #%package -n liblustre
57 #Summary: Lustre Lib
58 #Group: Development/Kernel
59
60 #%description -n liblustre
61 #Lustre lib binary package.
62
63 %prep
64 %setup -qn lustre-%{version}
65 #%setup -c -n lustre-%{version}-lib
66
67 %if %{enable_doc}
68   %define disable_doc ''
69 %else
70   %define disable_doc --disable-doc
71 %endif
72
73 %build
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
78         RPM_BUILD_NCPUS=1
79     fi
80     if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
81         RPM_BUILD_NCPUS=8
82     fi
83 fi
84
85 rm -rf $RPM_BUILD_ROOT
86
87 # Set an explicit path to our Linux tree, if we can.
88 cd $RPM_BUILD_DIR/lustre-%{version}
89 ./configure \
90         --with-linux='%{linuxdir}' \
91         --with-linux-obj='@LINUX_OBJ@' \
92         --with-linux-config=@LINUX_CONFIG@ \
93         %{disable_doc} --disable-liblustre \
94         --sysconfdir=%{_sysconfdir} \
95         --mandir=%{_mandir} \
96         --libdir=%{_libdir}
97 make -j $RPM_BUILD_NCPUS -s
98
99 %install
100 cd $RPM_BUILD_DIR/lustre-%{version}
101 make install DESTDIR=$RPM_BUILD_ROOT
102 # hack to avoid changing the libsysio code for "make install"
103 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
104
105 %ifarch alpha
106 # this hurts me
107   conf_flag=
108   linuxdir=%{linuxdir}
109   test -d $linuxdir && conf_flag=--with-linux=$linuxdir
110   make clean
111   ./configure --enable-rtscts-myrinet $conf_flag %{disable_doc}
112   make
113   cp linux/rtscts/rtscts.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/net/lustre/rtscts_myrinet.o
114   cp user/myrinet_utils/mcpload $RPM_BUILD_ROOT/usr/sbin/mcpload
115 %endif
116
117 # Create the pristine source directory.
118 cd $RPM_BUILD_DIR/lustre-%{version}
119 mkdir -p $RPM_BUILD_ROOT/usr/src
120 rm -f lustre-source
121 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
122 make distdir distdir=lustre-source/lustre-%{version}
123
124 # ldap database directory
125 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
126
127 %files
128 %attr(-, root, root) /sbin/mount.lustre
129 %attr(-, root, root) /usr/sbin/lmc
130 %attr(-, root, root) /usr/sbin/lctl
131 %attr(-, root, root) /usr/sbin/lconf
132 %attr(-, root, root) /usr/sbin/lrun
133 %attr(-, root, root) /usr/sbin/llmount
134 %attr(-, root, root) /usr/sbin/lwizard
135 %attr(-, root, root) /usr/sbin/wiretest
136 %attr(-, root, root) /usr/sbin/lactive
137 %attr(-, root, root) /usr/sbin/llanalyze
138 %if %{enable_gm}
139 %attr(-, root, root) /usr/sbin/gmnalnid
140 %endif
141 %attr(-, root, root) /usr/sbin/llstat.pl
142 %attr(-, root, root) /usr/sbin/llobdstat.pl
143 %attr(-, root, root) /usr/sbin/load_ldap.sh
144 %attr(-, root, root) /usr/sbin/acceptor
145 %attr(-, root, root) /usr/sbin/ptlctl
146 %attr(-, root, root) /usr/sbin/debugctl
147 %attr(-, root, root) /usr/sbin/lload
148 %attr(-, root, root) /usr/sbin/obdbarrier
149 %attr(-, root, root) /usr/sbin/obdio
150 %attr(-, root, root) /usr/sbin/routerstat
151 %attr(-, root, root) /usr/sbin/wirecheck
152 %attr(-, root, root) /usr/bin/lfs
153 %attr(-, root, root) /usr/bin/lfind
154 %attr(-, root, root) /usr/bin/lstripe
155 %attr(-, root, root) /usr/bin/mcreate
156 %attr(-, root, root) /usr/bin/munlink
157 %attr(-, root, root) %{_libdir}/lustre/python
158 %attr(-, root, root) /usr/share/lustre/examples
159
160 %if %{enable_init_scripts}
161 %attr(-, root, root) /etc/init.d/lustre
162 %attr(-, root, root) /etc/init.d/lustrefs
163 %endif
164
165 %attr(-, root, root) %{_libdir}/libptlctl.a
166 %attr(-, root, root) %{_libdir}/liblustreapi.a
167 %attr(-, root, root) /usr/include/lustre
168 %attr(-, root, root) /usr/include/linux/lustre_idl.h
169
170 %attr(-, root, root) /usr/share/man/man?/*
171
172 %ifarch alpha
173 %attr(-, root, root) /usr/sbin/mcpload
174 %endif
175
176 %files -n lustre-doc
177 %attr(-, root, root) %doc COPYING lustre/FDL
178 %if %{enable_doc}
179 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
180 %endif
181 #%attr(-, root, root) %doc tests/client-echo.cfg tests/client-mount.cfg
182 #%attr(-, root, root) %doc tests/client-mount2.cfg
183 #%attr(-, root, root) %doc tests/elan-client.cfg tests/elan-server.cfg
184 #%attr(-, root, root) %doc tests/ldlm.cfg tests/lustre.cfg
185 #%attr(-, root, root) %doc tests/mds.cfg tests/net-client.cfg
186 #%attr(-, root, root) %doc tests/net-local.cfg tests/net-server.cfg
187 #%attr(-, root, root) %doc tests/obdecho.cfg tests/obdfilter.cfg
188
189 %files -n lustre-modules
190 %attr(-, root, root) %doc COPYING
191 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
192 #portals modules
193 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
194
195 %files -n lustre-source
196 %attr(-, root, root) /usr/src/lustre-%{version}
197
198 #%ifarch i386
199 #%files -n liblustre
200 #%attr(-, root, root) /lib/lustre
201 #%attr(-, root, root) /usr/sbin/lctl
202 #%attr(-, root, root) /usr/sbin/lfind
203 #%attr(-, root, root) /usr/sbin/lstripe
204 #%attr(-, root, root) /usr/sbin/obdio
205 #%attr(-, root, root) /usr/sbin/obdbarrier
206 #%attr(-, root, root) /usr/sbin/obdstat
207 #%attr(-, root, root) /usr/sbin/lload
208 #%attr(-, root, root) /usr/sbin/lconf
209 #%attr(-, root, root) /usr/sbin/lmc
210 #%attr(-, root, root) /usr/sbin/llanalyze
211 #%endif
212
213
214 %files -n lustre-ldap
215 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
216 %attr(-, root, root) /etc/openldap/schema/lustre.schema
217 %attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
218 %attr(-, root, root) /usr/share/lustre/top.ldif
219 #%dir /var/lib/ldap/lustre
220 %attr(700, ldap, ldap) /var/lib/ldap/lustre
221
222 %post
223 if [ -f /etc/init.d/lustre ] ; then
224         /sbin/chkconfig --add lustre
225         /sbin/chkconfig --add lustrefs
226 fi
227
228 %preun
229 if [ $1 = 0 -a -f /etc/init.d/lustre ] ; then
230         /sbin/chkconfig --del lustre
231         /sbin/chkconfig --del lustrefs
232 fi
233
234 %post -n lustre-modules
235 if [ ! -e /dev/obd ]; then
236    mknod /dev/obd c 10 241
237 fi
238 if [ ! -e /dev/portals ]; then
239    mknod /dev/portals c 10 240
240 fi
241 if [ -f /boot/System.map-%{kversion} ]; then
242         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
243 else
244         depmod -ae %{kversion} || exit 0
245 fi
246
247 %postun -n lustre-modules
248 if [ -f /boot/System.map-%{kversion} ]; then
249         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
250 else
251         depmod -ae %{kversion} || exit 0
252 fi
253
254 %clean
255 #rm -rf $RPM_BUILD_ROOT
256
257 # end of file