]> git.pld-linux.org Git - packages/lvm2.git/blame - lvm2.spec
- rel 3
[packages/lvm2.git] / lvm2.spec
CommitLineData
e3a928dc
ER
1# TODO
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)
1b67453e 4#
99958222 5# Conditional build:
c70b42f6
JR
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
12
4a323c26 13%ifarch sparc64 sparc
c70b42f6 14%define with_glibc 1
66800f6a 15%endif
c70b42f6
JR
16
17# if one of the *libc is enabled disable default dietlibc
18%if %{with dietlibc} && %{with uClibc}
19%undefine with_dietlibc
20%endif
21
22%if %{with glibc} && %{with dietlibc}
23%undefine with_dietlibc
24%endif
25
5672aa67 26Summary: The new version of Logical Volume Manager for Linux
6536e848 27Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
7e72c866 28Name: lvm2
d8944f66 29Version: 2.02.45
4bf8e3cb 30Release: 3
1738b891 31License: GPL v2
7e72c866 32Group: Applications/System
dc5d0e77 33Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
d8944f66 34# Source0-md5: 440daa01b8f2ec4fe97b1cc621108220
bf171b20
JR
35Source1: %{name}-initramfs-hook
36Source2: %{name}-initramfs-local-top
7210a095 37Patch0: %{name}-selinux.patch
c70b42f6 38Patch1: %{name}-diet.patch
dc5d0e77 39URL: http://sources.redhat.com/lvm2/
7e72c866
JR
40BuildRequires: autoconf
41BuildRequires: automake
0dc2b8f2 42%{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
e4a12efb 43%{?with_selinux:BuildRequires: libsepol-devel}
bd71c1b4 44BuildRequires: rpmbuild(macros) >= 1.213
1ccfba6c 45%if %{with initrd}
c70b42f6
JR
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}
1ccfba6c 49%endif
c97b4c11 50%if %{with clvmd}
1b67453e 51BuildRequires: cman-devel >= 1.0
4c78aede 52BuildRequires: dlm-devel >= 1.0-0.pre21.2
1b67453e 53%endif
260d6858 54BuildRequires: ncurses-devel
33d5c7d0 55BuildRequires: readline-devel
b167057a 56Requires: device-mapper >= %{version}-%{release}
1b67453e 57%if %{with clvmd}
ed044ab4 58Requires: cman-libs >= 1.0
b678d191 59Requires: dlm >= 1.0-0.pre21.2
1b67453e 60%endif
0dc2b8f2 61%{?with_selinux:Requires: libselinux >= 1.10}
1534f04d
ER
62# doesn't work with 2.4 kernels
63Requires: uname(release) >= 2.6
25b6b609 64Obsoletes: lvm
7e72c866
JR
65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67%define _sbindir /sbin
9ab13f24 68%define _usrsbindir /usr/sbin
7e72c866 69
0fbd6aae
ER
70# changing CFLAGS in the middle confuses confcache
71%undefine configure_cache
72
c70b42f6
JR
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}
76
7e72c866
JR
77%description
78This package includes a number of utilities for creating, checking,
79and repairing logical volumes.
80
68d45726
JR
81%description -l pl.UTF-8
82Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
83logicznych wolumenów dyskowych (LVM2).
7e72c866 84
7e72c866 85%package initrd
5672aa67 86Summary: The new version of Logical Volume Manager for Linux - initrd version
6536e848 87Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
7e72c866
JR
88Group: Base
89
90%description initrd
91This package includes a number of utilities for creating, checking,
92and repairing logical volumes - staticaly linked for initrd.
93
68d45726
JR
94%description initrd -l pl.UTF-8
95Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
96logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
7e72c866
JR
97potrzeby initrd.
98
b167057a
AM
99%package -n device-mapper
100Summary: Userspace support for the device-mapper
101Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
102Group: Base
103
104%description -n device-mapper
105The goal of this driver is to support volume management. The driver
106enables the definition of new block devices composed of ranges of
107sectors of existing devices. This can be used to define disk
108partitions - or logical volumes. This light-weight kernel component
109can support user-space tools for logical volume management.
110
111%description -n device-mapper -l pl.UTF-8
112Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
113włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
114sektorów na istniejących urządzeniach. Może to być wykorzystane do
115definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
116składnik jądra może wspierać działające w przestrzeni użytkownika
117narzędzia do zarządzania logicznymi wolumenami.
118
119%package -n device-mapper-devel
120Summary: Header files and development documentation for %{name}
121Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
122Group: Development/Libraries
123Requires: device-mapper = %{version}-%{release}
124%if %{with selinux}
125Requires: libselinux-devel
126Requires: libsepol-devel
127%endif
128
129%description -n device-mapper-devel
130Header files and development documentation for %{name}.
131
132%description -n device-mapper-devel -l pl.UTF-8
133Pliki nagłówkowe i dokumentacja do %{name}.
134
135%package -n device-mapper-static
136Summary: Static devmapper library
137Summary(pl.UTF-8): Statyczna biblioteka devmapper
138License: LGPL v2.1
139Group: Development/Libraries
dc900ced 140Requires: device-mapper-devel = %{version}-%{release}
b167057a
AM
141
142%description -n device-mapper-static
143Static devmapper library.
144
145%description -n device-mapper-static -l pl.UTF-8
146Statyczna biblioteka devmapper.
147
c70b42f6
JR
148%package -n device-mapper-dietlibc
149Summary: Static devmapper library built with dietlibc
150Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc
151License: LGPL v2.1
152Group: Development/Libraries
153Requires: device-mapper-devel = %{version}-%{release}
154
155%description -n device-mapper-dietlibc
156Static devmapper library built with dietlibc.
157
158%description -n device-mapper-dietlibc -l pl.UTF-8
159Statyczna biblioteka devmapper zbudowana z dietlibc.
160
4a323c26
JR
161%package -n device-mapper-initrd
162Summary: Userspace support for the device-mapper - initrd version
163Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
164Group: Base
165Obsoletes: device-mapper-initrd-devel
166
167%description -n device-mapper-initrd
168The goal of this driver is to support volume management. The driver
169enables the definition of new block devices composed of ranges of
170sectors of existing devices. This can be used to define disk
171partitions - or logical volumes. This light-weight kernel component
172can support user-space tools for logical volume management.
173
174This package contains dmsetup program linked staticaly for use in
175initrd.
176
177%description -n device-mapper-initrd -l pl.UTF-8
178Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
179włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
180sektorów na istniejących urządzeniach. Może to być wykorzystane do
181definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
182składnik jądra może wspierać działające w przestrzeni użytkownika
183narzędzia do zarządzania logicznymi wolumenami.
184
185Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
186potrzeby initrd.
187
906ac01a
JR
188%package initramfs
189Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools
190Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools
191Group: Base
192Requires: %{name} = %{version}-%{release}
193Requires: initramfs-tools
194
195%description initramfs
196The new version of Logical Volume Manager for Linux - support
197scripts for initramfs-tools.
198
199%description initramfs -l pl.UTF-8
200Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla
201initramfs-tools.
202
7e72c866 203%prep
ec2de926 204%setup -q -n LVM2.%{version}
7210a095 205%{?with_selinux:%patch0 -p1}
c70b42f6 206%patch1 -p1
b167057a 207
7e72c866 208%build
242ffb9a 209cp -f /usr/share/automake/config.sub autoconf
7e72c866
JR
210%{__aclocal}
211%{__autoconf}
212
99958222 213%if %{with initrd}
9bdab2f4 214%configure \
69688a46 215 %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
c70b42f6 216 %{?with_dietlibc:CC="diet %{__cc}"} \
a5702977 217 ac_cv_lib_dl_dlopen=no \
4c78aede 218 %{?debug:--enable-debug} \
69688a46 219 --with-optimisation="-Os" \
9bdab2f4 220 --enable-static_link \
69688a46 221 --with-lvm1=internal \
c70b42f6 222 --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
260d6858 223 --disable-readline \
ef3dbc1a 224 --disable-nls
c70b42f6 225# glibc version links with normal static libdevicemapper which has selinux enabled
260d6858 226# and we need to keep these in sync between device-mapper and lvm2
4c78aede
ER
227
228%{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
ec2de926 229
77fd140c 230%{__make} -j1 lib LIB_SHARED= VERSIONED_SHLIB=
c70b42f6 231%{__make} -j1 -C tools dmsetup.static lvm.static
69688a46 232mv -f tools/lvm.static initrd-lvm
4a323c26 233mv -f tools/dmsetup.static initrd-dmsetup
c70b42f6 234%{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
9bdab2f4 235%{__make} clean
7e72c866
JR
236%endif
237
9d0d1d5f 238%configure \
b167057a 239 --with-usrlibdir=%{_libdir} \
4c78aede 240 %{?debug:--enable-debug} \
b167057a 241 --with-optimisation="%{rpmcflags}" \
607d2229
AM
242 --enable-readline \
243 --enable-fsadm \
b167057a
AM
244 --enable-cmdlib \
245 --enable-dmeventd \
246 --enable-pkgconfig \
ed044ab4 247 %{?with_clvmd:--with-clvmd=cman} \
607d2229
AM
248 --with-lvm1=internal \
249 --with-pool=internal \
3852b0e2 250 --with-cluster=internal \
607d2229 251 --with-snapshots=internal \
0dc2b8f2 252 --with-mirrors=internal \
b167057a 253 --with-interface=ioctl \
0dc2b8f2 254 %{!?with_selinux:--disable-selinux}
b167057a 255%{__make} -j1
7e72c866
JR
256
257%install
258rm -rf $RPM_BUILD_ROOT
906ac01a
JR
259install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \
260 $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top}
c70b42f6 261%{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
7e72c866
JR
262
263%{__make} install \
264 DESTDIR=$RPM_BUILD_ROOT \
1ccfba6c
AM
265 OWNER="" \
266 GROUP=""
7e72c866 267
b167057a
AM
268mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
269for 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
273done
274
1cfc154f
JR
275touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
276
9bdab2f4 277%{?with_initrd:install initrd-lvm $RPM_BUILD_ROOT%{_sbindir}/initrd-lvm}
4a323c26 278%{?with_initrd:install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir}/initrd-dmsetup}
7e72c866 279
c70b42f6
JR
280%{?with_dietlibc:install diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
281
906ac01a
JR
282install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2
283install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2
284
b167057a
AM
285install libdm/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
286
7e72c866
JR
287%clean
288rm -rf $RPM_BUILD_ROOT
289
b167057a
AM
290%post -n device-mapper -p /sbin/ldconfig
291%postun -n device-mapper -p /sbin/ldconfig
292
7e72c866
JR
293%files
294%defattr(644,root,root,755)
e6ac7970 295%doc README WHATS_NEW doc/*
3320dcf1 296%attr(755,root,root) %{_sbindir}/*
b167057a
AM
297%exclude %{_sbindir}/dmeventd
298%exclude %{_sbindir}/dmsetup
1ccc459a 299%{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd}
4a323c26 300%{?with_initrd:%exclude %{_sbindir}/initrd-*}
7e72c866 301%{_mandir}/man?/*
b167057a 302%exclude %{_mandir}/man8/dmsetup.8*
99958222 303%attr(750,root,root) %dir %{_sysconfdir}/lvm
2316bf4d 304%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
7e72c866 305
b167057a
AM
306%files -n device-mapper
307%defattr(644,root,root,755)
308%doc *_DM
309%attr(755,root,root) %{_sbindir}/dmeventd
310%attr(755,root,root) %{_sbindir}/dmsetup
311%attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
312%attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
313%{_mandir}/man8/dmsetup.8*
314
315%files -n device-mapper-devel
316%defattr(644,root,root,755)
317%attr(755,root,root) %{_libdir}/libdevmapper*.so
318%attr(755,root,root) %{_libdir}/liblvm2cmd.so
319%{_includedir}/libdevmapper*.h
320%{_includedir}/lvm2cmd.h
321%{_pkgconfigdir}/devmapper*.pc
322
323%files -n device-mapper-static
324%defattr(644,root,root,755)
325%{_libdir}/libdevmapper*.a
326
c70b42f6
JR
327%if %{with dietlibc}
328%files -n device-mapper-dietlibc
329%defattr(644,root,root,755)
330%{dietlibdir}/libdevmapper.a
331%endif
332
99958222 333%if %{with initrd}
4a323c26
JR
334%files -n device-mapper-initrd
335%defattr(644,root,root,755)
336%attr(755,root,root) %{_sbindir}/initrd-dmsetup
337
7e72c866
JR
338%files initrd
339%defattr(644,root,root,755)
340%attr(755,root,root) %{_sbindir}/initrd-lvm
341%endif
906ac01a
JR
342
343%files initramfs
344%defattr(644,root,root,755)
345%attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2
346%attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2
This page took 0.084885 seconds and 4 git commands to generate.