]> git.pld-linux.org Git - packages/EMCpower.git/blob - EMCpower.spec
- more found files/dirs
[packages/EMCpower.git] / EMCpower.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_with     kernel          # build kernel modules
5 %bcond_without  up              # don't build UP module
6 %bcond_without  smp             # don't build SMP module
7 %bcond_without  userspace       # don't build userspace programs
8 %bcond_with     verbose         # verbose build (V=1)
9
10 %if %{without kernel}
11 %undefine       with_dist_kernel
12 %endif
13
14 %ifarch %{x8664}
15 %undefine       with_up
16 %endif
17
18 %define __kernel_ver    2.6.5-7.252
19 %define __kernel_rpmvr  %{__kernel_ver}
20
21 #
22 # main package.
23 #
24 %define         _rel    0.17
25 Summary:        EMC PowerPath - multi-path with fail-over and load-sharing over SCSI
26 Summary(pl):    EMC PowerPath - multi-path z fail-over i dzieleniem obci±¿enia po SCSI
27 Name:           EMCpower
28 Version:        4.5.1
29 Release:        %{_rel}
30 License:        Proprietary (not distributable)
31 Group:          Base/Kernel
32 Source0:        %{name}.LINUX-%{version}-022.sles.i386.rpm
33 # NoSource0-md5:        ed93c4daa2169b992c888ef5c27a6334
34 Source1:        %{name}.LINUX-%{version}-022.sles.x86_64.rpm
35 # NoSource1-md5:        b9e452479cff19640dee5431ff96f56c
36 NoSource:       0
37 NoSource:       1
38 Patch0:         %{name}-init.patch
39 %if %{with kernel}
40 %{?with_dist_kernel:BuildRequires:      kernel-module-build >= 3:2.6.14}
41 BuildRequires:  rpmbuild(macros) >= 1.286
42 %endif
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         _sysconfdir     /etc/emc
46 %define         _sbindir        /sbin
47 # binaries and libraries are x86
48 %define         _libdir         /usr/lib
49
50 %description
51 Multi-path software providing fail-over and load-sharing for SCSI
52 disks.
53
54 %description -l pl
55 Oprogramowanie do multi-path z opcj± fail-over i dzieleniem obci±¿enia
56 miêdzy dyski SCSI.
57
58 # kernel subpackages.
59
60 %package -n kernel-block-emc
61 Summary:        Linux driver for emc
62 Summary(pl):    Sterownik dla Linuksa do emc
63 Release:        %{_rel}@%{_kernel_ver_str}
64 Group:          Base/Kernel
65 Requires(post,postun):  /sbin/depmod
66 %if %{with dist_kernel}
67 %requires_releq_kernel_up
68 Requires(postun):       %releq_kernel_up
69 %endif
70
71 %description -n kernel-block-emc
72 This is driver for emc for Linux.
73
74 This package contains Linux module.
75
76 %description -n kernel-block-emc -l pl
77 Sterownik dla Linuksa do emc.
78
79 Ten pakiet zawiera modu³ j±dra Linuksa.
80
81 %package -n kernel-smp-block-emc
82 Summary:        Linux SMP driver for emc
83 Summary(pl):    Sterownik dla Linuksa SMP do emc
84 Release:        %{_rel}@%{_kernel_ver_str}
85 Group:          Base/Kernel
86 Requires(post,postun):  /sbin/depmod
87 %if %{with dist_kernel}
88 %requires_releq_kernel_smp
89 Requires(postun):       %releq_kernel_smp
90 %endif
91
92 %description -n kernel-smp-block-emc
93 This is driver for emc for Linux.
94
95 This package contains Linux SMP module.
96
97 %description -n kernel-smp-block-emc -l pl
98 Sterownik dla Linuksa do emc.
99
100 Ten pakiet zawiera modu³ j±dra Linuksa SMP.
101
102 %prep
103 %setup -qcT
104 %ifarch %{ix86}
105 rpm2cpio %{SOURCE0} | cpio -dimu
106 %endif
107 %ifarch %{x8664}
108 rpm2cpio %{SOURCE1} | cpio -dimu
109 %endif
110 mv etc/opt/emcpower/EMCpower.LINUX-%{version}/* .
111 %patch0 -p1
112
113 ln -s emcplib.Makefile bin/driver/Makefile
114
115 %build
116 cd bin/driver
117
118 %if %{with kernel}
119 # kernel module(s)
120 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
121         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
122                 exit 1
123         fi
124         install -d o/include/linux
125         ln -sf %{_kernelsrcdir}/config-$cfg o/.config
126         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
127         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
128 %if %{with dist_kernel}
129         %{__make} -C %{_kernelsrcdir} O=$PWD/o prepare scripts -j1
130 %else
131         install -d o/include/config
132         touch o/include/config/MARKER
133         ln -sf %{_kernelsrcdir}/scripts o/scripts
134 %endif
135 #
136 #       patching/creating makefile(s) (optional)
137 #
138         %{__make} -C %{_kernelsrcdir} clean \
139                 RCS_FIND_IGNORE="-name '*.ko' -o" \
140                 SYSSRC=%{_kernelsrcdir} \
141                 SYSOUT=$PWD/o \
142                 M=$PWD O=$PWD/o \
143                 %{?with_verbose:V=1}
144         %{__make} -C %{_kernelsrcdir} modules \
145                 CC="%{__cc}" CPP="%{__cpp}" \
146                 SYSSRC=%{_kernelsrcdir} \
147                 SYSOUT=$PWD/o \
148                 M=$PWD O=$PWD/o \
149                 %{?with_verbose:V=1}
150
151         mv emcplib{,-$cfg}.ko
152 done
153 %endif
154
155 %install
156 rm -rf $RPM_BUILD_ROOT
157
158 %if %{with userspace}
159 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_libdir},%{_sbindir},%{_mandir}/man1,/etc/modprobe.d,%{_datadir}/locale,/etc/rc.d/init.d}
160
161 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
162 install modprobe.conf.pp $RPM_BUILD_ROOT/etc/modprobe.d/%{name}.conf
163 cp -a i18n/catalog/* $RPM_BUILD_ROOT%{_datadir}/locale
164 install PowerPath.rhel $RPM_BUILD_ROOT/etc/rc.d/init.d/powerpath
165 install bin/lib/* $RPM_BUILD_ROOT%{_libdir}
166 install bin/cmds/* $RPM_BUILD_ROOT%{_sbindir}
167 cp -a bin/.drivers_ext $RPM_BUILD_ROOT%{_sysconfdir}/drivers_ext
168
169 %find_lang EMCpower
170 %find_lang PowerPath
171 cat PowerPath.lang >> EMCpower.lang
172
173 # hardcoded paths. oh sigh
174 install -d $RPM_BUILD_ROOT/etc/opt/emcpower/.tmp
175 ln -s %{_sbindir}/emcpmgr $RPM_BUILD_ROOT/etc/opt/emcpower
176 ln -s %{_sbindir}/powercf $RPM_BUILD_ROOT/etc/opt/emcpower
177 touch $RPM_BUILD_ROOT/etc/opt/emcpower/.__emcp_db_global_lock
178 touch $RPM_BUILD_ROOT/etc/opt/emcpower/.__emcp_db_lock
179
180 install -d $RPM_BUILD_ROOT/opt/emcpower
181 install -d $RPM_BUILD_ROOT/etc/emcpower
182 touch $RPM_BUILD_ROOT%{_sysconfdir}/mpaa.{excluded,lams}
183 %endif
184
185 %if %{with kernel}
186 cd bin/driver
187 %if %{with up}
188 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block
189 install emcplib-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
190         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block/emcplib.ko
191
192 brand=sles; type=default
193 %ifarch %{x8664}
194 type=${type}_x8664
195 %endif
196 for a in emcplib emcp emcphr emcpioc emcpmp emcpmpaa emcpmpap emcpmpc; do
197         install ${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block/$a.ko
198 done
199 %endif
200
201 %if %{with smp} && %{with dist_kernel}
202 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block
203 install emcplib-smp.ko \
204         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/emcplib.ko
205
206 brand=sles; type=smp
207 %ifarch %{x8664}
208 type=${type}_x8664
209 %endif
210  for a in emcplib emcp emcphr emcpioc emcpmp emcpmpaa emcpmpap emcpmpc; do
211         install ${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/$a.ko
212 done
213 %endif
214 %endif
215
216 %clean
217 rm -rf $RPM_BUILD_ROOT
218
219 %verifyscript
220 echo "These PowerPath modules are installed"
221 /sbin/lsmod | head -n 1
222 /sbin/lsmod | grep emc
223 echo "DONE"
224
225 %pre
226 # Check - Only install on a 2.6 kernel
227 expr `uname -r` : '2\.6' > /dev/null
228 if [ $? -ne 0 ]; then
229         echo "This PowerPath package does not support this kernel."
230         exit 1
231 fi
232
233 # Check - Make sure no devices are in use.
234 if [ "`/sbin/lsmod | grep -w emcp`" != "" ]; then
235         /sbin/powermt save > /dev/null 2>&1
236         /sbin/powermt remove dev=all > /dev/null 2>&1
237         if [ "`powermt display dev=all 2>&1 | grep "not found"`" = "" ]; then
238                 echo "Unable to remove devices from the PowerPath configuration."
239                 echo "Please make sure no PowerPath devices are in use and retry."
240                 /sbin/powermt config > /dev/null 2>&1
241                 /sbin/powermt load > /dev/null 2>&1
242                 exit 1
243         fi
244         /sbin/powermt config > /dev/null 2>&1
245         /sbin/powermt load > /dev/null 2>&1
246 fi
247
248 %post   -n kernel-block-emc
249 %depmod %{_kernel_ver}
250
251 %postun -n kernel-block-emc
252 %depmod %{_kernel_ver}
253
254 %post   -n kernel-smp-block-emc
255 %depmod %{_kernel_ver}-smp
256
257 %postun -n kernel-smp-block-emc
258 %depmod %{_kernel_ver}-smp
259
260 %if %{with kernel}
261 %if %{with up}
262 %files -n kernel-block-emc
263 %defattr(644,root,root,755)
264 /lib/modules/%{_kernel_ver}/kernel/drivers/block/*.ko*
265 %endif
266
267 %if %{with smp} && %{with dist_kernel}
268 %files -n kernel-smp-block-emc
269 %defattr(644,root,root,755)
270 /lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/*.ko*
271 %endif
272 %endif
273
274 %if %{with userspace}
275 %files -f EMCpower.lang
276 %defattr(644,root,root,755)
277 %dir %{_sysconfdir}
278 %{_sysconfdir}/drivers_ext
279 %ghost %{_sysconfdir}/mpaa.excluded
280 %ghost %{_sysconfdir}/mpaa.lams
281 /etc/modprobe.d/EMCpower.conf
282 %attr(754,root,root) /etc/rc.d/init.d/powerpath
283 %attr(755,root,root) %{_sbindir}/emcpadm
284 %attr(755,root,root) %{_sbindir}/emcpdiscover
285 %attr(755,root,root) %{_sbindir}/emcpmgr
286 %attr(755,root,root) %{_sbindir}/emcppurge
287 %attr(755,root,root) %{_sbindir}/emcpreg
288 %attr(755,root,root) %{_sbindir}/powercf
289 %attr(755,root,root) %{_sbindir}/powermt
290 %attr(755,root,root) %{_sbindir}/powerprotect
291 %attr(755,root,root) %{_libdir}/libemcp.so
292 %attr(755,root,root) %{_libdir}/libemcp_core.so
293 %attr(755,root,root) %{_libdir}/libemcp_lam.so
294 %attr(755,root,root) %{_libdir}/libemcp_lic_rtl.so
295 %attr(755,root,root) %{_libdir}/libemcp_mp_rtl.so
296 %attr(755,root,root) %{_libdir}/libemcpmp.so
297 %attr(755,root,root) %{_libdir}/libpn.so
298 %{_mandir}/man1/emcpadm.1*
299 %{_mandir}/man1/emcpreg.1*
300 %{_mandir}/man1/emcpupgrade.1*
301 %{_mandir}/man1/powermig.1*
302 %{_mandir}/man1/powermt.1*
303 %{_mandir}/man1/powerprotect.1*
304
305 # hardcoded paths. oh sigh
306 /etc/opt/emcpower
307 %ghost /etc/opt/emcpower/.__emcp_db_global_lock
308 %ghost /etc/opt/emcpower/.__emcp_db_lock
309 /opt/emcpower
310 %dir /etc/emcpower
311 %endif
This page took 0.047684 seconds and 3 git commands to generate.