Whamcloud - gitweb
merge b_devel into HEAD. Includes:
[fs/lustre-release.git] / lustre / scripts / lustre.spec.in
1 # lustre.spec
2 %define version HEAD
3 %define kversion @RELEASE@
4 %define linuxdir @LINUX@
5 %define portalsdir @PORTALS@
6 %define portalslibdir @PORTALSLIB@
7 Release: 0302240920chaos
8
9 Summary: Lustre Lite File System
10 Name: lustre-lite
11 Version: %{version}
12 Copyright: GPL
13 Group: Utilities/System
14 Requires: lustre-modules, PyXML
15 BuildRoot: /var/tmp/lustre-%{version}-root
16 Source: ftp://ftp.lustre.com/pub/lustre/lustre-%{version}.tar.gz
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: portals-modules
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
63 %prep
64 %setup -qn lustre-%{version}
65 %setup -c -n lustre-%{version}-lib
66
67 %build
68 rm -rf $RPM_BUILD_ROOT
69
70 # Set an explicit path to our Linux tree, if we can.
71 cd $RPM_BUILD_DIR/lustre-%{version}
72 ./configure --with-linux='%{linuxdir}' --with-portals='%{portalsdir}' --with-portalslib='%{portalslibdir}'
73 make
74
75 %ifarch i386
76 cd $RPM_BUILD_DIR/lustre-%{version}-lib/lustre-%{version}
77 ./configure --with-lib --with-portals='%{portalsdir}' --with-portalslib='%{portalslibdir}'
78 make
79 %endif
80
81 %install
82 cd $RPM_BUILD_DIR/lustre-%{version}
83 make install prefix=$RPM_BUILD_ROOT
84
85 %ifarch i386
86 cd $RPM_BUILD_DIR/lustre-%{version}-lib/lustre-%{version}
87 make install prefix=$RPM_BUILD_ROOT
88 %endif
89
90
91 # Create the pristine source directory.
92 cd $RPM_BUILD_DIR/lustre-%{version}
93 mkdir -p $RPM_BUILD_ROOT/usr/src
94 rm -f lustre-source
95 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
96 make distdir distdir=lustre-source/lustre-%{version}
97
98 # ldap database directory
99 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
100
101 %files
102 %attr(-, root, root) /usr/sbin/lmc
103 %attr(-, root, root) /usr/sbin/lctl
104 %attr(-, root, root) /usr/sbin/lconf
105 %attr(-, root, root) /usr/sbin/llanalyze
106 %attr(-, root, root) /usr/sbin/lfind
107 %attr(-, root, root) /usr/sbin/lstripe
108 %attr(-, root, root) /usr/sbin/mcreate
109 %attr(-, root, root) /usr/sbin/mkdirmany
110 %attr(-, root, root) /usr/lib/lustre/examples/llmount.sh
111 %attr(-, root, root) /usr/lib/lustre/examples/llmountcleanup.sh
112 %attr(-, root, root) /usr/lib/lustre/examples/llecho.sh
113 %attr(-, root, root) /usr/lib/lustre/examples/local.sh
114 %attr(-, root, root) /usr/lib/lustre/examples/uml.sh
115 %attr(-, root, root) /usr/lib/lustre/examples/lov.sh
116 %attr(-, root, root) /etc/init.d/lustre
117
118 %files -n lustre-doc
119 %attr(-, root, root) %doc COPYING FDL
120 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
121 %attr(-, root, root) %doc tests/client-echo.cfg tests/client-mount.cfg
122 %attr(-, root, root) %doc tests/client-mount2.cfg
123 %attr(-, root, root) %doc tests/elan-client.cfg tests/elan-server.cfg
124 %attr(-, root, root) %doc tests/ldlm.cfg tests/lustre.cfg
125 %attr(-, root, root) %doc tests/mds.cfg tests/net-client.cfg
126 %attr(-, root, root) %doc tests/net-local.cfg tests/net-server.cfg
127 %attr(-, root, root) %doc tests/obdecho.cfg tests/obdfilter.cfg
128
129 %files -n lustre-modules
130 %attr(-, root, root) %doc COPYING
131 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/extN.o
132 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ldlm.o
133 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llite.o
134 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/mdc.o
135 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/mds.o
136 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/fsfilt_extN.o
137 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdclass.o
138 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdecho.o
139 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdfilter.o
140 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/lov.o
141 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/osc.o
142 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ost.o
143 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ptlrpc.o
144
145 %files -n lustre-source
146 %attr(-, root, root) /usr/src/lustre-%{version}
147
148 %ifarch i386
149 %files -n liblustre
150 %attr(-, root, root) /lib/lustre
151 %attr(-, root, root) /lib/lustre/liblov.a
152 %attr(-, root, root) /lib/lustre/liblustreclass.a
153 %attr(-, root, root) /lib/lustre/libptlrpc.a
154 %attr(-, root, root) /lib/lustre/libobdecho.a
155 %attr(-, root, root) /lib/lustre/libldlm.a
156 %attr(-, root, root) /lib/lustre/libosc.a
157 %attr(-, root, root) /usr/sbin/lctl
158 %attr(-, root, root) /usr/sbin/lfind
159 %attr(-, root, root) /usr/sbin/lstripe
160 %attr(-, root, root) /usr/sbin/obdio
161 %attr(-, root, root) /usr/sbin/obdbarrier
162 %attr(-, root, root) /usr/sbin/obdstat
163 %attr(-, root, root) /usr/sbin/lload
164 %attr(-, root, root) /usr/sbin/lconf
165 %attr(-, root, root) /usr/sbin/lmc
166 %attr(-, root, root) /usr/sbin/llanalyze
167 %endif
168
169
170 %files -n lustre-ldap
171 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
172 %attr(-, root, root) /etc/openldap/schema/lustre.schema
173 %attr(-, root, root) /usr/lib/lustre/lustre2ldif.xsl
174 %attr(-, root, root) /usr/lib/lustre/top.ldif
175 %dir /var/lib/ldap/lustre
176 %attr(700, ldap, ldap) /var/lib/ldap/lustre
177
178 %post
179 if [ ! -e /dev/obd ]; then
180    mknod /dev/obd c 10 241
181 fi
182 depmod -ae || exit 0
183
184 grep -q obdclass /etc/modules.conf || \
185         echo 'alias char-major-10-241 obdclass' >> /etc/modules.conf
186
187 grep -q '/dev/obd' /etc/modules.conf || \
188         echo 'alias /dev/obd obdclass' >> /etc/modules.conf
189
190 grep -q '/dev/lustre' /etc/modules.conf || \
191         echo 'alias /dev/lustre obdclass' >> /etc/modules.conf
192
193 %postun
194 depmod -ae || exit 0
195
196 %post -n lustre-ldap
197 if ! grep -q slapd-lustre /etc/openldap/slapd.conf; then 
198   echo "include /etc/openldap/slapd-lustre.conf" >> /etc/openldap/slapd.conf
199 fi
200
201 %postun -n lustre-ldap
202 slapd=/etc/openldap/slapd.conf
203 if grep -q slapd-lustre $slapd; then 
204    tmp=/tmp/lustre-ldap.$$
205    sed "/slapd-lustre/d" $slapd >> $tmp
206    cp $tmp $slapd
207    rm $tmp
208 fi
209
210 %clean
211 #rm -rf $RPM_BUILD_ROOT
212
213 # end of file