2 # - kill -lreadline from libs (using -as-needed or moving from LIBS to binaries linking)
3 # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted)
6 %bcond_without initrd # don't build initrd version
7 %bcond_with uClibc # link initrd version with uClibc
8 %bcond_without dietlibc # link initrd version with dietlibc
9 %bcond_with glibc # link initrd version with static glibc
10 %bcond_without clvmd # don't build clvmd
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
26 Summary: The new version of Logical Volume Manager for Linux
27 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
32 Group: Applications/System
33 Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
34 # Source0-md5: 440daa01b8f2ec4fe97b1cc621108220
35 Source1: %{name}-initramfs-hook
36 Source2: %{name}-initramfs-local-top
37 Patch0: %{name}-selinux.patch
38 Patch1: %{name}-diet.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: rpmbuild(macros) >= 1.213
46 %{?with_dietlibc:BuildRequires: dietlibc-static >= 2:0.31-5}
47 %{?with_glibc:BuildRequires: glibc-static}
48 %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29}
51 BuildRequires: cman-devel >= 1.0
52 BuildRequires: dlm-devel >= 1.0-0.pre21.2
54 BuildRequires: ncurses-devel
55 BuildRequires: readline-devel
56 Requires: device-mapper >= %{version}-%{release}
58 Requires: cman-libs >= 1.0
59 Requires: dlm >= 1.0-0.pre21.2
61 %{?with_selinux:Requires: libselinux >= 1.10}
62 # doesn't work with 2.4 kernels
63 Requires: uname(release) >= 2.6
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 %define _sbindir /sbin
68 %define _usrsbindir /usr/sbin
70 # changing CFLAGS in the middle confuses confcache
71 %undefine configure_cache
73 # for some reason known only to rpm there must be "\\|" not "\|" here
74 %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
75 %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
78 This package includes a number of utilities for creating, checking,
79 and repairing logical volumes.
81 %description -l pl.UTF-8
82 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
83 logicznych wolumenów dyskowych (LVM2).
86 Summary: The new version of Logical Volume Manager for Linux - initrd version
87 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
91 This package includes a number of utilities for creating, checking,
92 and repairing logical volumes - staticaly linked for initrd.
94 %description initrd -l pl.UTF-8
95 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
96 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
99 %package -n device-mapper
100 Summary: Userspace support for the device-mapper
101 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
104 %description -n device-mapper
105 The goal of this driver is to support volume management. The driver
106 enables the definition of new block devices composed of ranges of
107 sectors of existing devices. This can be used to define disk
108 partitions - or logical volumes. This light-weight kernel component
109 can support user-space tools for logical volume management.
111 %description -n device-mapper -l pl.UTF-8
112 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
113 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
114 sektorów na istniejących urządzeniach. Może to być wykorzystane do
115 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
116 składnik jądra może wspierać działające w przestrzeni użytkownika
117 narzędzia do zarządzania logicznymi wolumenami.
119 %package -n device-mapper-devel
120 Summary: Header files and development documentation for %{name}
121 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
122 Group: Development/Libraries
123 Requires: device-mapper = %{version}-%{release}
125 Requires: libselinux-devel
126 Requires: libsepol-devel
129 %description -n device-mapper-devel
130 Header files and development documentation for %{name}.
132 %description -n device-mapper-devel -l pl.UTF-8
133 Pliki nagłówkowe i dokumentacja do %{name}.
135 %package -n device-mapper-static
136 Summary: Static devmapper library
137 Summary(pl.UTF-8): Statyczna biblioteka devmapper
139 Group: Development/Libraries
140 Requires: device-mapper-devel = %{version}-%{release}
142 %description -n device-mapper-static
143 Static devmapper library.
145 %description -n device-mapper-static -l pl.UTF-8
146 Statyczna biblioteka devmapper.
148 %package -n device-mapper-dietlibc
149 Summary: Static devmapper library built with dietlibc
150 Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc
152 Group: Development/Libraries
153 Requires: device-mapper-devel = %{version}-%{release}
155 %description -n device-mapper-dietlibc
156 Static devmapper library built with dietlibc.
158 %description -n device-mapper-dietlibc -l pl.UTF-8
159 Statyczna biblioteka devmapper zbudowana z dietlibc.
161 %package -n device-mapper-initrd
162 Summary: Userspace support for the device-mapper - initrd version
163 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
165 Obsoletes: device-mapper-initrd-devel
167 %description -n device-mapper-initrd
168 The goal of this driver is to support volume management. The driver
169 enables the definition of new block devices composed of ranges of
170 sectors of existing devices. This can be used to define disk
171 partitions - or logical volumes. This light-weight kernel component
172 can support user-space tools for logical volume management.
174 This package contains dmsetup program linked staticaly for use in
177 %description -n device-mapper-initrd -l pl.UTF-8
178 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
179 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
180 sektorów na istniejących urządzeniach. Może to być wykorzystane do
181 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
182 składnik jądra może wspierać działające w przestrzeni użytkownika
183 narzędzia do zarządzania logicznymi wolumenami.
185 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
189 Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools
190 Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools
192 Requires: %{name} = %{version}-%{release}
193 Requires: initramfs-tools
195 %description initramfs
196 The new version of Logical Volume Manager for Linux - support
197 scripts for initramfs-tools.
199 %description initramfs -l pl.UTF-8
200 Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla
204 %setup -q -n LVM2.%{version}
205 %{?with_selinux:%patch0 -p1}
209 cp -f /usr/share/automake/config.sub autoconf
215 %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
216 %{?with_dietlibc:CC="diet %{__cc}"} \
217 ac_cv_lib_dl_dlopen=no \
218 %{?debug:--enable-debug} \
219 --with-optimisation="-Os" \
220 --enable-static_link \
221 --with-lvm1=internal \
222 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
225 # glibc version links with normal static libdevicemapper which has selinux enabled
226 # and we need to keep these in sync between device-mapper and lvm2
228 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
230 %{__make} -j1 lib LIB_SHARED= VERSIONED_SHLIB=
231 %{__make} -j1 -C tools dmsetup.static lvm.static
232 mv -f tools/lvm.static initrd-lvm
233 mv -f tools/dmsetup.static initrd-dmsetup
234 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
239 --with-usrlibdir=%{_libdir} \
240 %{?debug:--enable-debug} \
241 --with-optimisation="%{rpmcflags}" \
247 %{?with_clvmd:--with-clvmd=cman} \
248 --with-lvm1=internal \
249 --with-pool=internal \
250 --with-cluster=internal \
251 --with-snapshots=internal \
252 --with-mirrors=internal \
253 --with-interface=ioctl \
254 %{!?with_selinux:--disable-selinux}
258 rm -rf $RPM_BUILD_ROOT
259 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
260 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
261 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
264 DESTDIR=$RPM_BUILD_ROOT \
268 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
269 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
270 lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
271 slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
272 ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
275 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
278 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
279 install initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
280 install initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
283 %{?with_dietlibc:install diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
285 install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
286 install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
288 install libdm/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
291 rm -rf $RPM_BUILD_ROOT
293 %post -n device-mapper -p /sbin/ldconfig
294 %postun -n device-mapper -p /sbin/ldconfig
297 %defattr(644,root,root,755)
298 %doc README WHATS_NEW doc/*
299 %attr(755,root,root) %{_sbindir}/*
300 %exclude %{_sbindir}/dmeventd
301 %exclude %{_sbindir}/dmsetup
302 %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
304 %exclude %{_mandir}/man8/dmsetup.8*
305 %attr(750,root,root) %dir %{_sysconfdir}/lvm
306 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
308 %files -n device-mapper
309 %defattr(644,root,root,755)
311 %attr(755,root,root) %{_sbindir}/dmeventd
312 %attr(755,root,root) %{_sbindir}/dmsetup
313 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
314 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
315 %{_mandir}/man8/dmsetup.8*
317 %files -n device-mapper-devel
318 %defattr(644,root,root,755)
319 %attr(755,root,root) %{_libdir}/libdevmapper*.so
320 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
321 %{_includedir}/libdevmapper*.h
322 %{_includedir}/lvm2cmd.h
323 %{_pkgconfigdir}/devmapper*.pc
325 %files -n device-mapper-static
326 %defattr(644,root,root,755)
327 %{_libdir}/libdevmapper*.a
330 %files -n device-mapper-dietlibc
331 %defattr(644,root,root,755)
332 %{dietlibdir}/libdevmapper.a
336 %files -n device-mapper-initrd
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_libdir}/initrd/dmsetup
341 %defattr(644,root,root,755)
342 %attr(755,root,root) %{_libdir}/initrd/lvm
346 %defattr(644,root,root,755)
347 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
348 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2