3 %bcond_with initrd # build initrd version (very broken)
5 Summary: Tools to manage multipathed devices with the device-mapper
6 Summary(pl.UTF-8): Implementacja wielotrasowego dostępu do zasobów przy użyciu device-mappera
13 # http://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=%{gitref};sf=tgz
14 Source0: http://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=%{version};sf=tgz;fakeout=/%{name}-%{version}.tar.gz
15 # Source0-md5: 034a3dfa9687df08bc12043c3833c017
17 Source1: multipathd.init
18 Source2: multipathd.sysconfig
19 Source3: %{name}-bindings
20 # http://git.opensvc.com/?p=multipath-tools/.git;a=blob_plain;f=multipath.conf.defaults;hb=d569988e7528cf3484b6acae19dc093de41a2488
21 Source4: multipath.conf.defaults
22 Patch0: %{name}-paths.patch
23 Patch1: %{name}-kpartx-udev.patch
25 Patch3: %{name}-json-c.patch
26 URL: http://christophe.varoqui.free.fr/
27 BuildRequires: device-mapper-devel >= 1.02.08
28 BuildRequires: json-c-devel
29 BuildRequires: libaio-devel
30 BuildRequires: linux-libc-headers >= 2.6.12.0-5
31 BuildRequires: pkgconfig
32 BuildRequires: readline-devel
33 BuildRequires: rpmbuild(macros) >= 1.647
34 BuildRequires: sed >= 4.0
35 BuildRequires: systemd-devel >= 1:209
36 BuildRequires: udev-devel
37 BuildRequires: userspace-rcu-devel
39 BuildRequires: device-mapper-initrd-devel
40 BuildRequires: klibc-static
42 Requires(post,preun): /sbin/chkconfig
43 Requires(post,preun,postun): systemd-units >= 38
44 Requires: %{name}-libs = %{version}-%{release}
45 Requires: device-mapper >= 1.02.08
46 Requires: kpartx = %{version}-%{release}
47 Requires: libaio >= 0.3.106-2
49 Requires: systemd-units >= 38
50 %if "%{pld_release}" == "th"
51 Requires: udev-core >= 1:127
53 %if "%{pld_release}" == "ac"
54 Requires: udev-core >= 1:079-10
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %define skip_post_check_so libmultipath.so.0 libmpathpersist.so.0
59 %define _sbindir /sbin
62 multipath-tools provides the tools to manage multipathed devices by
63 instructing the device-mapper multipath module what to do. The tools
65 - multipath: scan the system for multipathed devices, assembles them
66 and update the device-mapper's maps
67 - multipathd: wait for maps events, then execs multipath
68 - devmap-name: provides a meaningful device name to udev for devmaps
70 %description -l pl.UTF-8
71 multipath-tools zawierają narzędzia do zarządzania wielotrasowym
72 dostępem do urządzeń poprzez instruowanie modułu multipath
73 device-mappera. Narzędzia to:
74 - multipath - przeszukuje system pod kątem urządzeń z dostępem
75 wielotrasowym, łączy je i uaktualnia odwzorowania device-mappera
76 - multipathd - oczekuje na zdarzenia odwzorowań, po których uruchamia
78 - devmap-name - dostarcza do udev znaczącą nazwę urządzenia dla map
82 Summary: Shared libraries for multipath-tools
83 Summary(pl.UTF-8): Biblioteki współdzielone multipath-tools
85 Requires: device-mapper-libs >= 1.02.08
88 Shared libraries for multipath-tools.
90 %description libs -l pl.UTF-8
91 Biblioteki współdzielone multipath-tools.
94 Summary: Header files for multipath-tools libraries
95 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek multipath-tools
96 Group: Development/Libraries
97 Requires: %{name}-libs = %{version}-%{release}
100 Header files for multipath-tools libraries.
102 %description devel -l pl.UTF-8
103 Pliki nagłówkowe bibliotek multipath-tools.
106 Summary: Partition device manager for device-mapper devices
107 Summary(pl.UTF-8): Zarządca urządzeń partycji dla urządzeń device-mappera
109 Requires: device-mapper-libs >= 1.02.08
110 %if "%{pld_release}" == "th"
111 Conflicts: udev-core < 1:127
113 %if "%{pld_release}" == "ac"
114 Conflicts: udev-core < 1:079-10
117 %description -n kpartx
118 kpartx maps linear devmaps upon device partitions, which makes
119 multipath maps partionable.
121 %description -n kpartx -l pl.UTF-8
122 kpartx odwzorowuje liniowe mapy urządzeń na partycje urządzeń, co
123 umożliwia tworzenie partycji na odwzorowaniach wielotrasowych.
126 %setup -q -n %{name}-%{version}-%{gitref}
138 OPTFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -Wunused -Wstrict-prototypes" \
139 BUILDDIRS='multipath pathx' \
140 klibcdir=%{_libdir}/klibc \
141 libdm='$(klibcdir)/libdevmapper.a'
148 OPTFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -Wunused -Wstrict-prototypes %{?debug:-DDEBUG=1}" \
152 rm -rf $RPM_BUILD_ROOT
153 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_sysconfdir}/multipath,/%{_lib}/multipath}
156 DESTDIR=$RPM_BUILD_ROOT \
158 libudevdir=/lib/udev \
159 unitdir=%{systemdunitdir} \
160 usr_prefix=%{_prefix}
162 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/multipathd
163 cp -p multipath.conf.defaults $RPM_BUILD_ROOT%{_sysconfdir}/multipath.conf
164 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/multipathd
165 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/multipath/bindings
167 # devel files in /usr
168 install -d $RPM_BUILD_ROOT%{_libdir}
169 %{__rm} $RPM_BUILD_ROOT/%{_lib}/{libmpathcmd,libmpathpersist,libmultipath}.so
170 ln -sf /%{_lib}/libmpathpersist.so.0 $RPM_BUILD_ROOT%{_libdir}/libmpathpersist.so
171 ln -sf /%{_lib}/libmpathcmd.so.0 $RPM_BUILD_ROOT%{_libdir}/libmpathcmd.so
172 ln -sf /%{_lib}/libmultipath.so.0 $RPM_BUILD_ROOT%{_libdir}/libmultipath.so
175 rm -rf $RPM_BUILD_ROOT
178 /sbin/chkconfig --add multipathd
179 %service multipathd restart
180 %systemd_post multipathd.service
183 if [ "$1" = "0" ]; then
184 %service multipathd stop
185 /sbin/chkconfig --del multipathd
187 %systemd_preun multipathd.service
192 %triggerpostun -- %{name} < 0.4.9-7
193 %systemd_trigger multipathd.service
195 %post libs -p /sbin/ldconfig
196 %postun libs -p /sbin/ldconfig
199 %defattr(644,root,root,755)
200 %doc README README.alua multipath.conf.defaults
201 %attr(755,root,root) %{_sbindir}/mpathpersist
202 %attr(755,root,root) %{_sbindir}/multipath
203 %attr(755,root,root) %{_sbindir}/multipathd
204 %dir /%{_lib}/multipath
205 %attr(755,root,root) /%{_lib}/multipath/lib*.so
206 %attr(754,root,root) /etc/rc.d/init.d/multipathd
207 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/multipathd
208 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multipath.conf
209 %dir %{_sysconfdir}/multipath
210 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multipath/bindings
211 /lib/udev/rules.d/11-dm-mpath.rules
212 /lib/udev/rules.d/11-dm-parts.rules
213 /lib/udev/rules.d/56-multipath.rules
214 %{systemdunitdir}/multipathd.service
215 %{systemdunitdir}/multipathd.socket
216 %{_mandir}/man5/multipath.conf.5*
217 %{_mandir}/man8/mpathpersist.8*
218 %{_mandir}/man8/multipath.8*
219 %{_mandir}/man8/multipathd.8*
222 %defattr(644,root,root,755)
223 %attr(755,root,root) /%{_lib}/libmpathcmd.so.0
224 %attr(755,root,root) /%{_lib}/libmpathpersist.so.0
225 %attr(755,root,root) /%{_lib}/libmultipath.so.0
226 %attr(755,root,root) %{_libdir}/libdmmp.so.0.2.0
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_libdir}/libdmmp.so
231 %attr(755,root,root) %{_libdir}/libmpathcmd.so
232 %attr(755,root,root) %{_libdir}/libmpathpersist.so
233 %attr(755,root,root) %{_libdir}/libmultipath.so
234 %{_includedir}/libdmmp
235 %{_includedir}/mpath_cmd.h
236 %{_includedir}/mpath_persist.h
237 %{_pkgconfigdir}/libdmmp.pc
238 %{_mandir}/man3/dmmp_*.3*
239 %{_mandir}/man3/libdmmp.h.3*
240 %{_mandir}/man3/mpath_persistent_reserve_in.3*
241 %{_mandir}/man3/mpath_persistent_reserve_out.3*
244 %defattr(644,root,root,755)
245 %attr(755,root,root) %{_sbindir}/kpartx
246 %attr(755,root,root) /lib/udev/kpartx_id
247 /lib/udev/rules.d/66-kpartx.rules
248 /lib/udev/rules.d/68-del-part-nodes.rules
249 %{_mandir}/man8/kpartx.8*