]> TLD Linux GIT Repositories - packages/lvm2.git/blob - lvm2.spec
- updated to 2.02.116
[packages/lvm2.git] / lvm2.spec
1 # TODO
2 # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted)
3 # - --with-replicators (=internal/shared/none, default is none)?
4 #
5 # Conditional build:
6 %bcond_with     initrd          # don't build initrd version
7 %bcond_without  uClibc          # link initrd version with uClibc
8 %bcond_with     dietlibc        # link initrd version with dietlibc
9 %bcond_with     glibc           # link initrd version with static GLIBC
10 %bcond_without  cluster         # disable all cluster support (clvmd&cmirrord)
11 %bcond_without  lvmetad         # disable lvmetad
12 %bcond_without  selinux         # disable SELinux
13
14 %ifarch sparc64 sparc
15 %define         with_glibc 1
16 %endif
17
18 # if one of the *libc is enabled disable default dietlibc
19 %if %{with dietlibc} && %{with uClibc}
20 %undefine       with_dietlibc
21 %endif
22
23 # with glibc disables default dietlibc
24 %if %{with glibc} && %{with dietlibc}
25 %undefine       with_dietlibc
26 %endif
27
28 # fallback is glibc if neither alternatives are enabled
29 %if %{without dietlibc} && %{without uClibc}
30 %define         with_glibc      1
31 %endif
32
33 Summary:        The new version of Logical Volume Manager for Linux
34 Summary(pl.UTF-8):      Nowa wersja Logical Volume Managera dla Linuksa
35 Name:           lvm2
36 Version:        2.02.116
37 Release:        1
38 License:        GPL v2 and LGPL v2.1
39 Group:          Applications/System
40 Source0:        ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
41 # Source0-md5:  3a1104e3d1dc4d5e92a40228161cd660
42 Source1:        %{name}-tmpfiles.conf
43 Source3:        clvmd.sysconfig
44 Patch0:         %{name}-selinux.patch
45 Patch1:         %{name}-diet.patch
46 Patch2:         device-mapper-dmsetup-export.patch
47 Patch3:         %{name}-tld_init.patch
48 Patch4:         dl-dlsym.patch
49 Patch6:         %{name}-lvm_path.patch
50 Patch7:         %{name}-clvmd_cmd_timeout.patch
51 Patch8:         device-mapper-dmsetup-deps-export.patch
52 URL:            http://sources.redhat.com/lvm2/
53 BuildRequires:  autoconf >= 2.61
54 BuildRequires:  automake
55 %{?with_selinux:BuildRequires:  libselinux-devel >= 1.10}
56 %{?with_selinux:BuildRequires:  libsepol-devel}
57 BuildRequires:  ncurses-devel
58 BuildRequires:  pkgconfig
59 BuildRequires:  readline-devel
60 BuildRequires:  rpmbuild(macros) >= 1.647
61 BuildRequires:  udev-devel >= 1:143
62 %if %{with initrd}
63 %if %{with dietlibc}
64 BuildRequires:  dietlibc-static >= 2:0.32-7
65 BuildConflicts: device-mapper-dietlibc
66 %endif
67 %if %{with glibc}
68 %{?with_selinux:BuildRequires:  libselinux-static}
69 %{?with_selinux:BuildRequires:  libsepol-static}
70 %endif
71 %{?with_glibc:BuildRequires:    glibc-static}
72 %{?with_uClibc:BuildRequires:   uClibc-static >= 2:0.9.29}
73 %endif
74 %if %{with cluster}
75 BuildRequires:  corosync-devel
76 BuildRequires:  dlm-devel >= 3.99.5
77 %endif
78 Requires(post,postun):  /sbin/chkconfig
79 Requires:       device-mapper >= %{version}-%{release}
80 %{?with_selinux:Requires:       libselinux >= 1.10}
81 # doesn't work with 2.4 kernels
82 Requires:       uname(release) >= 2.6
83 Obsoletes:      lvm
84 Obsoletes:      lvm2-systemd
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %define         _sbindir        /sbin
88 %define         _usrsbindir     /usr/sbin
89
90 # changing CFLAGS in the middle confuses confcache
91 %undefine       configure_cache
92
93 # borken on AC
94 %define         filterout_ld    -Wl,--as-needed
95
96 # causes: undefined reference to `__stack_chk_fail_local'
97 %define         filterout_c     -fstack-protector
98
99 # for some reason known only to rpm there must be "\\|" not "\|" here
100 %define         dietarch        %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
101 %define         dietlibdir      %{_prefix}/lib/dietlibc/lib-%{dietarch}
102
103 %define         skip_post_check_so      '.*libdevmapper-event-lvm2.so.*'
104
105 %description
106 This package includes a number of utilities for creating, checking,
107 and repairing logical volumes.
108
109 %description -l pl.UTF-8
110 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
111 logicznych wolumenów dyskowych (LVM2).
112
113 %package initrd
114 Summary:        The new version of Logical Volume Manager for Linux - initrd version
115 Summary(pl.UTF-8):      Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
116 Group:          Base
117 Conflicts:      geninitrd < 10000.18
118
119 %description initrd
120 This package includes a number of utilities for creating, checking,
121 and repairing logical volumes - staticaly linked for initrd.
122
123 %description initrd -l pl.UTF-8
124 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
125 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
126 potrzeby initrd.
127
128 %package clvmd
129 Summary:        Cluster LVM daemon
130 Summary(pl.UTF-8):      Demon clustra LVM
131 Group:          Applications/System
132 Requires:       %{name} = %{version}-%{release}
133
134 %description clvmd
135 clvmd is the daemon that distributes LVM metadata updates around a
136 cluster. It must be running on all nodes in the cluster and will give
137 an error if a node in the cluster does not have this daemon running.
138
139 %description clvmd -l pl.UTF-8
140 clvmd to demon który rozprowadza zmiany meta-danych LVM po klastrze.
141 Mysi działać na wszystkich węzłach klastra i zgłosi błąd gdy jakiś
142 węzeł w klastrze nie ma tego demona uruchomionego.
143
144 %package cmirrord
145 Summary:        Cluster mirror log daemon
146 Group:          Applications/System
147 Requires:       %{name} = %{version}-%{release}
148
149 %description cmirrord
150 cmirrord is the daemon that tracks mirror log information in a
151 cluster. It is specific to device-mapper based mirrors (and by
152 extension, LVM cluster mirrors). Cluster mirrors are not possible
153 without this daemon running.
154
155 This daemon relies on the cluster infrastructure provided by the
156 Cluster MANager (CMAN), which must be set up and running in order for
157 cmirrord to function.
158
159 %package resource-agents
160 Summary:        OCF Resource Agents for LVM2 processes
161 Summary(pl.UTF-8):      Agenci OCF do monitorowania procesów LVM2
162 Group:          Applications/System
163 Requires:       %{name} = %{version}-%{release}
164 Requires:       resource-agents
165
166 %description resource-agents
167 OCF Resource Agents for LVM2 processes.
168
169 %description resource-agents -l pl.UTF-8
170 Agenci OCF do monitorowania procesów LVM2.
171
172 %package -n device-mapper
173 Summary:        Userspace support for the device-mapper
174 Summary(pl.UTF-8):      Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
175 Group:          Base
176 Requires(post,postun):  /sbin/ldconfig
177
178 %description -n device-mapper
179 The goal of this driver is to support volume management. The driver
180 enables the definition of new block devices composed of ranges of
181 sectors of existing devices. This can be used to define disk
182 partitions - or logical volumes. This light-weight kernel component
183 can support user-space tools for logical volume management.
184
185 %description -n device-mapper -l pl.UTF-8
186 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
187 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
188 sektorów na istniejących urządzeniach. Może to być wykorzystane do
189 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
190 składnik jądra może wspierać działające w przestrzeni użytkownika
191 narzędzia do zarządzania logicznymi wolumenami.
192
193 %package -n device-mapper-devel
194 Summary:        Header files and development documentation for %{name}
195 Summary(pl.UTF-8):      Pliki nagłówkowe i dokumentacja do %{name}
196 Group:          Development/Libraries
197 Requires:       device-mapper = %{version}-%{release}
198 %if %{with selinux}
199 Requires:       libselinux-devel
200 Requires:       libsepol-devel
201 %endif
202
203 %description -n device-mapper-devel
204 Header files and development documentation for %{name}.
205
206 %description -n device-mapper-devel -l pl.UTF-8
207 Pliki nagłówkowe i dokumentacja do %{name}.
208
209 %package -n device-mapper-static
210 Summary:        Static devmapper library
211 Summary(pl.UTF-8):      Statyczna biblioteka devmapper
212 License:        LGPL v2.1
213 Group:          Development/Libraries
214 Requires:       device-mapper-devel = %{version}-%{release}
215
216 %description -n device-mapper-static
217 Static devmapper library.
218
219 %description -n device-mapper-static -l pl.UTF-8
220 Statyczna biblioteka devmapper.
221
222 %package -n device-mapper-dietlibc
223 Summary:        Static devmapper library built with dietlibc
224 Summary(pl.UTF-8):      Statyczna biblioteka devmapper zbudowana z dietlibc
225 License:        LGPL v2.1
226 Group:          Development/Libraries
227 Requires:       device-mapper-devel = %{version}-%{release}
228
229 %description -n device-mapper-dietlibc
230 Static devmapper library built with dietlibc.
231
232 %description -n device-mapper-dietlibc -l pl.UTF-8
233 Statyczna biblioteka devmapper zbudowana z dietlibc.
234
235 %package -n device-mapper-initrd
236 Summary:        Userspace support for the device-mapper - initrd version
237 Summary(pl.UTF-8):      Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
238 Group:          Base
239 Obsoletes:      device-mapper-initrd-devel
240 Conflicts:      geninitrd < 10000.10
241
242 %description -n device-mapper-initrd
243 The goal of this driver is to support volume management. The driver
244 enables the definition of new block devices composed of ranges of
245 sectors of existing devices. This can be used to define disk
246 partitions - or logical volumes. This light-weight kernel component
247 can support user-space tools for logical volume management.
248
249 This package contains dmsetup program linked staticaly for use in
250 initrd.
251
252 %description -n device-mapper-initrd -l pl.UTF-8
253 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
254 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
255 sektorów na istniejących urządzeniach. Może to być wykorzystane do
256 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
257 składnik jądra może wspierać działające w przestrzeni użytkownika
258 narzędzia do zarządzania logicznymi wolumenami.
259
260 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
261 potrzeby initrd.
262
263 %prep
264 %setup -q -n LVM2.%{version}
265 %{?with_selinux:%patch0 -p1}
266 %patch1 -p1
267 %patch2 -p1
268 %patch3 -p1
269 %patch4 -p1
270 %patch6 -p1
271 %patch7 -p1
272 %patch8 -p1
273
274 # do not force --export-symbol linker option for e.g. statically linked executables
275 # -rdynamic compiler option drives linker in the right way.
276 %{__sed} -i -e 's#-Wl,--export-dynamic#-rdynamic#g' configure.in
277
278 %build
279 %if %{with initrd}
280 echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd
281 %endif
282 cp -f /usr/share/automake/config.sub autoconf
283 %{__aclocal}
284 %{__autoconf}
285
286 %if %{with initrd}
287 %{?with_glibc:export CC="%{__cc}"}
288 %{?with_uClibc:export CC="%{_target_cpu}-uclibc-gcc"}
289 %{?with_dietlibc:cc="%{__cc}"; export CC="diet ${cc#ccache }"}
290
291 %configure \
292         ac_cv_lib_dl_dlopen=no \
293         %{?with_uClibc:ac_cv_func_siginterrupt=no} \
294         %{?debug:--enable-debug} \
295         --disable-nls \
296         --disable-readline \
297         --enable-selinux%{!?with_glibc:=no} \
298         --enable-static_link \
299         --with-lvm1=internal \
300         --with-optimisation="%{rpmcflags} -Os"
301 # glibc version links with normal static libdevicemapper which has selinux enabled
302 # and we need to keep these in sync between device-mapper and lvm2
303
304 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
305 %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h
306
307 %{__make} -j1 -C include
308 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
309 %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
310 %{__make} -j1 -C libdaemon/client LIB_SHARED= VERSIONED_SHLIB=
311 %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"}
312 mv -f tools/lvm.static initrd-lvm
313 mv -f tools/dmsetup.static initrd-dmsetup
314
315 # check if tools works
316 for tool in initrd-lvm initrd-dmsetup; do
317         LVM_SYSTEM_DIR=$(pwd) ./$tool help && rc=$? || rc=$?
318         if [ $rc -gt 127 ]; then
319                 echo >&2 "Unexpected failure (exit status: $rc) from $tool. Does this tool work?!"
320                 exit 1
321         fi
322 done
323
324
325 %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
326 %{__make} clean
327
328 unset CC
329 %endif
330
331 %configure \
332         --disable-udev-systemd-background-jobs \
333         --enable-applib \
334         --enable-cmdlib \
335         %{?debug:--enable-debug} \
336         --enable-dmeventd \
337         --enable-fsadm \
338         %{?with_lvmetad:--enable-lvmetad} \
339         --enable-ocf \
340         --enable-readline \
341         %{!?with_selinux:--disable-selinux} \
342         --enable-pkgconfig \
343         --enable-udev_sync \
344         --enable-udev_rules \
345         --with-cluster=internal \
346 %if %{with cluster}
347         --with-clvmd=corosync \
348         --enable-cmirrord \
349 %endif
350         --with-dmeventd-path=%{_sbindir}/dmeventd \
351         --with-interface=ioctl \
352         --with-lvm1=internal \
353         --with-mirrors=internal \
354         --with-optimisation="%{rpmcflags}" \
355         --with-pool=internal \
356         --with-snapshots=internal \
357         --with-thin=internal \
358         --with-thin-check=%{_sbindir}/thin_check \
359         --with-thin-dump=%{_sbindir}/thin_dump \
360         --with-thin-repair=%{_sbindir}/thin_repair \
361         --with-udev-prefix=/ \
362         --with-usrlibdir=%{_libdir}
363
364 %{__make} -j1
365 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
366
367 %install
368 rm -rf $RPM_BUILD_ROOT
369 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig}
370 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
371
372 %{__make} install install_system_dirs install_initscripts \
373         DESTDIR=$RPM_BUILD_ROOT \
374         OWNER="" \
375         GROUP=""
376
377 install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
378 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
379
380 %if %{with cluster}
381 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/clvmd
382 %endif
383
384 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
385 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
386         lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
387         slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
388         ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
389 done
390
391 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
392
393 %if %{with initrd}
394 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
395 install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
396 install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
397
398 %{?with_dietlibc:cp -a diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
399 %endif
400
401 cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
402
403 %clean
404 rm -rf $RPM_BUILD_ROOT
405
406 %post
407 /sbin/chkconfig --add lvm2-monitor
408 %service lvm2-monitor restart
409 /sbin/chkconfig --add blk-availability
410
411 %postun
412 if [ "$1" = "0" ]; then
413         %service lvm2-monitor stop
414         /sbin/chkconfig --del lvm2-monitor
415         #no service blk-availability stop
416         /sbin/chkconfig --del blk-availability
417 fi
418
419 %post -n device-mapper
420 /sbin/ldconfig
421
422 %postun -n device-mapper
423 /sbin/ldconfig
424
425 %post clvmd
426 /sbin/chkconfig --add clvmd
427 # no service restart - it breaks current locks!
428 export NORESTART=1
429 # re-exec instead
430 /usr/sbin/clvmd -S 2>/dev/null || :
431
432 %postun clvmd
433 if [ "$1" = "0" ]; then
434         %service clvmd stop
435         /sbin/chkconfig --del clvmd
436 fi
437
438 %files
439 %defattr(644,root,root,755)
440 %doc README WHATS_NEW doc/*
441 %attr(755,root,root) %{_sbindir}/blkdeactivate
442 %attr(755,root,root) %{_sbindir}/fsadm
443 %attr(755,root,root) %{_sbindir}/lv*
444 %attr(755,root,root) %{_sbindir}/pv*
445 %attr(755,root,root) %{_sbindir}/vg*
446 %{_mandir}/man5/lvm.conf.5*
447 %{_mandir}/man7/lvmthin.7*
448 %{_mandir}/man8/blkdeactivate.8*
449 %{_mandir}/man8/fsadm.8*
450 %{_mandir}/man8/lv*.8*
451 %{_mandir}/man8/pv*.8*
452 %{_mandir}/man8/vg*.8*
453 %attr(750,root,root) %dir %{_sysconfdir}/lvm
454 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
455 %attr(750,root,root) %dir %{_sysconfdir}/lvm/profile
456 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/command_profile_template.profile
457 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/metadata_profile_template.profile
458 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/thin-generic.profile
459 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/thin-performance.profile
460 %if %{with lvmetad}
461 /lib/udev/rules.d/69-dm-lvm-metad.rules
462 %endif
463 %{_sysconfdir}/tmpfiles.d/lvm2.conf
464 %dir %{_sysconfdir}/lvm/cache
465 %ghost %{_sysconfdir}/lvm/cache/.cache
466 %attr(754,root,root) /etc/rc.d/init.d/blk-availability
467 %if %{with lvmetad}
468 %attr(754,root,root) /etc/rc.d/init.d/lvm2-lvmetad
469 %endif
470 %attr(754,root,root) /etc/rc.d/init.d/lvm2-monitor
471 %dir %attr(700,root,root) /var/run/lvm
472
473 %if %{with cluster}
474 %files clvmd
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{_usrsbindir}/clvmd
477 %attr(754,root,root) /etc/rc.d/init.d/clvmd
478 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clvmd
479 %{_mandir}/man8/clvmd.8*
480
481 %files cmirrord
482 %defattr(644,root,root,755)
483 %attr(755,root,root) %{_usrsbindir}/cmirrord
484 %attr(754,root,root) /etc/rc.d/init.d/cmirrord
485 %{_mandir}/man8/cmirrord.8*
486 %endif
487
488 %files resource-agents
489 %defattr(644,root,root,755)
490 %dir %{_prefix}/lib/ocf/resource.d/lvm2
491 %attr(755,root,root) %{_prefix}/lib/ocf/resource.d/lvm2/VolumeGroup
492
493 %files -n device-mapper
494 %defattr(644,root,root,755)
495 %doc *_DM
496 /lib/udev/rules.d/10-dm.rules
497 /lib/udev/rules.d/11-dm-lvm.rules
498 /lib/udev/rules.d/13-dm-disk.rules
499 /lib/udev/rules.d/95-dm-notify.rules
500 %attr(755,root,root) %{_sbindir}/dmeventd
501 %attr(755,root,root) %{_sbindir}/dmsetup
502 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
503 %attr(755,root,root) /%{_lib}/liblvm2app.so.*.*
504 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
505 %dir %{_libdir}/device-mapper
506 %attr(755,root,root) %{_libdir}/device-mapper/*.so
507 %attr(755,root,root) %{_libdir}/libdevmapper-event-*.so
508 %{_mandir}/man8/dmsetup.8*
509 %{_mandir}/man8/dmeventd.8*
510
511 %files -n device-mapper-devel
512 %defattr(644,root,root,755)
513 %attr(755,root,root) %{_libdir}/libdevmapper.so
514 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
515 %attr(755,root,root) %{_libdir}/liblvm2app.so
516 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
517 %{_includedir}/libdevmapper*.h
518 %{_includedir}/lvm2app.h
519 %{_includedir}/lvm2cmd.h
520 %{_pkgconfigdir}/devmapper*.pc
521 %{_pkgconfigdir}/lvm2app.pc
522
523 %files -n device-mapper-static
524 %defattr(644,root,root,755)
525 %{_libdir}/libdevmapper*.a
526
527 %if %{with initrd}
528 %if %{with dietlibc}
529 %files -n device-mapper-dietlibc
530 %defattr(644,root,root,755)
531 %{dietlibdir}/libdevmapper.a
532 %endif
533
534 %files -n device-mapper-initrd
535 %defattr(644,root,root,755)
536 %attr(755,root,root) %{_libdir}/initrd/dmsetup
537
538 %files initrd
539 %defattr(644,root,root,755)
540 %attr(755,root,root) %{_libdir}/initrd/lvm
541 %endif