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 %if %{with glibc} && %{with dietlibc}
23 %undefine with_dietlibc
30 Summary: The new version of Logical Volume Manager for Linux
31 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
36 Group: Applications/System
37 Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
38 # Source0-md5: a7d0d1235a589869bd13cde0f0d7375d
39 Source1: %{name}-initramfs-hook
40 Source2: %{name}-initramfs-local-top
41 Patch0: %{name}-selinux.patch
42 Patch1: %{name}-diet.patch
43 Patch2: device-mapper-dmsetup-export.patch
44 Patch3: %{name}-clvmd_init.patch
45 URL: http://sources.redhat.com/lvm2/
46 BuildRequires: autoconf
47 BuildRequires: automake
48 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
49 %{?with_selinux:BuildRequires: libsepol-devel}
50 BuildRequires: pkgconfig
51 BuildRequires: rpmbuild(macros) >= 1.213
54 BuildRequires: dietlibc-static >= 2:0.31-5
55 BuildConflicts: device-mapper-dietlibc
57 %{?with_glibc:BuildRequires: glibc-static}
58 %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29}
61 BuildRequires: cman-devel >= 1.0
62 BuildRequires: dlm-devel >= 1.0-0.pre21.2
65 BuildRequires: cluster-cman-devel
66 BuildRequires: cluster-dlm-devel
68 BuildRequires: ncurses-devel
69 BuildRequires: readline-devel
70 Requires: device-mapper >= %{version}-%{release}
72 Requires: cman-libs >= 1.0
73 Requires: dlm >= 1.0-0.pre21.2
76 Requires: cluster-cman-libs
79 %{?with_selinux:Requires: libselinux >= 1.10}
80 # doesn't work with 2.4 kernels
81 Requires: uname(release) >= 2.6
83 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
85 %define _sbindir /sbin
86 %define _usrsbindir /usr/sbin
88 # changing CFLAGS in the middle confuses confcache
89 %undefine configure_cache
90 # can't work with diet
94 %define filterout_ld -Wl,--as-needed
96 # for some reason known only to rpm there must be "\\|" not "\|" here
97 %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
98 %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
101 This package includes a number of utilities for creating, checking,
102 and repairing logical volumes.
104 %description -l pl.UTF-8
105 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
106 logicznych wolumenów dyskowych (LVM2).
109 Summary: The new version of Logical Volume Manager for Linux - initrd version
110 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
112 Conflicts: geninitrd < 10000.18
115 This package includes a number of utilities for creating, checking,
116 and repairing logical volumes - staticaly linked for initrd.
118 %description initrd -l pl.UTF-8
119 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
120 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
123 %package -n device-mapper
124 Summary: Userspace support for the device-mapper
125 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
128 %description -n device-mapper
129 The goal of this driver is to support volume management. The driver
130 enables the definition of new block devices composed of ranges of
131 sectors of existing devices. This can be used to define disk
132 partitions - or logical volumes. This light-weight kernel component
133 can support user-space tools for logical volume management.
135 %description -n device-mapper -l pl.UTF-8
136 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
137 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
138 sektorów na istniejących urządzeniach. Może to być wykorzystane do
139 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
140 składnik jądra może wspierać działające w przestrzeni użytkownika
141 narzędzia do zarządzania logicznymi wolumenami.
143 %package -n device-mapper-devel
144 Summary: Header files and development documentation for %{name}
145 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
146 Group: Development/Libraries
147 Requires: device-mapper = %{version}-%{release}
149 Requires: libselinux-devel
150 Requires: libsepol-devel
153 %description -n device-mapper-devel
154 Header files and development documentation for %{name}.
156 %description -n device-mapper-devel -l pl.UTF-8
157 Pliki nagłówkowe i dokumentacja do %{name}.
159 %package -n device-mapper-static
160 Summary: Static devmapper library
161 Summary(pl.UTF-8): Statyczna biblioteka devmapper
163 Group: Development/Libraries
164 Requires: device-mapper-devel = %{version}-%{release}
166 %description -n device-mapper-static
167 Static devmapper library.
169 %description -n device-mapper-static -l pl.UTF-8
170 Statyczna biblioteka devmapper.
172 %package -n device-mapper-dietlibc
173 Summary: Static devmapper library built with dietlibc
174 Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc
176 Group: Development/Libraries
177 Requires: device-mapper-devel = %{version}-%{release}
179 %description -n device-mapper-dietlibc
180 Static devmapper library built with dietlibc.
182 %description -n device-mapper-dietlibc -l pl.UTF-8
183 Statyczna biblioteka devmapper zbudowana z dietlibc.
185 %package -n device-mapper-initrd
186 Summary: Userspace support for the device-mapper - initrd version
187 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
189 Obsoletes: device-mapper-initrd-devel
190 Conflicts: geninitrd < 10000.10
192 %description -n device-mapper-initrd
193 The goal of this driver is to support volume management. The driver
194 enables the definition of new block devices composed of ranges of
195 sectors of existing devices. This can be used to define disk
196 partitions - or logical volumes. This light-weight kernel component
197 can support user-space tools for logical volume management.
199 This package contains dmsetup program linked staticaly for use in
202 %description -n device-mapper-initrd -l pl.UTF-8
203 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
204 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
205 sektorów na istniejących urządzeniach. Może to być wykorzystane do
206 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
207 składnik jądra może wspierać działające w przestrzeni użytkownika
208 narzędzia do zarządzania logicznymi wolumenami.
210 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
214 Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools
215 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools
217 Requires: %{name} = %{version}-%{release}
218 Requires: initramfs-tools
220 %description initramfs
221 The new version of Logical Volume Manager for Linux - support scripts
224 %description initramfs -l pl.UTF-8
225 Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla
229 %setup -q -n LVM2.%{version}
230 %{?with_selinux:%patch0 -p1}
237 echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd
239 cp -f /usr/share/automake/config.sub autoconf
245 %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
246 %{?with_dietlibc:CC="diet %{__cc}"} \
247 ac_cv_lib_dl_dlopen=no \
248 %{?debug:--enable-debug} \
249 --with-optimisation="%{rpmcflags} -Os" \
250 --enable-static_link \
251 --with-lvm1=internal \
252 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
255 # glibc version links with normal static libdevicemapper which has selinux enabled
256 # and we need to keep these in sync between device-mapper and lvm2
258 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
260 %{__make} -j1 -C include
261 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
262 %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
263 %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"}
264 mv -f tools/lvm.static initrd-lvm
265 mv -f tools/dmsetup.static initrd-dmsetup
266 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
271 --with-usrlibdir=%{_libdir} \
272 %{?debug:--enable-debug} \
273 --with-optimisation="%{rpmcflags}" \
279 %{?with_clvmd:--with-clvmd=cman} \
280 --with-lvm1=internal \
281 --with-pool=internal \
282 --with-cluster=internal \
283 --with-snapshots=internal \
284 --with-mirrors=internal \
285 --with-interface=ioctl \
286 %{!?with_selinux:--disable-selinux}
288 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
291 rm -rf $RPM_BUILD_ROOT
292 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
293 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
294 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
297 DESTDIR=$RPM_BUILD_ROOT \
301 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
302 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
303 lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
304 slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
305 ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
308 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
311 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
312 install initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
313 install initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
315 %{?with_dietlibc:install diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
318 install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
319 install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
321 install libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
324 rm -rf $RPM_BUILD_ROOT
326 %post -n device-mapper -p /sbin/ldconfig
327 %postun -n device-mapper -p /sbin/ldconfig
330 %defattr(644,root,root,755)
331 %doc README WHATS_NEW doc/*
332 %attr(755,root,root) %{_sbindir}/fsadm
333 %attr(755,root,root) %{_sbindir}/lv*
334 %attr(755,root,root) %{_sbindir}/pv*
335 %attr(755,root,root) %{_sbindir}/vg*
336 %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
337 %{_mandir}/man5/lvm.conf.5*
338 %{?with_clvmd:%{_mandir}/man8/clvmd.8*}
339 %{_mandir}/man8/fsadm.8*
340 %{_mandir}/man8/lv*.8*
341 %{_mandir}/man8/pv*.8*
342 %{_mandir}/man8/vg*.8*
343 %attr(750,root,root) %dir %{_sysconfdir}/lvm
344 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
346 %files -n device-mapper
347 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_sbindir}/dmeventd
350 %attr(755,root,root) %{_sbindir}/dmsetup
351 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
352 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
353 %dir %{_libdir}/device-mapper
354 %attr(755,root,root) %{_libdir}/device-mapper/*.so
355 %{_mandir}/man8/dmsetup.8*
356 %{_mandir}/man8/dmeventd.8*
358 %files -n device-mapper-devel
359 %defattr(644,root,root,755)
360 %attr(755,root,root) %{_libdir}/libdevmapper*.so
361 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
362 %{_includedir}/libdevmapper*.h
363 %{_includedir}/lvm2cmd.h
364 %{_pkgconfigdir}/devmapper*.pc
366 %files -n device-mapper-static
367 %defattr(644,root,root,755)
368 %{_libdir}/libdevmapper*.a
372 %files -n device-mapper-dietlibc
373 %defattr(644,root,root,755)
374 %{dietlibdir}/libdevmapper.a
377 %files -n device-mapper-initrd
378 %defattr(644,root,root,755)
379 %attr(755,root,root) %{_libdir}/initrd/dmsetup
382 %defattr(644,root,root,755)
383 %attr(755,root,root) %{_libdir}/initrd/lvm
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
389 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2