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_without selinux # disable SELinux
16 # if one of the *libc is enabled disable default dietlibc
17 %if %{with dietlibc} && %{with uClibc}
18 %undefine with_dietlibc
21 %if %{with glibc} && %{with dietlibc}
22 %undefine with_dietlibc
25 Summary: The new version of Logical Volume Manager for Linux
26 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
31 Group: Applications/System
32 Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
33 # Source0-md5: 088d037e77660f48cd1591e91ed59d20
34 Source1: %{name}-initramfs-hook
35 Source2: %{name}-initramfs-local-top
36 Patch0: %{name}-selinux.patch
37 Patch1: %{name}-diet.patch
38 Patch2: device-mapper-dmsetup-export.patch
39 URL: http://sources.redhat.com/lvm2/
40 BuildRequires: autoconf
41 BuildRequires: automake
42 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
43 %{?with_selinux:BuildRequires: libsepol-devel}
44 BuildRequires: pkgconfig
45 BuildRequires: rpmbuild(macros) >= 1.213
48 BuildRequires: dietlibc-static >= 2:0.31-5
49 BuildConflicts: device-mapper-dietlibc
51 %{?with_glibc:BuildRequires: glibc-static}
52 %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29}
55 BuildRequires: cman-devel >= 1.0
56 BuildRequires: dlm-devel >= 1.0-0.pre21.2
58 BuildRequires: ncurses-devel
59 BuildRequires: readline-devel
60 Requires: device-mapper >= %{version}-%{release}
62 Requires: cman-libs >= 1.0
63 Requires: dlm >= 1.0-0.pre21.2
65 %{?with_selinux:Requires: libselinux >= 1.10}
66 # doesn't work with 2.4 kernels
67 Requires: uname(release) >= 2.6
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 %define _sbindir /sbin
72 %define _usrsbindir /usr/sbin
74 # changing CFLAGS in the middle confuses confcache
75 %undefine configure_cache
76 # can't work with diet
79 # for some reason known only to rpm there must be "\\|" not "\|" here
80 %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
81 %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
84 This package includes a number of utilities for creating, checking,
85 and repairing logical volumes.
87 %description -l pl.UTF-8
88 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
89 logicznych wolumenów dyskowych (LVM2).
92 Summary: The new version of Logical Volume Manager for Linux - initrd version
93 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
95 Conflicts: geninitrd < 10000.18
98 This package includes a number of utilities for creating, checking,
99 and repairing logical volumes - staticaly linked for initrd.
101 %description initrd -l pl.UTF-8
102 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
103 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
106 %package -n device-mapper
107 Summary: Userspace support for the device-mapper
108 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
111 %description -n device-mapper
112 The goal of this driver is to support volume management. The driver
113 enables the definition of new block devices composed of ranges of
114 sectors of existing devices. This can be used to define disk
115 partitions - or logical volumes. This light-weight kernel component
116 can support user-space tools for logical volume management.
118 %description -n device-mapper -l pl.UTF-8
119 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
120 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
121 sektorów na istniejących urządzeniach. Może to być wykorzystane do
122 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
123 składnik jądra może wspierać działające w przestrzeni użytkownika
124 narzędzia do zarządzania logicznymi wolumenami.
126 %package -n device-mapper-devel
127 Summary: Header files and development documentation for %{name}
128 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
129 Group: Development/Libraries
130 Requires: device-mapper = %{version}-%{release}
132 Requires: libselinux-devel
133 Requires: libsepol-devel
136 %description -n device-mapper-devel
137 Header files and development documentation for %{name}.
139 %description -n device-mapper-devel -l pl.UTF-8
140 Pliki nagłówkowe i dokumentacja do %{name}.
142 %package -n device-mapper-static
143 Summary: Static devmapper library
144 Summary(pl.UTF-8): Statyczna biblioteka devmapper
146 Group: Development/Libraries
147 Requires: device-mapper-devel = %{version}-%{release}
149 %description -n device-mapper-static
150 Static devmapper library.
152 %description -n device-mapper-static -l pl.UTF-8
153 Statyczna biblioteka devmapper.
155 %package -n device-mapper-dietlibc
156 Summary: Static devmapper library built with dietlibc
157 Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc
159 Group: Development/Libraries
160 Requires: device-mapper-devel = %{version}-%{release}
162 %description -n device-mapper-dietlibc
163 Static devmapper library built with dietlibc.
165 %description -n device-mapper-dietlibc -l pl.UTF-8
166 Statyczna biblioteka devmapper zbudowana z dietlibc.
168 %package -n device-mapper-initrd
169 Summary: Userspace support for the device-mapper - initrd version
170 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
172 Obsoletes: device-mapper-initrd-devel
173 Conflicts: geninitrd < 10000.10
175 %description -n device-mapper-initrd
176 The goal of this driver is to support volume management. The driver
177 enables the definition of new block devices composed of ranges of
178 sectors of existing devices. This can be used to define disk
179 partitions - or logical volumes. This light-weight kernel component
180 can support user-space tools for logical volume management.
182 This package contains dmsetup program linked staticaly for use in
185 %description -n device-mapper-initrd -l pl.UTF-8
186 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
187 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
188 sektorów na istniejących urządzeniach. Może to być wykorzystane do
189 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
190 składnik jądra może wspierać działające w przestrzeni użytkownika
191 narzędzia do zarządzania logicznymi wolumenami.
193 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
197 Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools
198 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools
200 Requires: %{name} = %{version}-%{release}
201 Requires: initramfs-tools
203 %description initramfs
204 The new version of Logical Volume Manager for Linux - support scripts
207 %description initramfs -l pl.UTF-8
208 Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla
212 %setup -q -n LVM2.%{version}
213 %{?with_selinux:%patch0 -p1}
218 cp -f /usr/share/automake/config.sub autoconf
224 %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
225 %{?with_dietlibc:CC="diet %{__cc}"} \
226 ac_cv_lib_dl_dlopen=no \
227 %{?debug:--enable-debug} \
228 --with-optimisation="%{rpmcflags} -Os" \
229 --enable-static_link \
230 --with-lvm1=internal \
231 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
234 # glibc version links with normal static libdevicemapper which has selinux enabled
235 # and we need to keep these in sync between device-mapper and lvm2
237 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
239 %{__make} -j1 -C include
240 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
241 %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
242 %{__make} -j1 -C tools dmsetup.static lvm.static DIETLIBC_LIBS="-lcompat"
243 mv -f tools/lvm.static initrd-lvm
244 mv -f tools/dmsetup.static initrd-dmsetup
245 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
250 --with-usrlibdir=%{_libdir} \
251 %{?debug:--enable-debug} \
252 --with-optimisation="%{rpmcflags}" \
258 %{?with_clvmd:--with-clvmd=cman} \
259 --with-lvm1=internal \
260 --with-pool=internal \
261 --with-cluster=internal \
262 --with-snapshots=internal \
263 --with-mirrors=internal \
264 --with-interface=ioctl \
265 %{!?with_selinux:--disable-selinux}
267 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
270 rm -rf $RPM_BUILD_ROOT
271 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
272 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
273 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
276 DESTDIR=$RPM_BUILD_ROOT \
280 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
281 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
282 lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
283 slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
284 ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
287 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
290 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
291 install initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
292 install initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
294 %{?with_dietlibc:install diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
297 install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
298 install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
300 install libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
303 rm -rf $RPM_BUILD_ROOT
305 %post -n device-mapper -p /sbin/ldconfig
306 %postun -n device-mapper -p /sbin/ldconfig
309 %defattr(644,root,root,755)
310 %doc README WHATS_NEW doc/*
311 %attr(755,root,root) %{_sbindir}/fsadm
312 %attr(755,root,root) %{_sbindir}/lv*
313 %attr(755,root,root) %{_sbindir}/pv*
314 %attr(755,root,root) %{_sbindir}/vg*
315 %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
316 %{_mandir}/man5/lvm.conf.5*
317 %{?with_clvmd:%{_mandir}/man8/clvmd.8*}
318 %{_mandir}/man8/fsadm.8*
319 %{_mandir}/man8/lv*.8*
320 %{_mandir}/man8/pv*.8*
321 %{_mandir}/man8/vg*.8*
322 %attr(750,root,root) %dir %{_sysconfdir}/lvm
323 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
325 %files -n device-mapper
326 %defattr(644,root,root,755)
328 %attr(755,root,root) %{_sbindir}/dmeventd
329 %attr(755,root,root) %{_sbindir}/dmsetup
330 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
331 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
332 %dir %{_libdir}/device-mapper
333 %attr(755,root,root) %{_libdir}/device-mapper/*.so
334 %{_mandir}/man8/dmsetup.8*
336 %files -n device-mapper-devel
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_libdir}/libdevmapper*.so
339 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
340 %{_includedir}/libdevmapper*.h
341 %{_includedir}/lvm2cmd.h
342 %{_pkgconfigdir}/devmapper*.pc
344 %files -n device-mapper-static
345 %defattr(644,root,root,755)
346 %{_libdir}/libdevmapper*.a
350 %files -n device-mapper-dietlibc
351 %defattr(644,root,root,755)
352 %{dietlibdir}/libdevmapper.a
355 %files -n device-mapper-initrd
356 %defattr(644,root,root,755)
357 %attr(755,root,root) %{_libdir}/initrd/dmsetup
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_libdir}/initrd/lvm
365 %defattr(644,root,root,755)
366 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
367 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2