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