]> git.pld-linux.org Git - packages/EMCpower.git/blob - EMCpower.spec
- disable kernel build
[packages/EMCpower.git] / EMCpower.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_with     kernel          # don't 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.10
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
48 %description
49 Multi-path software providing fail-over and load-sharing for SCSI
50 disks.
51
52 %description -l pl
53 Oprogramowanie do multi-path z opcj± fail-over i dzieleniem obci±¿enia
54 miêdzy dyski SCSI.
55
56 # kernel subpackages.
57
58 %package -n kernel-block-emc
59 Summary:        Linux driver for emc
60 Summary(pl):    Sterownik dla Linuksa do emc
61 Release:        %{_rel}@%{_kernel_ver_str}
62 Group:          Base/Kernel
63 Requires(post,postun):  /sbin/depmod
64 %if %{with dist_kernel}
65 %requires_releq_kernel_up
66 Requires(postun):       %releq_kernel_up
67 %endif
68
69 %description -n kernel-block-emc
70 This is driver for emc for Linux.
71
72 This package contains Linux module.
73
74 %description -n kernel-block-emc -l pl
75 Sterownik dla Linuksa do emc.
76
77 Ten pakiet zawiera modu³ j±dra Linuksa.
78
79 %package -n kernel-smp-block-emc
80 Summary:        Linux SMP driver for emc
81 Summary(pl):    Sterownik dla Linuksa SMP do emc
82 Release:        %{_rel}@%{_kernel_ver_str}
83 Group:          Base/Kernel
84 Requires(post,postun):  /sbin/depmod
85 %if %{with dist_kernel}
86 %requires_releq_kernel_smp
87 Requires(postun):       %releq_kernel_smp
88 %endif
89
90 %description -n kernel-smp-block-emc
91 This is driver for emc for Linux.
92
93 This package contains Linux SMP module.
94
95 %description -n kernel-smp-block-emc -l pl
96 Sterownik dla Linuksa do emc.
97
98 Ten pakiet zawiera modu³ j±dra Linuksa SMP.
99
100 %prep
101 %setup -qcT
102 %ifarch %{ix86}
103 rpm2cpio %{SOURCE0} | cpio -dimu
104 %endif
105 %ifarch %{x8664}
106 rpm2cpio %{SOURCE1} | cpio -dimu
107 %endif
108 mv etc/opt/emcpower/EMCpower.LINUX-%{version}/* .
109 %patch0 -p1
110
111 ln -s emcplib.Makefile bin/driver/Makefile
112
113 %build
114 cd bin/driver
115
116 %if %{with kernel}
117 # kernel module(s)
118 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
119         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
120                 exit 1
121         fi
122         install -d o/include/linux
123         ln -sf %{_kernelsrcdir}/config-$cfg o/.config
124         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
125         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
126 %if %{with dist_kernel}
127         %{__make} -C %{_kernelsrcdir} O=$PWD/o prepare scripts -j1
128 %else
129         install -d o/include/config
130         touch o/include/config/MARKER
131         ln -sf %{_kernelsrcdir}/scripts o/scripts
132 %endif
133 #
134 #       patching/creating makefile(s) (optional)
135 #
136         %{__make} -C %{_kernelsrcdir} clean \
137                 RCS_FIND_IGNORE="-name '*.ko' -o" \
138                 SYSSRC=%{_kernelsrcdir} \
139                 SYSOUT=$PWD/o \
140                 M=$PWD O=$PWD/o \
141                 %{?with_verbose:V=1}
142         %{__make} -C %{_kernelsrcdir} modules \
143                 CC="%{__cc}" CPP="%{__cpp}" \
144                 SYSSRC=%{_kernelsrcdir} \
145                 SYSOUT=$PWD/o \
146                 M=$PWD O=$PWD/o \
147                 %{?with_verbose:V=1}
148
149         mv emcplib{,-$cfg}.ko
150 done
151 %endif
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155
156 %if %{with userspace}
157 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_libdir},%{_sbindir},%{_mandir}/man1,/etc/modprobe.d,%{_datadir}/locale,/etc/rc.d/init.d}
158
159 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
160 install modprobe.conf.pp $RPM_BUILD_ROOT/etc/modprobe.d/%{name}.conf
161 cp -a i18n/catalog/* $RPM_BUILD_ROOT%{_datadir}/locale
162 install PowerPath.rhel $RPM_BUILD_ROOT/etc/rc.d/init.d/powerpath
163 install bin/lib/* $RPM_BUILD_ROOT%{_libdir}
164 install bin/cmds/* $RPM_BUILD_ROOT%{_sbindir}
165 cp -a bin/.drivers_ext $RPM_BUILD_ROOT%{_sysconfdir}/drivers_ext
166
167 %find_lang EMCpower
168 %find_lang PowerPath
169 cat PowerPath.lang >> EMCpower.lang
170 %endif
171
172 %if %{with kernel}
173 cd bin/driver
174 %if %{with up}
175 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block
176 install emcplib-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
177         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block/emcplib.ko
178
179 brand=sles; type=default
180 %ifarch %{x8664}
181 type=${type}_x8664
182 %endif
183 for a in emcplib emcp emcphr emcpioc emcpmp emcpmpaa emcpmpap emcpmpc; do
184         install ${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/block/$a.ko
185 done
186 %endif
187
188 %if %{with smp} && %{with dist_kernel}
189 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block
190 install emcplib-smp.ko \
191         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/emcplib.ko
192
193 brand=sles; type=smp
194 %ifarch %{x8664}
195 type=${type}_x8664
196 %endif
197  for a in emcplib emcp emcphr emcpioc emcpmp emcpmpaa emcpmpap emcpmpc; do
198         install ${a}_$brand$type $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/$a.ko
199 done
200 %endif
201 %endif
202
203 %clean
204 rm -rf $RPM_BUILD_ROOT
205
206 %post   -n kernel-block-emc
207 %depmod %{_kernel_ver}
208
209 %postun -n kernel-block-emc
210 %depmod %{_kernel_ver}
211
212 %post   -n kernel-smp-block-emc
213 %depmod %{_kernel_ver}-smp
214
215 %postun -n kernel-smp-block-emc
216 %depmod %{_kernel_ver}-smp
217
218 %if %{with kernel}
219 %if %{with up}
220 %files -n kernel-block-emc
221 %defattr(644,root,root,755)
222 /lib/modules/%{_kernel_ver}/kernel/drivers/block/*.ko*
223 %endif
224
225 %if %{with smp} && %{with dist_kernel}
226 %files -n kernel-smp-block-emc
227 %defattr(644,root,root,755)
228 /lib/modules/%{_kernel_ver}-smp/kernel/drivers/block/*.ko*
229 %endif
230 %endif
231
232 %if %{with userspace}
233 %files -f EMCpower.lang
234 %defattr(644,root,root,755)
235 %dir %{_sysconfdir}
236 %{_sysconfdir}/drivers_ext
237 /etc/modprobe.d/EMCpower.conf
238 %attr(754,root,root) /etc/rc.d/init.d/powerpath
239 %attr(755,root,root) %{_sbindir}/emcpadm
240 %attr(755,root,root) %{_sbindir}/emcpdiscover
241 %attr(755,root,root) %{_sbindir}/emcpmgr
242 %attr(755,root,root) %{_sbindir}/emcppurge
243 %attr(755,root,root) %{_sbindir}/emcpreg
244 %attr(755,root,root) %{_sbindir}/powercf
245 %attr(755,root,root) %{_sbindir}/powermt
246 %attr(755,root,root) %{_sbindir}/powerprotect
247 %attr(755,root,root) %{_libdir}/libemcp.so
248 %attr(755,root,root) %{_libdir}/libemcp_core.so
249 %attr(755,root,root) %{_libdir}/libemcp_lam.so
250 %attr(755,root,root) %{_libdir}/libemcp_lic_rtl.so
251 %attr(755,root,root) %{_libdir}/libemcp_mp_rtl.so
252 %attr(755,root,root) %{_libdir}/libemcpmp.so
253 %attr(755,root,root) %{_libdir}/libpn.so
254 %{_mandir}/man1/emcpadm.1*
255 %{_mandir}/man1/emcpreg.1*
256 %{_mandir}/man1/emcpupgrade.1*
257 %{_mandir}/man1/powermig.1*
258 %{_mandir}/man1/powermt.1*
259 %{_mandir}/man1/powerprotect.1*
260 %endif
This page took 0.084323 seconds and 4 git commands to generate.