Whamcloud - gitweb
portals no longer installs list.h
[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         --with-linux-config=@LINUX_CONFIG@ \
92         %{disable_doc} --disable-liblustre \
93         --sysconfdir=%{_sysconfdir} \
94         --mandir=%{_mandir} \
95         --libdir=%{_libdir}
96 make -j $RPM_BUILD_NCPUS -s
97
98 %install
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
103
104 %ifarch alpha
105 # this hurts me
106   conf_flag=
107   linuxdir=%{linuxdir}
108   test -d $linuxdir && conf_flag=--with-linux=$linuxdir
109   make clean
110   ./configure --enable-rtscts-myrinet $conf_flag %{disable_doc}
111   make
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
114 %endif
115
116 # Create the pristine source directory.
117 cd $RPM_BUILD_DIR/lustre-%{version}
118 mkdir -p $RPM_BUILD_ROOT/usr/src
119 rm -f lustre-source
120 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
121 make distdir distdir=lustre-source/lustre-%{version}
122
123 # ldap database directory
124 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
125
126 %files
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
156
157 %if %{enable_init_scripts}
158 %attr(-, root, root) /etc/init.d/lustre
159 %attr(-, root, root) /etc/init.d/lustrefs
160 %endif
161
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/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