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 %ifarch %{x8664} ppc ppc64 alpha
18 # missing implementation for floor from -lm
19 %undefine with_dietlibc
22 # if one of the *libc is enabled disable default dietlibc
23 %if %{with dietlibc} && %{with uClibc}
24 %undefine with_dietlibc
27 # with glibc disables default dietlibc
28 %if %{with glibc} && %{with dietlibc}
29 %undefine with_dietlibc
32 # fallback is glibc if neither alternatives are enabled
33 %if %{without dietlibc} && %{without uClibc}
41 Summary: The new version of Logical Volume Manager for Linux
42 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
47 Group: Applications/System
48 Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
49 # Source0-md5: a7d0d1235a589869bd13cde0f0d7375d
50 Source1: %{name}-initramfs-hook
51 Source2: %{name}-initramfs-local-top
52 Patch0: %{name}-selinux.patch
53 Patch1: %{name}-diet.patch
54 Patch2: device-mapper-dmsetup-export.patch
55 Patch3: %{name}-clvmd_init.patch
56 Patch4: dl-dlsym.patch
57 URL: http://sources.redhat.com/lvm2/
58 BuildRequires: autoconf
59 BuildRequires: automake
60 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
61 %{?with_selinux:BuildRequires: libsepol-devel}
62 BuildRequires: pkgconfig
63 BuildRequires: rpmbuild(macros) >= 1.213
66 BuildRequires: dietlibc-static >= 2:0.31-5
67 BuildConflicts: device-mapper-dietlibc
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}
248 echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd
250 cp -f /usr/share/automake/config.sub autoconf
257 %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
258 %{?with_dietlibc:CC="diet ${CC#*ccache }"} \
259 ac_cv_lib_dl_dlopen=no \
260 %{?debug:--enable-debug} \
261 --with-optimisation="%{rpmcflags} -Os" \
262 --enable-static_link \
263 --with-lvm1=internal \
264 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
267 # glibc version links with normal static libdevicemapper which has selinux enabled
268 # and we need to keep these in sync between device-mapper and lvm2
270 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
271 %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h
273 %{__make} -j1 -C include
274 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
275 %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
276 %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"}
277 mv -f tools/lvm.static initrd-lvm
278 mv -f tools/dmsetup.static initrd-dmsetup
279 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
284 --with-usrlibdir=%{_libdir} \
285 %{?debug:--enable-debug} \
286 --with-optimisation="%{rpmcflags}" \
292 %{?with_clvmd:--with-clvmd=cman} \
293 --with-lvm1=internal \
294 --with-pool=internal \
295 --with-cluster=internal \
296 --with-snapshots=internal \
297 --with-mirrors=internal \
298 --with-interface=ioctl \
299 %{!?with_selinux:--disable-selinux}
301 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
304 rm -rf $RPM_BUILD_ROOT
305 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
306 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
307 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
310 DESTDIR=$RPM_BUILD_ROOT \
314 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
315 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
316 lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
317 slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
318 ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
321 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
324 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
325 install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
326 install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
328 %{?with_dietlibc:cp -a diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
331 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
332 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
334 cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
337 rm -rf $RPM_BUILD_ROOT
339 %post -n device-mapper -p /sbin/ldconfig
340 %postun -n device-mapper -p /sbin/ldconfig
343 %defattr(644,root,root,755)
344 %doc README WHATS_NEW doc/*
345 %attr(755,root,root) %{_sbindir}/fsadm
346 %attr(755,root,root) %{_sbindir}/lv*
347 %attr(755,root,root) %{_sbindir}/pv*
348 %attr(755,root,root) %{_sbindir}/vg*
349 %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
350 %{_mandir}/man5/lvm.conf.5*
351 %{?with_clvmd:%{_mandir}/man8/clvmd.8*}
352 %{_mandir}/man8/fsadm.8*
353 %{_mandir}/man8/lv*.8*
354 %{_mandir}/man8/pv*.8*
355 %{_mandir}/man8/vg*.8*
356 %attr(750,root,root) %dir %{_sysconfdir}/lvm
357 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
359 %files -n device-mapper
360 %defattr(644,root,root,755)
362 %attr(755,root,root) %{_sbindir}/dmeventd
363 %attr(755,root,root) %{_sbindir}/dmsetup
364 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
365 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
366 %dir %{_libdir}/device-mapper
367 %attr(755,root,root) %{_libdir}/device-mapper/*.so
368 %{_mandir}/man8/dmsetup.8*
369 %{_mandir}/man8/dmeventd.8*
371 %files -n device-mapper-devel
372 %defattr(644,root,root,755)
373 %attr(755,root,root) %{_libdir}/libdevmapper*.so
374 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
375 %{_includedir}/libdevmapper*.h
376 %{_includedir}/lvm2cmd.h
377 %{_pkgconfigdir}/devmapper*.pc
379 %files -n device-mapper-static
380 %defattr(644,root,root,755)
381 %{_libdir}/libdevmapper*.a
385 %files -n device-mapper-dietlibc
386 %defattr(644,root,root,755)
387 %{dietlibdir}/libdevmapper.a
390 %files -n device-mapper-initrd
391 %defattr(644,root,root,755)
392 %attr(755,root,root) %{_libdir}/initrd/dmsetup
395 %defattr(644,root,root,755)
396 %attr(755,root,root) %{_libdir}/initrd/lvm
400 %defattr(644,root,root,755)
401 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
402 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2