Whamcloud - gitweb
b=6205
[fs/lustre-release.git] / build / lustre.spec.in
1 # lustre.spec
2 %define version @VERSION@
3 %define kversion @LINUXRELEASE@
4
5 Summary: Lustre File System
6 Name: lustre
7 Version: %{version}
8 Release: @RELEASE@
9 Copyright: GPL
10 Group: Utilities/System
11 Requires: lustre-modules
12 Source: lustre-%{version}.tar.gz
13 URL: http://clusterfs.com/
14 BuildRoot: /var/tmp/lustre-%{version}-root
15 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap
16 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}, lustre-ldap = %{version}
17
18 %description
19 Userspace tools and files for the Lustre file system.
20
21 %package modules
22 Summary: Kernel Lustre modules for Linux %{kversion}
23 Requires: modutils >= 2.4.10
24 Group: Development/Kernel
25
26 %description modules
27 Lustre file system, server and network drivers for Linux %{kversion}.
28
29 %package source
30 Summary: Object-Based Disk storage driver source
31 Group: Development/Kernel
32
33 %description source
34 Lustre sources for further development
35
36 # Since the RPMs we ship are to be used on both SLES and RHEL, we
37 # can't include any dependency information (since the package names
38 # are different on the two platforms).
39 #
40 # Instead, we can build these empty meta-packages that only include
41 # dependency information.  These let people get the correct
42 # dependencies for their platform and lets them use tools like yum and
43 # red carpet to install the correct files.
44 #
45 # Unfortunately I have not seen this come up on the lists much, so I
46 # have disabled them (by commenting out their empty files section
47 # below) until it's clear that they resolve more confusion than they
48 # add.
49
50 %package deps-sles
51 Summary: Lustre dependencies meta-package for SLES
52 Group: Utilities/System
53 Provides: lustre-deps = %{version}
54 Requires: lustre = %{version}, sles-release, python-xml
55 Conflicts: lustre-deps-rhel
56
57 %description deps-sles
58 This package has RPM dependencies appropriate for SLES systems.
59
60 %package deps-rhel
61 Summary: Lustre dependencies meta-package for RHEL
62 Group: Utilities/System
63 Provides: lustre-deps = %{version}
64 Requires: lustre = %{version}, redhat-release, PyXML
65 Conflicts: lustre-deps-sles
66
67 %description deps-rhel
68 This package has RPM dependencies appropriate for RHEL, RHL, and FC
69 systems.
70
71 %prep
72 %setup -qn lustre-%{version}
73
74 %build
75 # if RPM_BUILD_NCPUS unset, set it
76 if [ -z "$RPM_BUILD_NCPUS" ] ; then
77     RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
78     if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
79         RPM_BUILD_NCPUS=1
80     fi
81     if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
82         RPM_BUILD_NCPUS=8
83     fi
84 fi
85
86 rm -rf $RPM_BUILD_ROOT
87
88 # Set an explicit path to our Linux tree, if we can.
89 cd $RPM_BUILD_DIR/lustre-%{version}
90 ./configure @ac_configure_args@ \
91         --sysconfdir=%{_sysconfdir} \
92         --mandir=%{_mandir} \
93         --libdir=%{_libdir}
94 make -j $RPM_BUILD_NCPUS -s
95
96 %install
97 make install DESTDIR=$RPM_BUILD_ROOT
98 # hack to avoid changing the libsysio code for "make install"
99 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
100
101 # Create the pristine source directory.
102 cd $RPM_BUILD_DIR/lustre-%{version}
103 mkdir -p $RPM_BUILD_ROOT/usr/src
104 rm -f lustre-source
105 ln -s $RPM_BUILD_ROOT/usr/src lustre-source
106 make distdir distdir=lustre-source/lustre-%{version}
107
108 %files
109 %attr(-, root, root) /sbin/mount.lustre
110 %attr(-, root, root) /usr/sbin/*
111 %attr(-, root, root) /usr/bin/*
112 %attr(-, root, root) %{_libdir}/lustre/python
113 %attr(-, root, root) /usr/share/lustre/examples
114
115 %attr(-, root, root) /etc/init.d/lustre
116 %attr(-, root, root) /etc/init.d/lustrefs
117
118 %attr(-, root, root) %{_libdir}/libptlctl.a
119 %attr(-, root, root) %{_libdir}/liblustreapi.a
120 %attr(-, root, root) /usr/include/lustre
121 %attr(-, root, root) /usr/include/linux/lustre_idl.h
122
123 %attr(-, root, root) %{_mandir}/man?/*
124
125 %attr(-, root, root) /etc/openldap/slapd-lustre.conf
126 %attr(-, root, root) /etc/openldap/schema/lustre.schema
127 %attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
128 %attr(-, root, root) /usr/share/lustre/top.ldif
129
130 %files modules
131 %attr(-, root, root) %doc COPYING
132 %attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre
133 %attr(-, root, root) /lib/modules/%{kversion}/kernel/net/lustre
134
135 %files source
136 %attr(-, root, root) /usr/src/lustre-%{version}
137
138 # uncomment these lines to enable deps packages
139 # %files deps-sles
140 # %files deps-rhel
141
142 %post
143 if [ -f /etc/init.d/lustre ] ; then
144         /sbin/chkconfig --add lustre
145         /sbin/chkconfig --add lustrefs
146 fi
147
148 %preun
149 if [ $1 = 0 -a -f /etc/init.d/lustre ] ; then
150         /sbin/chkconfig --del lustre
151         /sbin/chkconfig --del lustrefs
152 fi
153
154 %post modules
155 if [ ! -e /dev/obd ]; then
156    mknod /dev/obd c 10 241
157 fi
158 if [ ! -e /dev/portals ]; then
159    mknod /dev/portals c 10 240
160 fi
161 if [ -f /boot/System.map-%{kversion} ]; then
162         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
163 else
164         depmod -ae %{kversion} || exit 0
165 fi
166
167 %postun modules
168 if [ -f /boot/System.map-%{kversion} ]; then
169         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
170 else
171         depmod -ae %{kversion} || exit 0
172 fi
173
174 %clean
175 rm -rf $RPM_BUILD_ROOT