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