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