2 # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted)
5 %bcond_without initrd # don't build initrd version
6 %bcond_with uClibc # link initrd version with uClibc
7 %bcond_without dietlibc # link initrd version with dietlibc
8 %bcond_with glibc # link initrd version with static GLIBC
9 %bcond_without clvmd # don't build clvmd
10 %bcond_with clvmd3 # build clvmd for 3rd generation of cluster
11 %bcond_without selinux # disable SELinux
17 # if one of the *libc is enabled disable default dietlibc
18 %if %{with dietlibc} && %{with uClibc}
19 %undefine with_dietlibc
22 # with glibc disables default dietlibc
23 %if %{with glibc} && %{with dietlibc}
24 %undefine with_dietlibc
27 # fallback is glibc if neither alternatives are enabled
28 %if %{without dietlibc} && %{without uClibc}
36 Summary: The new version of Logical Volume Manager for Linux
37 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
42 Group: Applications/System
43 Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
44 # Source0-md5: 30ef29785b0e8cfbc106b5203c08d0e7
45 Source1: %{name}-initramfs-hook
46 Source2: %{name}-initramfs-local-top
47 Patch0: %{name}-selinux.patch
48 Patch1: %{name}-diet.patch
49 Patch2: device-mapper-dmsetup-export.patch
50 Patch3: %{name}-clvmd_init.patch
51 Patch4: dl-dlsym.patch
52 Patch5: %{name}-no-floor.patch
53 URL: http://sources.redhat.com/lvm2/
54 BuildRequires: autoconf
55 BuildRequires: automake
56 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
57 %{?with_selinux:BuildRequires: libsepol-devel}
58 BuildRequires: pkgconfig
59 BuildRequires: rpmbuild(macros) >= 1.213
62 BuildRequires: dietlibc-static >= 2:0.31-5
63 BuildConflicts: device-mapper-dietlibc
66 %{?with_selinux:BuildRequires: libselinux-static}
67 %{?with_selinux:BuildRequires: libsepol-static}
69 %{?with_glibc:BuildRequires: glibc-static}
70 %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29}
73 BuildRequires: cman-devel >= 1.0
74 BuildRequires: dlm-devel >= 1.0-0.pre21.2
77 BuildRequires: cluster-cman-devel
78 BuildRequires: cluster-dlm-devel
80 BuildRequires: ncurses-devel
81 BuildRequires: readline-devel
82 Requires: device-mapper >= %{version}-%{release}
84 Requires: cman-libs >= 1.0
85 Requires: dlm >= 1.0-0.pre21.2
88 Requires: cluster-cman-libs
91 %{?with_selinux:Requires: libselinux >= 1.10}
92 # doesn't work with 2.4 kernels
93 Requires: uname(release) >= 2.6
95 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97 %define _sbindir /sbin
98 %define _usrsbindir /usr/sbin
100 # changing CFLAGS in the middle confuses confcache
101 %undefine configure_cache
104 %define filterout_ld -Wl,--as-needed
106 # for some reason known only to rpm there must be "\\|" not "\|" here
107 %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
108 %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
111 This package includes a number of utilities for creating, checking,
112 and repairing logical volumes.
114 %description -l pl.UTF-8
115 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
116 logicznych wolumenów dyskowych (LVM2).
119 Summary: The new version of Logical Volume Manager for Linux - initrd version
120 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
122 Conflicts: geninitrd < 10000.18
125 This package includes a number of utilities for creating, checking,
126 and repairing logical volumes - staticaly linked for initrd.
128 %description initrd -l pl.UTF-8
129 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
130 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
133 %package -n device-mapper
134 Summary: Userspace support for the device-mapper
135 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
138 %description -n device-mapper
139 The goal of this driver is to support volume management. The driver
140 enables the definition of new block devices composed of ranges of
141 sectors of existing devices. This can be used to define disk
142 partitions - or logical volumes. This light-weight kernel component
143 can support user-space tools for logical volume management.
145 %description -n device-mapper -l pl.UTF-8
146 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
147 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
148 sektorów na istniejących urządzeniach. Może to być wykorzystane do
149 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
150 składnik jądra może wspierać działające w przestrzeni użytkownika
151 narzędzia do zarządzania logicznymi wolumenami.
153 %package -n device-mapper-devel
154 Summary: Header files and development documentation for %{name}
155 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
156 Group: Development/Libraries
157 Requires: device-mapper = %{version}-%{release}
159 Requires: libselinux-devel
160 Requires: libsepol-devel
163 %description -n device-mapper-devel
164 Header files and development documentation for %{name}.
166 %description -n device-mapper-devel -l pl.UTF-8
167 Pliki nagłówkowe i dokumentacja do %{name}.
169 %package -n device-mapper-static
170 Summary: Static devmapper library
171 Summary(pl.UTF-8): Statyczna biblioteka devmapper
173 Group: Development/Libraries
174 Requires: device-mapper-devel = %{version}-%{release}
176 %description -n device-mapper-static
177 Static devmapper library.
179 %description -n device-mapper-static -l pl.UTF-8
180 Statyczna biblioteka devmapper.
182 %package -n device-mapper-dietlibc
183 Summary: Static devmapper library built with dietlibc
184 Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc
186 Group: Development/Libraries
187 Requires: device-mapper-devel = %{version}-%{release}
189 %description -n device-mapper-dietlibc
190 Static devmapper library built with dietlibc.
192 %description -n device-mapper-dietlibc -l pl.UTF-8
193 Statyczna biblioteka devmapper zbudowana z dietlibc.
195 %package -n device-mapper-initrd
196 Summary: Userspace support for the device-mapper - initrd version
197 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
199 Obsoletes: device-mapper-initrd-devel
200 Conflicts: geninitrd < 10000.10
202 %description -n device-mapper-initrd
203 The goal of this driver is to support volume management. The driver
204 enables the definition of new block devices composed of ranges of
205 sectors of existing devices. This can be used to define disk
206 partitions - or logical volumes. This light-weight kernel component
207 can support user-space tools for logical volume management.
209 This package contains dmsetup program linked staticaly for use in
212 %description -n device-mapper-initrd -l pl.UTF-8
213 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
214 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
215 sektorów na istniejących urządzeniach. Może to być wykorzystane do
216 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
217 składnik jądra może wspierać działające w przestrzeni użytkownika
218 narzędzia do zarządzania logicznymi wolumenami.
220 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
224 Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools
225 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools
227 Requires: %{name} = %{version}-%{release}
228 Requires: initramfs-tools
230 %description initramfs
231 The new version of Logical Volume Manager for Linux - support scripts
234 %description initramfs -l pl.UTF-8
235 Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla
239 %setup -q -n LVM2.%{version}
240 %{?with_selinux:%patch0 -p1}
249 echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd
251 cp -f /usr/share/automake/config.sub autoconf
258 %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
259 %{?with_dietlibc:CC="diet ${CC#*ccache }"} \
260 ac_cv_lib_dl_dlopen=no \
261 %{?debug:--enable-debug} \
262 --with-optimisation="%{rpmcflags} -Os" \
263 --enable-static_link \
264 --with-lvm1=internal \
266 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
269 # glibc version links with normal static libdevicemapper which has selinux enabled
270 # and we need to keep these in sync between device-mapper and lvm2
272 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
273 %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h
275 %{__make} -j1 -C include
276 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
277 %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
278 %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"}
279 mv -f tools/lvm.static initrd-lvm
280 mv -f tools/dmsetup.static initrd-dmsetup
281 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
286 --with-usrlibdir=%{_libdir} \
287 %{?debug:--enable-debug} \
288 --with-optimisation="%{rpmcflags}" \
294 %{?with_clvmd:--with-clvmd=cman} \
295 --with-lvm1=internal \
296 --with-pool=internal \
297 --with-cluster=internal \
298 --with-snapshots=internal \
299 --with-mirrors=internal \
300 --with-interface=ioctl \
301 %{!?with_selinux:--disable-selinux}
303 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
306 rm -rf $RPM_BUILD_ROOT
307 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
308 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
309 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
312 DESTDIR=$RPM_BUILD_ROOT \
316 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
317 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
318 lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
319 slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
320 ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
323 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
326 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
327 install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
328 install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
330 %{?with_dietlibc:cp -a diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
333 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
334 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
336 cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
339 rm -rf $RPM_BUILD_ROOT
341 %post -n device-mapper -p /sbin/ldconfig
342 %postun -n device-mapper -p /sbin/ldconfig
345 %defattr(644,root,root,755)
346 %doc README WHATS_NEW doc/*
347 %attr(755,root,root) %{_sbindir}/fsadm
348 %attr(755,root,root) %{_sbindir}/lv*
349 %attr(755,root,root) %{_sbindir}/pv*
350 %attr(755,root,root) %{_sbindir}/vg*
351 %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
352 %{_mandir}/man5/lvm.conf.5*
353 %{?with_clvmd:%{_mandir}/man8/clvmd.8*}
354 %{_mandir}/man8/fsadm.8*
355 %{_mandir}/man8/lv*.8*
356 %{_mandir}/man8/pv*.8*
357 %{_mandir}/man8/vg*.8*
358 %attr(750,root,root) %dir %{_sysconfdir}/lvm
359 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
361 %files -n device-mapper
362 %defattr(644,root,root,755)
364 %attr(755,root,root) %{_sbindir}/dmeventd
365 %attr(755,root,root) %{_sbindir}/dmsetup
366 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
367 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
368 %dir %{_libdir}/device-mapper
369 %attr(755,root,root) %{_libdir}/device-mapper/*.so
370 %{_mandir}/man8/dmsetup.8*
371 %{_mandir}/man8/dmeventd.8*
373 %files -n device-mapper-devel
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_libdir}/libdevmapper*.so
376 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
377 %{_includedir}/libdevmapper*.h
378 %{_includedir}/lvm2cmd.h
379 %{_pkgconfigdir}/devmapper*.pc
381 %files -n device-mapper-static
382 %defattr(644,root,root,755)
383 %{_libdir}/libdevmapper*.a
387 %files -n device-mapper-dietlibc
388 %defattr(644,root,root,755)
389 %{dietlibdir}/libdevmapper.a
392 %files -n device-mapper-initrd
393 %defattr(644,root,root,755)
394 %attr(755,root,root) %{_libdir}/initrd/dmsetup
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_libdir}/initrd/lvm
402 %defattr(644,root,root,755)
403 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
404 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2