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