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