]> git.pld-linux.org Git - packages/multipath-tools.git/blob - multipath-tools.spec
1108a2fda8c1f30df465da70854b52ab8570c78f
[packages/multipath-tools.git] / multipath-tools.spec
1 #
2 # Conditional build:
3 %bcond_with     initrd          # build initrd version (very broken)
4
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
7 Name:           multipath-tools
8 Version:        0.5.0
9 Release:        2
10 License:        GPL v2
11 Group:          Base
12 Source0:        http://christophe.varoqui.free.fr/multipath-tools/%{name}-%{version}.tar.bz2
13 # Source0-md5:  faf261d4cc717bf4c979557dc7bf5f52
14 Source100:      branch.sh
15 Source1:        multipathd.init
16 Source2:        multipathd.sysconfig
17 Source3:        %{name}-bindings
18 Patch0:         %{name}-format.patch
19 Patch1:         %{name}-kpartx-udev.patch
20 Patch2:         config.patch
21 URL:            http://christophe.varoqui.free.fr/
22 BuildRequires:  device-mapper-devel >= 1.02.08
23 BuildRequires:  libaio-devel
24 BuildRequires:  linux-libc-headers >= 2.6.12.0-5
25 BuildRequires:  readline-devel
26 BuildRequires:  rpmbuild(macros) >= 1.647
27 BuildRequires:  sed >= 4.0
28 BuildRequires:  sysfsutils-devel >= 2.0.0
29 BuildRequires:  systemd-devel
30 BuildRequires:  udev-devel
31 %if %{with initrd}
32 BuildRequires:  device-mapper-initrd-devel
33 BuildRequires:  klibc-static
34 %endif
35 Requires(post,preun):   /sbin/chkconfig
36 Requires(post,preun,postun):    systemd-units >= 38
37 Requires:       device-mapper >= 1.02.08
38 Requires:       kpartx = %{version}-%{release}
39 Requires:       libaio >= 0.3.106-2
40 Requires:       rc-scripts
41 Requires:       systemd-units >= 38
42 %if "%{pld_release}" == "th"
43 Requires:       udev-core >= 1:127
44 %endif
45 %if "%{pld_release}" == "ti"
46 Conflicts:      udev < 1:124-3
47 %endif
48 %if "%{pld_release}" == "ac"
49 Requires:       udev-core >= 1:079-10
50 %endif
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %define         skip_post_check_so      libmultipath.so.0 libmpathpersist.so.0
54 %define         _sbindir        /sbin
55
56 %description
57 multipath-tools provides the tools to manage multipathed devices by
58 instructing the device-mapper multipath module what to do. The tools
59 are:
60 - multipath: scan the system for multipathed devices, assembles them
61   and update the device-mapper's maps
62 - multipathd: wait for maps events, then execs multipath
63 - devmap-name: provides a meaningful device name to udev for devmaps
64
65 %description -l pl.UTF-8
66 multipath-tools zawierają narzędzia do zarządzania wielotrasowym
67 dostępem do urządzeń poprzez instruowanie modułu multipath
68 device-mappera. Narzędzia to:
69 - multipath - przeszukuje system pod kątem urządzeń z dostępem
70   wielotrasowym, łączy je i uaktualnia odwzorowania device-mappera
71 - multipathd - oczekuje na zdarzenia odwzorowań, po których uruchamia
72   multipath
73 - devmap-name - dostarcza do udev znaczącą nazwę urządzenia dla map
74   urządzeń
75
76 %package -n kpartx
77 Summary:        Partition device manager for device-mapper devices
78 Summary(pl.UTF-8):      Zarządca urządzeń partycji dla urządzeń device-mappera
79 Group:          Base
80 %if "%{pld_release}" == "th"
81 Conflicts:      udev-core < 1:127
82 %endif
83 %if "%{pld_release}" == "ti"
84 Conflicts:      udev-core < 1:124-3
85 %endif
86 %if "%{pld_release}" == "ac"
87 Conflicts:      udev-core < 1:079-10
88 %endif
89
90 %description -n kpartx
91 kpartx maps linear devmaps upon device partitions, which makes
92 multipath maps partionable.
93
94 %description -n kpartx -l pl.UTF-8
95 kpartx odwzorowuje liniowe mapy urządzeń na partycje urządzeń, co
96 umożliwia tworzenie partycji na odwzorowaniach wielotrasowych.
97
98 %prep
99 %setup -q
100 %patch0 -p1
101 %patch1 -p1
102 %patch2 -p1
103
104 %build
105 %if %{with initrd}
106 %{__make} -j1 \
107         BUILD=klibc \
108         CC="klcc -static" \
109         OPTFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -Wunused -Wstrict-prototypes" \
110         BUILDDIRS='multipath pathx' \
111         klibcdir=%{_libdir}/klibc \
112         libdm='$(klibcdir)/libdevmapper.a'
113
114 %{__make} clean
115 %endif
116
117 %{__make} -j1 \
118         LIB=%{_lib} \
119         OPTFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -Wunused -Wstrict-prototypes %{?debug:-DDEBUG=1}" \
120         CC="%{__cc}"
121
122 %install
123 rm -rf $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_sysconfdir}/multipath}
125
126 %{__make} install \
127         DESTDIR=$RPM_BUILD_ROOT \
128         LIB=%{_lib} \
129         unitdir=%{systemdunitdir}
130
131 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/multipathd
132 cp -p multipath.conf.defaults $RPM_BUILD_ROOT%{_sysconfdir}/multipath.conf
133 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/multipathd
134 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/multipath/bindings
135
136 # no -devel, so remove
137 %{__rm} $RPM_BUILD_ROOT%{_includedir}/mpath_persist.h
138 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/mpath_persistent_reserve_in.3*
139 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/mpath_persistent_reserve_out.3*
140 %{__rm} $RPM_BUILD_ROOT/%{_lib}/libmpathpersist.so
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %post
146 /sbin/chkconfig --add multipathd
147 %service multipathd restart
148 %systemd_post multipathd.service
149
150 %preun
151 if [ "$1" = "0" ]; then
152         %service multipathd stop
153         /sbin/chkconfig --del multipathd
154 fi
155 %systemd_preun multipathd.service
156
157 %postun
158 %systemd_reload
159
160 %triggerpostun -- %{name} < 0.4.9-7
161 %systemd_trigger multipathd.service
162
163 %files
164 %defattr(644,root,root,755)
165 %doc AUTHOR ChangeLog FAQ README TODO
166 %doc multipath.conf.{annotated,defaults,synthetic}
167 %attr(755,root,root) %{_sbindir}/mpathpersist
168 %attr(755,root,root) %{_sbindir}/multipath
169 %attr(755,root,root) %{_sbindir}/multipathd
170 %dir /%{_lib}/multipath
171 %attr(755,root,root) /%{_lib}/multipath/lib*.so
172 %attr(755,root,root) /%{_lib}/libmpathpersist.so.0
173 %attr(755,root,root) /%{_lib}/libmultipath.so.0
174 %attr(754,root,root) /etc/rc.d/init.d/multipathd
175 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/multipathd
176 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multipath.conf
177 %dir %{_sysconfdir}/multipath
178 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multipath/bindings
179 %{systemdunitdir}/multipathd.service
180 %{systemdunitdir}/multipathd.socket
181 %{_mandir}/man5/multipath.conf.5*
182 %{_mandir}/man8/mpathpersist.8*
183 %{_mandir}/man8/multipath.8*
184 %{_mandir}/man8/multipathd.8*
185
186 %files -n kpartx
187 %defattr(644,root,root,755)
188 %doc kpartx/README
189 %attr(755,root,root) %{_sbindir}/kpartx
190 %attr(755,root,root) /lib/udev/kpartx_id
191 /etc/udev/rules.d/kpartx.rules
192 %{_mandir}/man8/kpartx.8*
This page took 0.080917 seconds and 2 git commands to generate.