3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # build kernel modules
5 %bcond_with 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)
11 %undefine with_dist_kernel
18 %define __kernel_ver 2.6.16.21-0.8
19 %define __kernel_rpmvr %{__kernel_ver}
21 %define releq_kernel_smp kernel-smp = 0:%{__kernel_ver}
22 %define releq_kernel_up kernel-up = 0:%{__kernel_ver}
25 Summary: EMC PowerPath - multi-path with fail-over and load-sharing over SCSI
26 Summary(pl.UTF-8): EMC PowerPath - multi-path z fail-over i dzieleniem obciążenia po SCSI
30 License: Proprietary (not distributable)
32 Source0: %{name}.LINUX-%{version}-157.sles10.i386.rpm
33 # NoSource0-md5: 9e687044c65d2ee368b71c339e639522
34 Source1: %{name}.LINUX-%{version}-157.sles10.x86_64.rpm
35 # NoSource1-md5: cf980fc4714f0be008de168333cefcb4
38 Patch0: %{name}-init.patch
39 Requires(post,preun): /sbin/chkconfig
40 Obsoletes: EMCpower.LINUX
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %define _sysconfdir /something/bogus
44 %define _sbindir /sbin
47 Multi-path software providing fail-over and load-sharing for SCSI
50 %description -l pl.UTF-8
51 Oprogramowanie do multi-path z opcją fail-over i dzieleniem obciążenia
56 %package -n kernel-block-emc
57 Summary: Linux driver for emc
58 Summary(pl.UTF-8): Sterownik dla Linuksa do emc
59 Release: %{_rel}@%{_kernel_ver_str}
61 Requires(post,postun): /sbin/depmod
62 %if %{with dist_kernel}
63 %requires_releq_kernel_up
64 Requires(postun): %releq_kernel_up
67 %description -n kernel-block-emc
68 This is driver for emc for Linux.
70 This package contains Linux module.
72 %description -n kernel-block-emc -l pl.UTF-8
73 Sterownik dla Linuksa do emc.
75 Ten pakiet zawiera moduł jądra Linuksa.
77 %package -n kernel-smp-block-emc
78 Summary: Linux SMP driver for emc
79 Summary(pl.UTF-8): Sterownik dla Linuksa SMP do emc
80 Release: %{_rel}@%{_kernel_ver_str}
82 Requires(post,postun): /sbin/depmod
83 %if %{with dist_kernel}
84 %requires_releq_kernel_smp
85 Requires(postun): %releq_kernel_smp
88 %description -n kernel-smp-block-emc
89 This is driver for emc for Linux.
91 This package contains Linux SMP module.
93 %description -n kernel-smp-block-emc -l pl.UTF-8
94 Sterownik dla Linuksa do emc.
96 Ten pakiet zawiera moduł jądra Linuksa SMP.
101 rpm2cpio %{SOURCE0} | cpio -dimu
104 rpm2cpio %{SOURCE1} | cpio -dimu
106 mv etc/opt/emcpower/EMCpower.LINUX-%{version}/* .
109 echo 'options emcp managedclass=symm,clariion,hitachi,invista,hpxp,ess,hphsx' >> modprobe.conf.pp
112 rm -rf $RPM_BUILD_ROOT
113 %if %{with userspace}
114 install -d $RPM_BUILD_ROOT{/etc/emc/ppme,%{_libdir},%{_sbindir},%{_mandir}/man1,/etc/modprobe.d,%{_datadir}/locale,/etc/rc.d/init.d}
116 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
117 cp -a i18n/catalog/* $RPM_BUILD_ROOT%{_datadir}/locale
118 install PowerPath $RPM_BUILD_ROOT/etc/rc.d/init.d/PowerPath
119 install bin/lib/* $RPM_BUILD_ROOT%{_libdir}
120 install bin/cmds/* $RPM_BUILD_ROOT%{_sbindir}
121 cp -a bin/.drivers_* $RPM_BUILD_ROOT/etc/emc
125 cat PowerPath.lang >> EMCpower.lang
127 # hardcoded paths. oh sigh
128 install -d $RPM_BUILD_ROOT/etc/opt/emcpower/.tmp
129 ln -s %{_sbindir}/emcpmgr $RPM_BUILD_ROOT/etc/opt/emcpower
130 ln -s %{_sbindir}/powercf $RPM_BUILD_ROOT/etc/opt/emcpower
131 touch $RPM_BUILD_ROOT/etc/opt/emcpower/.__emcp_db_global_lock
132 touch $RPM_BUILD_ROOT/etc/opt/emcpower/.__emcp_db_lock
134 install -d $RPM_BUILD_ROOT/opt/emcpower
135 install -d $RPM_BUILD_ROOT/etc/emcpower
136 touch $RPM_BUILD_ROOT/etc/emc/mpaa.{excluded,lams}
141 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block
142 install -D modprobe.conf.pp $RPM_BUILD_ROOT/etc/modprobe.d/%{_kernel_ver}/%{name}.conf
144 brand=sles10; type=default
148 for a in emcp emcpdm emcpgpx emcpioc emcplib emcpmpx; do
149 install bin/driver/${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block/$a.ko
153 %if %{with smp} && %{with dist_kernel}
154 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block
155 install -D modprobe.conf.pp $RPM_BUILD_ROOT/etc/modprobe.d/%{_kernel_ver}-smp/%{name}.conf
156 brand=sles10; type=smp
160 for a in emcp emcpdm emcpgpx emcpioc emcplib emcpmpx; do
161 install bin/driver/${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/$a.ko
167 rm -rf $RPM_BUILD_ROOT
170 /sbin/chkconfig --add PowerPath
173 if [ "$1" = "0" ]; then
174 /sbin/chkconfig --del PowerPath
177 %post -n kernel-block-emc
178 %depmod %{_kernel_ver}
180 %postun -n kernel-block-emc
181 %depmod %{_kernel_ver}
183 %post -n kernel-smp-block-emc
184 %depmod %{_kernel_ver}-smp
186 %postun -n kernel-smp-block-emc
187 %depmod %{_kernel_ver}-smp
191 %files -n kernel-block-emc
192 %defattr(644,root,root,755)
193 /etc/modprobe.d/%{_kernel_ver}/%{name}.conf
194 /lib/modules/%{_kernel_ver}/kernel/drivers/block/*.ko*
197 %if %{with smp} && %{with dist_kernel}
198 %files -n kernel-smp-block-emc
199 %defattr(644,root,root,755)
200 /etc/modprobe.d/%{_kernel_ver}-smp/%{name}.conf
201 /lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/*.ko*
205 %if %{with userspace}
206 %files -f EMCpower.lang
207 %defattr(644,root,root,755)
211 %ghost /etc/emc/mpaa.excluded
212 %ghost /etc/emc/mpaa.lams
213 %attr(754,root,root) /etc/rc.d/init.d/PowerPath
214 %attr(755,root,root) %{_sbindir}/emcpadm
215 %attr(755,root,root) %{_sbindir}/emcpdiscover
216 %attr(755,root,root) %{_sbindir}/emcpmgr
217 %attr(755,root,root) %{_sbindir}/emcppurge
218 %attr(755,root,root) %{_sbindir}/emcpreg
219 %attr(755,root,root) %{_sbindir}/powercf
220 %attr(755,root,root) %{_sbindir}/powermt
221 %attr(755,root,root) %{_sbindir}/powerprotect
222 %attr(755,root,root) %{_sbindir}/powermig
223 %attr(755,root,root) %{_sbindir}/pp_inq
224 %attr(755,root,root) %{_libdir}/libemcp.so
225 %attr(755,root,root) %{_libdir}/libemcp_core.so
226 %attr(755,root,root) %{_libdir}/libemcp_lam.so
227 %attr(755,root,root) %{_libdir}/libemcp_lic_rtl.so
228 %attr(755,root,root) %{_libdir}/libemcp_mp_rtl.so
229 %attr(755,root,root) %{_libdir}/libemcpmp.so
230 %attr(755,root,root) %{_libdir}/libpn.so
231 %{_mandir}/man1/emcpadm.1*
232 %{_mandir}/man1/emcpreg.1*
233 %{_mandir}/man1/emcpupgrade.1*
234 %{_mandir}/man1/powerformat.1*
235 %{_mandir}/man1/powermig.1*
236 %{_mandir}/man1/powermt.1*
237 %{_mandir}/man1/powerprotect.1*
239 # hardcoded paths. oh sigh
240 %dir /etc/opt/emcpower
241 %ghost /etc/opt/emcpower/.__emcp_db_global_lock
242 %ghost /etc/opt/emcpower/.__emcp_db_lock