Whamcloud - gitweb
merge b_devel into HEAD, which will become 0.7.3
[fs/lustre-release.git] / lustre / scripts / lustre.spec.in
1 # lustre.spec
2 %define version b_devel
3 %define kversion @LINUXRELEASE@
4 %define linuxdir @LINUX@
5
6 Summary: Lustre Lite File System
7 Name: lustre-lite
8 Version: %{version}
9 Release: @RELEASE@
10 Copyright: GPL
11 Group: Utilities/System
12 Requires: lustre-modules, PyXML
13 Source: ftp://ftp.lustre.com/pub/lustre/lustre-%{version}.tar.gz
14 BuildRoot: /var/tmp/lustre-%{version}-root
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 %install
73 cd $RPM_BUILD_DIR/lustre-%{version}
74 make install prefix=$RPM_BUILD_ROOT
75
76 %ifarch alpha
77 # this hurts me
78   conf_flag=
79   linuxdir=%{linuxdir}
80   test -d $linuxdir && conf_flag=--with-linux=$linuxdir
81   make clean
82   ./configure --enable-rtscts-myrinet $conf_flag
83   make
84   cp linux/rtscts/rtscts.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/kernel/net/lustre/rtscts_myrinet.o
85   cp user/myrinet_utils/mcpload $RPM_BUILD_ROOT/usr/sbin/mcpload
86 %endif
87
88 # Create the pristine source directory.
89 cd $RPM_BUILD_DIR/lustre-%{version}
90 mkdir -p $RPM_BUILD_ROOT/usr/src
91 rm -f lustre-source
92 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
93 make distdir distdir=lustre-source/lustre-%{version}
94
95 # ldap database directory
96 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
97
98 %files
99 %attr(-, root, root) /usr/sbin/lmc
100 %attr(-, root, root) /usr/sbin/lctl
101 %attr(-, root, root) /usr/sbin/lconf
102 %attr(-, root, root) /usr/sbin/lactive
103 %attr(-, root, root) /usr/sbin/llanalyze
104 %attr(-, root, root) /usr/sbin/lfind
105 %attr(-, root, root) /usr/sbin/lstripe
106 %attr(-, root, root) /usr/sbin/mcreate
107 %attr(-, root, root) /usr/sbin/mkdirmany
108 %attr(-, root, root) /usr/sbin/llstat.pl
109 %attr(-, root, root) /usr/sbin/llobdstat.pl
110 %attr(-, root, root) /usr/sbin/load_ldap.sh
111 %attr(-, root, root) /usr/lib/lustre/python/*
112 %attr(-, root, root) /usr/lib/lustre/examples/llmount.sh
113 %attr(-, root, root) /usr/lib/lustre/examples/llmountcleanup.sh
114 %attr(-, root, root) /usr/lib/lustre/examples/llecho.sh
115 %attr(-, root, root) /usr/lib/lustre/examples/local.sh
116 %attr(-, root, root) /usr/lib/lustre/examples/uml.sh
117 %attr(-, root, root) /usr/lib/lustre/examples/lov.sh
118 %attr(-, root, root) /usr/lib/lustre/examples/echo.sh
119 %attr(-, root, root) /usr/lib/lustre/examples/llechocleanup.sh
120
121 %attr(-, root, root) /etc/init.d/lustre
122 %attr(-, root, root) /usr/sbin/acceptor
123 %attr(-, root, root) /usr/sbin/ptlctl
124 %attr(-, root, root) /usr/sbin/debugctl
125 %attr(-, root, root) /lib/libportals.a
126 %attr(-, root, root) /lib/libptlctl.a
127 %attr(-, root, root) /lib/libtcpnal.a
128 %attr(-, root, root) /usr/include/lustre/*.h
129 %attr(-, root, root) /usr/sbin/lload
130 %attr(-, root, root) /usr/sbin/obdbarrier
131 %attr(-, root, root) /usr/sbin/obdio
132 %attr(-, root, root) /usr/sbin/routerstat
133 %attr(-, root, root) /usr/sbin/wirecheck
134
135 %ifarch alpha
136 %attr(-, root, root) /usr/sbin/mcpload
137 %endif
138
139 %files -n lustre-doc
140 %attr(-, root, root) %doc COPYING FDL
141 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
142 #%attr(-, root, root) %doc tests/client-echo.cfg tests/client-mount.cfg
143 #%attr(-, root, root) %doc tests/client-mount2.cfg
144 #%attr(-, root, root) %doc tests/elan-client.cfg tests/elan-server.cfg
145 #%attr(-, root, root) %doc tests/ldlm.cfg tests/lustre.cfg
146 #%attr(-, root, root) %doc tests/mds.cfg tests/net-client.cfg
147 #%attr(-, root, root) %doc tests/net-local.cfg tests/net-server.cfg
148 #%attr(-, root, root) %doc tests/obdecho.cfg tests/obdfilter.cfg
149
150 %files -n lustre-modules
151 %attr(-, root, root) %doc COPYING
152 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ldlm.o
153 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llite.o
154 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/mdc.o
155 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/mds.o
156 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/fsfilt_ext3.o
157 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/fsfilt_reiserfs.o
158 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdclass.o
159 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdecho.o
160 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdfilter.o
161 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/lov.o
162 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/osc.o
163 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ost.o
164 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ptlrpc.o
165 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ptlbd.o
166 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/cobd.o
167 #portals modules
168 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre/kptlrouter.o
169 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre/*nal.o
170 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre/portals.o
171 %ifarch alpha
172 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre/p3mod.o
173 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre/rtscts.o
174 %endif
175
176 %files -n lustre-source
177 %attr(-, root, root) /usr/src/lustre-%{version}
178
179 #%ifarch i386
180 #%files -n liblustre
181 #%attr(-, root, root) /lib/lustre
182 #%attr(-, root, root) /lib/lustre/liblov.a
183 #%attr(-, root, root) /lib/lustre/liblustreclass.a
184 #%attr(-, root, root) /lib/lustre/libptlrpc.a
185 #%attr(-, root, root) /lib/lustre/libobdecho.a
186 #%attr(-, root, root) /lib/lustre/libldlm.a
187 #%attr(-, root, root) /lib/lustre/libosc.a
188 #%attr(-, root, root) /usr/sbin/lctl
189 #%attr(-, root, root) /usr/sbin/lfind
190 #%attr(-, root, root) /usr/sbin/lstripe
191 #%attr(-, root, root) /usr/sbin/obdio
192 #%attr(-, root, root) /usr/sbin/obdbarrier
193 #%attr(-, root, root) /usr/sbin/obdstat
194 #%attr(-, root, root) /usr/sbin/lload
195 #%attr(-, root, root) /usr/sbin/lconf
196 #%attr(-, root, root) /usr/sbin/lmc
197 #%attr(-, root, root) /usr/sbin/llanalyze
198 #%endif
199
200
201 %files -n lustre-ldap
202 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
203 %attr(-, root, root) /etc/openldap/schema/lustre.schema
204 %attr(-, root, root) /usr/lib/lustre/lustre2ldif.xsl
205 %attr(-, root, root) /usr/lib/lustre/top.ldif
206 #%dir /var/lib/ldap/lustre
207 %attr(700, ldap, ldap) /var/lib/ldap/lustre
208
209 %post
210 if [ ! -e /dev/obd ]; then
211    mknod /dev/obd c 10 241
212 fi
213 if [ ! -e /dev/portals ]; then
214    mknod /dev/portals c 10 240
215 fi
216 depmod -ae || exit 0
217
218 #grep -q obdclass /etc/modules.conf || \
219 #       echo 'alias char-major-10-241 obdclass' >> /etc/modules.conf
220
221 #grep -q '/dev/obd' /etc/modules.conf || \
222 #       echo 'alias /dev/obd obdclass' >> /etc/modules.conf
223
224 #grep -q '/dev/lustre' /etc/modules.conf || \
225 #       echo 'alias /dev/lustre obdclass' >> /etc/modules.conf
226
227 #grep -q portals /etc/modules.conf || \
228 #        echo 'alias char-major-10-240 portals' >> /etc/modules.conf
229
230 #grep -q '/dev/portals' /etc/modules.conf || \
231 #        echo 'alias /dev/portals portals' >> /etc/modules.conf
232
233 %postun
234 depmod -ae || exit 0
235
236 %post -n lustre-ldap
237 if ! grep -q slapd-lustre /etc/openldap/slapd.conf; then 
238   echo "include /etc/openldap/slapd-lustre.conf" >> /etc/openldap/slapd.conf
239 fi
240
241 %postun -n lustre-ldap
242 slapd=/etc/openldap/slapd.conf
243 if grep -q slapd-lustre $slapd; then 
244    tmp=/tmp/lustre-ldap.$$
245    sed "/slapd-lustre/d" $slapd >> $tmp
246    cp $tmp $slapd
247    rm $tmp
248 fi
249
250 %clean
251 #rm -rf $RPM_BUILD_ROOT
252
253 # end of file