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