]> git.pld-linux.org Git - packages/EMCpower.git/blob - EMCpower.spec
- use our initscript
[packages/EMCpower.git] / EMCpower.spec
1 #
2 # Conditional build:
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)
9
10 %if %{without kernel}
11 %undefine       with_dist_kernel
12 %endif
13
14 # just don't want to build it :)
15 %ifarch %{x8664}
16 %undefine       with_up
17 %endif
18
19 %define __kernel_ver    2.6.16.21-0.8
20 %define __kernel_rpmvr  %{__kernel_ver}
21
22 %define releq_kernel_smp        kernel-smp = 0:%{__kernel_ver}
23 %define releq_kernel_up         kernel-up = 0:%{__kernel_ver}
24
25 %define         _rel    0.20
26 Summary:        EMC PowerPath - multi-path with fail-over and load-sharing over SCSI
27 Summary(pl.UTF-8):      EMC PowerPath - multi-path z fail-over i dzieleniem obciążenia po SCSI
28 Name:           EMCpower
29 Version:        5.0.0
30 Release:        %{_rel}
31 License:        Proprietary (not distributable)
32 Group:          Base
33 %ifarch %{ix86}
34 Source0:        %{name}.LINUX-%{version}-157.sles10.i386.rpm
35 # NoSource0-md5:        9e687044c65d2ee368b71c339e639522
36 NoSource:       0
37 %endif
38 %ifarch %{x8664}
39 Source1:        %{name}.LINUX-%{version}-157.sles10.x86_64.rpm
40 # NoSource1-md5:        cf980fc4714f0be008de168333cefcb4
41 NoSource:       1
42 %endif
43 Source2:        PowerPath.init
44 Requires(post,preun):   /sbin/chkconfig
45 Obsoletes:      EMCpower.LINUX
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %define         _sysconfdir     /something/bogus
49 %define         _sbindir        /sbin
50
51 %description
52 Multi-path software providing fail-over and load-sharing for SCSI
53 disks.
54
55 %description -l pl.UTF-8
56 Oprogramowanie do multi-path z opcją fail-over i dzieleniem obciążenia
57 między dyski SCSI.
58
59 # kernel subpackages.
60
61 %package -n kernel-block-emc
62 Summary:        Linux driver for emc
63 Summary(pl.UTF-8):      Sterownik dla Linuksa do emc
64 Release:        %{_rel}@%{_kernel_ver_str}
65 Group:          Base/Kernel
66 Requires(post,postun):  /sbin/depmod
67 %if %{with dist_kernel}
68 %requires_releq_kernel_up
69 Requires(postun):       %releq_kernel_up
70 %endif
71
72 %description -n kernel-block-emc
73 This is driver for emc for Linux.
74
75 This package contains Linux module.
76
77 %description -n kernel-block-emc -l pl.UTF-8
78 Sterownik dla Linuksa do emc.
79
80 Ten pakiet zawiera moduł jądra Linuksa.
81
82 %package -n kernel-smp-block-emc
83 Summary:        Linux SMP driver for emc
84 Summary(pl.UTF-8):      Sterownik dla Linuksa SMP do emc
85 Release:        %{_rel}@%{_kernel_ver_str}
86 Group:          Base/Kernel
87 Requires(post,postun):  /sbin/depmod
88 %if %{with dist_kernel}
89 %requires_releq_kernel_smp
90 Requires(postun):       %releq_kernel_smp
91 %endif
92
93 %description -n kernel-smp-block-emc
94 This is driver for emc for Linux.
95
96 This package contains Linux SMP module.
97
98 %description -n kernel-smp-block-emc -l pl.UTF-8
99 Sterownik dla Linuksa do emc.
100
101 Ten pakiet zawiera moduł jądra Linuksa SMP.
102
103 %prep
104 %setup -qcT
105 %ifarch %{ix86}
106 rpm2cpio %{SOURCE0} | cpio -dimu
107 %endif
108 %ifarch %{x8664}
109 rpm2cpio %{SOURCE1} | cpio -dimu
110 %endif
111 mv etc/opt/emcpower/EMCpower.LINUX-%{version}/* .
112 echo 'options emcp managedclass=symm,clariion,hitachi,invista,hpxp,ess,hphsx' >> modprobe.conf.pp
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 %if %{with userspace}
117 install -d $RPM_BUILD_ROOT{/etc/emc/ppme,%{_libdir},%{_sbindir},%{_mandir}/man1,/etc/modprobe.d,%{_datadir}/locale,/etc/rc.d/init.d}
118
119 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
120 cp -a i18n/catalog/* $RPM_BUILD_ROOT%{_datadir}/locale
121 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/PowerPath
122 install bin/lib/* $RPM_BUILD_ROOT%{_libdir}
123 install bin/cmds/* $RPM_BUILD_ROOT%{_sbindir}
124 cp -a bin/.drivers_* $RPM_BUILD_ROOT/etc/emc
125
126 %find_lang EMCpower
127 %find_lang PowerPath
128 cat PowerPath.lang >> EMCpower.lang
129
130 # hardcoded paths. oh sigh
131 install -d $RPM_BUILD_ROOT/etc/opt/emcpower/.tmp
132 ln -s %{_sbindir}/emcpmgr $RPM_BUILD_ROOT/etc/opt/emcpower
133 ln -s %{_sbindir}/powercf $RPM_BUILD_ROOT/etc/opt/emcpower
134 touch $RPM_BUILD_ROOT/etc/opt/emcpower/.__emcp_db_global_lock
135 touch $RPM_BUILD_ROOT/etc/opt/emcpower/.__emcp_db_lock
136
137 install -d $RPM_BUILD_ROOT/opt/emcpower
138 install -d $RPM_BUILD_ROOT/etc/emcpower
139 touch $RPM_BUILD_ROOT/etc/emc/mpaa.{excluded,lams}
140 %endif
141
142 %if %{with kernel}
143 %if %{with up}
144 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block
145 install -D modprobe.conf.pp $RPM_BUILD_ROOT/etc/modprobe.d/%{_kernel_ver}/%{name}.conf
146
147 brand=sles10; type=default
148 %ifarch %{x8664}
149 type=${type}_x8664
150 %endif
151 for a in emcp emcpdm emcpgpx emcpioc emcplib emcpmpx; do
152         install bin/driver/${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block/$a.ko
153 done
154 %endif
155
156 %if %{with smp} && %{with dist_kernel}
157 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block
158 install -D modprobe.conf.pp $RPM_BUILD_ROOT/etc/modprobe.d/%{_kernel_ver}-smp/%{name}.conf
159 brand=sles10; type=smp
160 %ifarch %{x8664}
161 type=${type}_x8664
162 %endif
163 for a in emcp emcpdm emcpgpx emcpioc emcplib emcpmpx; do
164         install bin/driver/${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/$a.ko
165 done
166 %endif
167 %endif
168
169 %clean
170 rm -rf $RPM_BUILD_ROOT
171
172 %post
173 /sbin/chkconfig --add PowerPath
174
175 %preun
176 if [ "$1" = "0" ]; then
177         /sbin/chkconfig --del PowerPath
178 fi
179
180 %post   -n kernel-block-emc
181 %depmod %{_kernel_ver}
182
183 %postun -n kernel-block-emc
184 %depmod %{_kernel_ver}
185
186 %post   -n kernel-smp-block-emc
187 %depmod %{_kernel_ver}-smp
188
189 %postun -n kernel-smp-block-emc
190 %depmod %{_kernel_ver}-smp
191
192 %if %{with kernel}
193 %if %{with up}
194 %files -n kernel-block-emc
195 %defattr(644,root,root,755)
196 /etc/modprobe.d/%{_kernel_ver}/%{name}.conf
197 /lib/modules/%{_kernel_ver}/kernel/drivers/block/*.ko*
198 %endif
199
200 %if %{with smp} && %{with dist_kernel}
201 %files -n kernel-smp-block-emc
202 %defattr(644,root,root,755)
203 /etc/modprobe.d/%{_kernel_ver}-smp/%{name}.conf
204 /lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/*.ko*
205 %endif
206 %endif
207
208 %if %{with userspace}
209 %files -f EMCpower.lang
210 %defattr(644,root,root,755)
211 %dir /etc/emc
212 %dir /etc/emc/ppme
213 /etc/emc/.drivers_*
214 %ghost /etc/emc/mpaa.excluded
215 %ghost /etc/emc/mpaa.lams
216 %attr(754,root,root) /etc/rc.d/init.d/PowerPath
217 %attr(755,root,root) %{_sbindir}/emcpadm
218 %attr(755,root,root) %{_sbindir}/emcpdiscover
219 %attr(755,root,root) %{_sbindir}/emcpmgr
220 %attr(755,root,root) %{_sbindir}/emcppurge
221 %attr(755,root,root) %{_sbindir}/emcpreg
222 %attr(755,root,root) %{_sbindir}/powercf
223 %attr(755,root,root) %{_sbindir}/powermt
224 %attr(755,root,root) %{_sbindir}/powerprotect
225 %attr(755,root,root) %{_sbindir}/powermig
226 %attr(755,root,root) %{_sbindir}/pp_inq
227 %attr(755,root,root) %{_libdir}/libemcp.so
228 %attr(755,root,root) %{_libdir}/libemcp_core.so
229 %attr(755,root,root) %{_libdir}/libemcp_lam.so
230 %attr(755,root,root) %{_libdir}/libemcp_lic_rtl.so
231 %attr(755,root,root) %{_libdir}/libemcp_mp_rtl.so
232 %attr(755,root,root) %{_libdir}/libemcpmp.so
233 %attr(755,root,root) %{_libdir}/libpn.so
234 %{_mandir}/man1/emcpadm.1*
235 %{_mandir}/man1/emcpreg.1*
236 %{_mandir}/man1/emcpupgrade.1*
237 %{_mandir}/man1/powerformat.1*
238 %{_mandir}/man1/powermig.1*
239 %{_mandir}/man1/powermt.1*
240 %{_mandir}/man1/powerprotect.1*
241
242 # hardcoded paths. oh sigh
243 %dir /etc/opt/emcpower
244 /etc/opt/emcpower/emcpmgr
245 /etc/opt/emcpower/powercf
246 %ghost /etc/opt/emcpower/.__emcp_db_global_lock
247 %ghost /etc/opt/emcpower/.__emcp_db_lock
248 %dir /opt/emcpower
249 %dir /etc/emcpower
250 %endif
This page took 0.084776 seconds and 3 git commands to generate.