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: 0359eef82a9d9551489f8a104ef22a69
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 URL: http://sources.redhat.com/lvm2/
53 BuildRequires: autoconf
54 BuildRequires: automake
55 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
56 %{?with_selinux:BuildRequires: libsepol-devel}
57 BuildRequires: pkgconfig
58 BuildRequires: rpmbuild(macros) >= 1.213
61 BuildRequires: dietlibc-static >= 2:0.32-7
62 BuildConflicts: device-mapper-dietlibc
65 %{?with_selinux:BuildRequires: libselinux-static}
66 %{?with_selinux:BuildRequires: libsepol-static}
68 %{?with_glibc:BuildRequires: glibc-static}
69 %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29}
72 BuildRequires: cman-devel >= 1.0
73 BuildRequires: dlm-devel >= 1.0-0.pre21.2
76 BuildRequires: cluster-cman-devel
77 BuildRequires: cluster-dlm-devel
79 BuildRequires: ncurses-devel
80 BuildRequires: readline-devel
81 Requires: device-mapper >= %{version}-%{release}
83 Requires: cman-libs >= 1.0
84 Requires: dlm >= 1.0-0.pre21.2
87 Requires: cluster-cman-libs
90 %{?with_selinux:Requires: libselinux >= 1.10}
91 # doesn't work with 2.4 kernels
92 Requires: uname(release) >= 2.6
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define _sbindir /sbin
97 %define _usrsbindir /usr/sbin
99 # changing CFLAGS in the middle confuses confcache
100 %undefine configure_cache
103 %define filterout_ld -Wl,--as-needed
105 # for some reason known only to rpm there must be "\\|" not "\|" here
106 %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
107 %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
109 %define skip_post_check_so '.*libdevmapper-event-lvm2.so.*'
112 This package includes a number of utilities for creating, checking,
113 and repairing logical volumes.
115 %description -l pl.UTF-8
116 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
117 logicznych wolumenów dyskowych (LVM2).
120 Summary: The new version of Logical Volume Manager for Linux - initrd version
121 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
123 Conflicts: geninitrd < 10000.18
126 This package includes a number of utilities for creating, checking,
127 and repairing logical volumes - staticaly linked for initrd.
129 %description initrd -l pl.UTF-8
130 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
131 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
134 %package -n device-mapper
135 Summary: Userspace support for the device-mapper
136 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
139 %description -n device-mapper
140 The goal of this driver is to support volume management. The driver
141 enables the definition of new block devices composed of ranges of
142 sectors of existing devices. This can be used to define disk
143 partitions - or logical volumes. This light-weight kernel component
144 can support user-space tools for logical volume management.
146 %description -n device-mapper -l pl.UTF-8
147 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
148 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
149 sektorów na istniejących urządzeniach. Może to być wykorzystane do
150 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
151 składnik jądra może wspierać działające w przestrzeni użytkownika
152 narzędzia do zarządzania logicznymi wolumenami.
154 %package -n device-mapper-devel
155 Summary: Header files and development documentation for %{name}
156 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
157 Group: Development/Libraries
158 Requires: device-mapper = %{version}-%{release}
160 Requires: libselinux-devel
161 Requires: libsepol-devel
164 %description -n device-mapper-devel
165 Header files and development documentation for %{name}.
167 %description -n device-mapper-devel -l pl.UTF-8
168 Pliki nagłówkowe i dokumentacja do %{name}.
170 %package -n device-mapper-static
171 Summary: Static devmapper library
172 Summary(pl.UTF-8): Statyczna biblioteka devmapper
174 Group: Development/Libraries
175 Requires: device-mapper-devel = %{version}-%{release}
177 %description -n device-mapper-static
178 Static devmapper library.
180 %description -n device-mapper-static -l pl.UTF-8
181 Statyczna biblioteka devmapper.
183 %package -n device-mapper-dietlibc
184 Summary: Static devmapper library built with dietlibc
185 Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc
187 Group: Development/Libraries
188 Requires: device-mapper-devel = %{version}-%{release}
190 %description -n device-mapper-dietlibc
191 Static devmapper library built with dietlibc.
193 %description -n device-mapper-dietlibc -l pl.UTF-8
194 Statyczna biblioteka devmapper zbudowana z dietlibc.
196 %package -n device-mapper-initrd
197 Summary: Userspace support for the device-mapper - initrd version
198 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
200 Obsoletes: device-mapper-initrd-devel
201 Conflicts: geninitrd < 10000.10
203 %description -n device-mapper-initrd
204 The goal of this driver is to support volume management. The driver
205 enables the definition of new block devices composed of ranges of
206 sectors of existing devices. This can be used to define disk
207 partitions - or logical volumes. This light-weight kernel component
208 can support user-space tools for logical volume management.
210 This package contains dmsetup program linked staticaly for use in
213 %description -n device-mapper-initrd -l pl.UTF-8
214 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
215 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
216 sektorów na istniejących urządzeniach. Może to być wykorzystane do
217 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
218 składnik jądra może wspierać działające w przestrzeni użytkownika
219 narzędzia do zarządzania logicznymi wolumenami.
221 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
225 Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools
226 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools
228 Requires: %{name} = %{version}-%{release}
229 Requires: initramfs-tools
231 %description initramfs
232 The new version of Logical Volume Manager for Linux - support scripts
235 %description initramfs -l pl.UTF-8
236 Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla
240 %setup -q -n LVM2.%{version}
241 %{?with_selinux:%patch0 -p1}
247 # do not force --export-symbol linker option for e.g. statically linked executables
248 # -rdynamic compiler option drives linker in the right way.
249 %{__sed} -i -e 's#-Wl,--export-dynamic#-rdynamic#g' configure.in
253 echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd
255 cp -f /usr/share/automake/config.sub autoconf
260 %{?with_glibc:export CC="%{__cc}"}
261 %{?with_uClibc:export CC="%{_target_cpu}-uclibc-gcc"}
262 %{?with_dietlibc:export CC="diet %{__cc}"}
265 ac_cv_lib_dl_dlopen=no \
266 %{?debug:--enable-debug} \
267 --with-optimisation="%{rpmcflags} -Os" \
268 --enable-static_link \
269 --with-lvm1=internal \
271 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
274 # glibc version links with normal static libdevicemapper which has selinux enabled
275 # and we need to keep these in sync between device-mapper and lvm2
277 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
278 %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h
280 %{__make} -j1 -C include
281 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
282 %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
283 %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"}
284 mv -f tools/lvm.static initrd-lvm
285 mv -f tools/dmsetup.static initrd-dmsetup
286 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
293 --with-usrlibdir=%{_libdir} \
294 %{?debug:--enable-debug} \
295 --with-optimisation="%{rpmcflags}" \
301 %{?with_clvmd:--with-clvmd=cman} \
302 --with-lvm1=internal \
303 --with-pool=internal \
304 --with-cluster=internal \
305 --with-snapshots=internal \
306 --with-mirrors=internal \
307 --with-interface=ioctl \
308 %{!?with_selinux:--disable-selinux}
310 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
313 rm -rf $RPM_BUILD_ROOT
314 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
315 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
316 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
319 DESTDIR=$RPM_BUILD_ROOT \
323 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
324 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
325 lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
326 slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
327 ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
330 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
333 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
334 install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
335 install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
337 %{?with_dietlibc:cp -a diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
340 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
341 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
343 cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
346 rm -rf $RPM_BUILD_ROOT
348 %post -n device-mapper -p /sbin/ldconfig
349 %postun -n device-mapper -p /sbin/ldconfig
352 %defattr(644,root,root,755)
353 %doc README WHATS_NEW doc/*
354 %attr(755,root,root) %{_sbindir}/fsadm
355 %attr(755,root,root) %{_sbindir}/lv*
356 %attr(755,root,root) %{_sbindir}/pv*
357 %attr(755,root,root) %{_sbindir}/vg*
358 %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
359 %{_mandir}/man5/lvm.conf.5*
360 %{?with_clvmd:%{_mandir}/man8/clvmd.8*}
361 %{_mandir}/man8/fsadm.8*
362 %{_mandir}/man8/lv*.8*
363 %{_mandir}/man8/pv*.8*
364 %{_mandir}/man8/vg*.8*
365 %attr(750,root,root) %dir %{_sysconfdir}/lvm
366 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
368 %files -n device-mapper
369 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_sbindir}/dmeventd
372 %attr(755,root,root) %{_sbindir}/dmsetup
373 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
374 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
375 %dir %{_libdir}/device-mapper
376 %attr(755,root,root) %{_libdir}/device-mapper/*.so
377 %{_mandir}/man8/dmsetup.8*
378 %{_mandir}/man8/dmeventd.8*
380 %files -n device-mapper-devel
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_libdir}/libdevmapper*.so
383 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
384 %{_includedir}/libdevmapper*.h
385 %{_includedir}/lvm2cmd.h
386 %{_pkgconfigdir}/devmapper*.pc
388 %files -n device-mapper-static
389 %defattr(644,root,root,755)
390 %{_libdir}/libdevmapper*.a
394 %files -n device-mapper-dietlibc
395 %defattr(644,root,root,755)
396 %{dietlibdir}/libdevmapper.a
399 %files -n device-mapper-initrd
400 %defattr(644,root,root,755)
401 %attr(755,root,root) %{_libdir}/initrd/dmsetup
404 %defattr(644,root,root,755)
405 %attr(755,root,root) %{_libdir}/initrd/lvm
409 %defattr(644,root,root,755)
410 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
411 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2