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