Whamcloud - gitweb
6b40c4188762b0dfcc1fbe201773ab8beb0dc96d
[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 cd $RPM_BUILD_DIR/lustre-%{version}-lib/lustre-%{version}
75 ./configure --with-lib --with-portals='%{portalsdir}' --with-portalslib='%{portalslibdir}'
76 make
77
78 %install
79 cd $RPM_BUILD_DIR/lustre-%{version}
80 make install prefix=$RPM_BUILD_ROOT
81
82 cd $RPM_BUILD_DIR/lustre-%{version}-lib/lustre-%{version}
83 make install prefix=$RPM_BUILD_ROOT
84
85
86 # Create the pristine source directory.
87 cd $RPM_BUILD_DIR/lustre-%{version}
88 mkdir -p $RPM_BUILD_ROOT/usr/src
89 rm -f lustre-source
90 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
91 make distdir distdir=lustre-source/lustre-%{version}
92
93 # ldap database directory
94 mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
95
96 %files
97 %attr(-, root, root) /usr/sbin/lmc
98 %attr(-, root, root) /usr/sbin/lctl
99 %attr(-, root, root) /usr/sbin/lconf
100 %attr(-, root, root) /usr/sbin/llanalyze
101 %attr(-, root, root) /usr/sbin/lfind
102 %attr(-, root, root) /usr/sbin/lstripe
103 %attr(-, root, root) /usr/sbin/mcreate
104 %attr(-, root, root) /usr/sbin/mkdirmany
105 %attr(-, root, root) /usr/lib/lustre/examples/llmount.sh
106 %attr(-, root, root) /usr/lib/lustre/examples/llmountcleanup.sh
107 %attr(-, root, root) /usr/lib/lustre/examples/llecho.sh
108 %attr(-, root, root) /usr/lib/lustre/examples/local.sh
109 %attr(-, root, root) /usr/lib/lustre/examples/uml.sh
110 %attr(-, root, root) /usr/lib/lustre/examples/lov.sh
111 %attr(-, root, root) /etc/init.d/lustre
112
113 %files -n lustre-doc
114 %attr(-, root, root) %doc COPYING FDL
115 %attr(-, root, root) %doc doc/lustre.pdf doc/lustre-HOWTO.txt
116 %attr(-, root, root) %doc tests/client-echo.cfg tests/client-mount.cfg
117 %attr(-, root, root) %doc tests/client-mount2.cfg
118 %attr(-, root, root) %doc tests/elan-client.cfg tests/elan-server.cfg
119 %attr(-, root, root) %doc tests/ldlm.cfg tests/lustre.cfg
120 %attr(-, root, root) %doc tests/mds.cfg tests/net-client.cfg
121 %attr(-, root, root) %doc tests/net-local.cfg tests/net-server.cfg
122 %attr(-, root, root) %doc tests/obdecho.cfg tests/obdfilter.cfg
123
124 %files -n lustre-modules
125 %attr(-, root, root) %doc COPYING
126 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/extN.o
127 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ldlm.o
128 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llite.o
129 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/mdc.o
130 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/mds.o
131 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/fsfilt_extN.o
132 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdclass.o
133 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdecho.o
134 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/obdfilter.o
135 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/lov.o
136 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/osc.o
137 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ost.o
138 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/ptlrpc.o
139
140 %files -n lustre-source
141 %attr(-, root, root) /usr/src/lustre-%{version}
142
143 %files -n liblustre
144 %attr(-, root, root) /lib/lustre
145 %attr(-, root, root) /lib/lustre/liblov.a
146 %attr(-, root, root) /lib/lustre/liblustreclass.a
147 %attr(-, root, root) /lib/lustre/libptlrpc.a
148 %attr(-, root, root) /lib/lustre/libobdecho.a
149 %attr(-, root, root) /lib/lustre/libldlm.a
150 %attr(-, root, root) /lib/lustre/libosc.a
151 %attr(-, root, root) /usr/sbin/lctl
152 %attr(-, root, root) /usr/sbin/lfind
153 %attr(-, root, root) /usr/sbin/lstripe
154 %attr(-, root, root) /usr/sbin/obdio
155 %attr(-, root, root) /usr/sbin/obdbarrier
156 %attr(-, root, root) /usr/sbin/obdstat
157 %attr(-, root, root) /usr/sbin/lload
158 %attr(-, root, root) /usr/sbin/lconf
159 %attr(-, root, root) /usr/sbin/lmc
160 %attr(-, root, root) /usr/sbin/llanalyze
161
162
163 %files -n lustre-ldap
164 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
165 %attr(-, root, root) /etc/openldap/schema/lustre.schema
166 %attr(-, root, root) /usr/lib/lustre/lustre2ldif.xsl
167 %attr(-, root, root) /usr/lib/lustre/top.ldif
168 %dir /var/lib/ldap/lustre
169 %attr(700, ldap, ldap) /var/lib/ldap/lustre
170
171 %post
172 if [ ! -e /dev/obd ]; then
173    mknod /dev/obd c 10 241
174 fi
175 depmod -ae || exit 0
176
177 grep -q obdclass /etc/modules.conf || \
178         echo 'alias char-major-10-241 obdclass' >> /etc/modules.conf
179
180 grep -q '/dev/obd' /etc/modules.conf || \
181         echo 'alias /dev/obd obdclass' >> /etc/modules.conf
182
183 grep -q '/dev/lustre' /etc/modules.conf || \
184         echo 'alias /dev/lustre obdclass' >> /etc/modules.conf
185
186 %postun
187 depmod -ae || exit 0
188
189 %post -n lustre-ldap
190 if ! grep -q slapd-lustre /etc/openldap/slapd.conf; then 
191   echo "include /etc/openldap/slapd-lustre.conf" >> /etc/openldap/slapd.conf
192 fi
193
194 %postun -n lustre-ldap
195 slapd=/etc/openldap/slapd.conf
196 if grep -q slapd-lustre $slapd; then 
197    tmp=/tmp/lustre-ldap.$$
198    sed "/slapd-lustre/d" $slapd >> $tmp
199    cp $tmp $slapd
200    rm $tmp
201 fi
202
203 %clean
204 #rm -rf $RPM_BUILD_ROOT
205
206 # end of file