]> git.pld-linux.org Git - packages/lvm2.git/blob - lvm2.spec
- fix path to the 'lvm' binary compiled into some other binaries
[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 # - OCF agents?
5 #
6 # Conditional build:
7 %bcond_without  initrd          # don't build initrd version
8 %bcond_without  uClibc          # link initrd version with uClibc
9 %bcond_with     dietlibc        # link initrd version with dietlibc
10 %bcond_with     glibc           # link initrd version with static GLIBC
11 %bcond_without  cluster         # disable all cluster support (clvmd&cmirrord)
12 %bcond_without  cman            # disable cman cluster support (clvmd)
13 %bcond_without  corosync        # disable corosync cluster support (clvmd&cmirrord)
14 %bcond_without  openais         # disable openais cluster support (clvmd)
15 %bcond_with     lvmetad         # enable lvmetad
16 %bcond_without  selinux         # disable SELinux
17
18 %ifarch sparc64 sparc
19 %define         with_glibc 1
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 %{without cman} && %{without corosync} && %{without openais}
38 %undefine       with_cluster
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.95
45 Release:        11
46 License:        GPL v2
47 Group:          Applications/System
48 Source0:        ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
49 # Source0-md5:  bd470a802046c807603618a443732ea7
50 Source1:        %{name}-tmpfiles.conf
51 Patch0:         %{name}-selinux.patch
52 Patch1:         %{name}-diet.patch
53 Patch2:         device-mapper-dmsetup-export.patch
54 Patch3:         %{name}-clvmd_init.patch
55 Patch4:         dl-dlsym.patch
56 Patch5:         pldize_lvm2_monitor.patch
57 Patch6:         %{name}-wrapper.patch
58 Patch7:         udev-deprecated.patch
59 Patch8:         %{name}-lvm_path.patch
60 URL:            http://sources.redhat.com/lvm2/
61 BuildRequires:  autoconf >= 2.61
62 BuildRequires:  automake
63 %{?with_selinux:BuildRequires:  libselinux-devel >= 1.10}
64 %{?with_selinux:BuildRequires:  libsepol-devel}
65 BuildRequires:  ncurses-devel
66 BuildRequires:  pkgconfig
67 BuildRequires:  readline-devel
68 BuildRequires:  rpmbuild(macros) >= 1.647
69 BuildRequires:  udev-devel >= 143
70 %if %{with initrd}
71 %if %{with dietlibc}
72 BuildRequires:  dietlibc-static >= 2:0.32-7
73 BuildConflicts: device-mapper-dietlibc
74 %endif
75 %if %{with glibc}
76 %{?with_selinux:BuildRequires:  libselinux-static}
77 %{?with_selinux:BuildRequires:  libsepol-static}
78 %endif
79 %{?with_glibc:BuildRequires:    glibc-static}
80 %{?with_uClibc:BuildRequires:   uClibc-static >= 2:0.9.29}
81 %endif
82 %if %{with cluster}
83 %{?with_cman:BuildRequires:     cluster-cman-devel}
84 BuildRequires:  cluster-dlm-devel
85 %if %{with corosync} || %{with openais}
86 BuildRequires:  corosync-devel
87 %endif
88 %{?with_openais:BuildRequires:  openais-devel >= 1.0}
89 %endif
90 Requires(post,preun,postun):    systemd-units >= 38
91 Requires:       device-mapper >= %{version}-%{release}
92 %{?with_selinux:Requires:       libselinux >= 1.10}
93 Requires:       systemd-units >= 38
94 # doesn't work with 2.4 kernels
95 Requires:       uname(release) >= 2.6
96 Obsoletes:      lvm
97 Obsoletes:      lvm2-systemd
98 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99
100 %define         _sbindir        /sbin
101 %define         _usrsbindir     /usr/sbin
102
103 # changing CFLAGS in the middle confuses confcache
104 %undefine       configure_cache
105
106 # borken on AC
107 %define         filterout_ld    -Wl,--as-needed
108
109 # for some reason known only to rpm there must be "\\|" not "\|" here
110 %define         dietarch        %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
111 %define         dietlibdir      %{_prefix}/lib/dietlibc/lib-%{dietarch}
112
113 %define         skip_post_check_so      '.*libdevmapper-event-lvm2.so.*'
114
115 %description
116 This package includes a number of utilities for creating, checking,
117 and repairing logical volumes.
118
119 %description -l pl.UTF-8
120 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
121 logicznych wolumenów dyskowych (LVM2).
122
123 %package initrd
124 Summary:        The new version of Logical Volume Manager for Linux - initrd version
125 Summary(pl.UTF-8):      Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd
126 Group:          Base
127 Conflicts:      geninitrd < 10000.18
128
129 %description initrd
130 This package includes a number of utilities for creating, checking,
131 and repairing logical volumes - staticaly linked for initrd.
132
133 %description initrd -l pl.UTF-8
134 Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania
135 logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na
136 potrzeby initrd.
137
138 %package clvmd
139 Summary:        Cluster LVM daemon
140 Summary(pl.UTF-8):      Demon clustra LVM
141 Group:          Applications/System
142 Requires:       %{name} = %{version}-%{release}
143
144 %description clvmd
145 clvmd is the daemon that distributes  LVM  metadata  updates  around
146 a cluster.   It must be running on all nodes in the cluster and will
147 give an error if a node in the cluster does not have this daemon
148 running.
149
150 %description clvmd -l pl.UTF-8
151 clvmd to demon który rozprowadza zmiany meta-danych LVM po klastrze.
152 Mysi działać na wszystkich węzłach klastra i zgłosi błąd gdy
153 jakiś węzeł w klastrze nie ma tego demona uruchomionego.
154
155 %package cmirrord
156 Summary:        Cluster mirror log daemon
157 Group:          Applications/System
158 Requires:       cluster-cman
159 Requires:       %{name} = %{version}-%{release}
160
161 %description cmirrord
162 cmirrord is the daemon that tracks mirror log information in a cluster.
163 It is specific to device-mapper based mirrors (and by extension, LVM cluster
164 mirrors). Cluster mirrors are not possible without this daemon running.
165
166 This daemon relies on the cluster infrastructure provided by the Cluster
167 MANager (CMAN), which must be set up and running in order for cmirrord to
168 function.
169
170 %package -n device-mapper
171 Summary:        Userspace support for the device-mapper
172 Summary(pl.UTF-8):      Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
173 Group:          Base
174 Requires(post,preun,postun):    systemd-units >= 38
175 Requires:       systemd-units >= 38
176
177 %description -n device-mapper
178 The goal of this driver is to support volume management. The driver
179 enables the definition of new block devices composed of ranges of
180 sectors of existing devices. This can be used to define disk
181 partitions - or logical volumes. This light-weight kernel component
182 can support user-space tools for logical volume management.
183
184 %description -n device-mapper -l pl.UTF-8
185 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
186 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
187 sektorów na istniejących urządzeniach. Może to być wykorzystane do
188 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
189 składnik jądra może wspierać działające w przestrzeni użytkownika
190 narzędzia do zarządzania logicznymi wolumenami.
191
192 %package -n device-mapper-devel
193 Summary:        Header files and development documentation for %{name}
194 Summary(pl.UTF-8):      Pliki nagłówkowe i dokumentacja do %{name}
195 Group:          Development/Libraries
196 Requires:       device-mapper = %{version}-%{release}
197 %if %{with selinux}
198 Requires:       libselinux-devel
199 Requires:       libsepol-devel
200 %endif
201
202 %description -n device-mapper-devel
203 Header files and development documentation for %{name}.
204
205 %description -n device-mapper-devel -l pl.UTF-8
206 Pliki nagłówkowe i dokumentacja do %{name}.
207
208 %package -n device-mapper-static
209 Summary:        Static devmapper library
210 Summary(pl.UTF-8):      Statyczna biblioteka devmapper
211 License:        LGPL v2.1
212 Group:          Development/Libraries
213 Requires:       device-mapper-devel = %{version}-%{release}
214
215 %description -n device-mapper-static
216 Static devmapper library.
217
218 %description -n device-mapper-static -l pl.UTF-8
219 Statyczna biblioteka devmapper.
220
221 %package -n device-mapper-dietlibc
222 Summary:        Static devmapper library built with dietlibc
223 Summary(pl.UTF-8):      Statyczna biblioteka devmapper zbudowana z dietlibc
224 License:        LGPL v2.1
225 Group:          Development/Libraries
226 Requires:       device-mapper-devel = %{version}-%{release}
227
228 %description -n device-mapper-dietlibc
229 Static devmapper library built with dietlibc.
230
231 %description -n device-mapper-dietlibc -l pl.UTF-8
232 Statyczna biblioteka devmapper zbudowana z dietlibc.
233
234 %package -n device-mapper-initrd
235 Summary:        Userspace support for the device-mapper - initrd version
236 Summary(pl.UTF-8):      Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd
237 Group:          Base
238 Obsoletes:      device-mapper-initrd-devel
239 Conflicts:      geninitrd < 10000.10
240
241 %description -n device-mapper-initrd
242 The goal of this driver is to support volume management. The driver
243 enables the definition of new block devices composed of ranges of
244 sectors of existing devices. This can be used to define disk
245 partitions - or logical volumes. This light-weight kernel component
246 can support user-space tools for logical volume management.
247
248 This package contains dmsetup program linked staticaly for use in
249 initrd.
250
251 %description -n device-mapper-initrd -l pl.UTF-8
252 Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik
253 włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów
254 sektorów na istniejących urządzeniach. Może to być wykorzystane do
255 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
256 składnik jądra może wspierać działające w przestrzeni użytkownika
257 narzędzia do zarządzania logicznymi wolumenami.
258
259 Ten pakiet zawiera program dmsetup skonsolidowany statycznie na
260 potrzeby initrd.
261
262 %prep
263 %setup -q -n LVM2.%{version}
264 %{?with_selinux:%patch0 -p1}
265 %patch1 -p1
266 %patch2 -p1
267 %patch3 -p1
268 %patch4 -p1
269 %patch5 -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         --with-optimisation="%{rpmcflags} -Os" \
296         --enable-static_link \
297         --with-lvm1=internal \
298         --disable-selinux \
299         --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \
300         --disable-readline \
301         --disable-nls
302 # glibc version links with normal static libdevicemapper which has selinux enabled
303 # and we need to keep these in sync between device-mapper and lvm2
304
305 %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
306 %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h
307
308 %{__make} -j1 -C include
309 %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
310 %{__make} -j1 -C libdm 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         --with-usrlibdir=%{_libdir} \
333         %{?debug:--enable-debug} \
334         --with-optimisation="%{rpmcflags}" \
335         --enable-readline \
336         --enable-fsadm \
337         --enable-applib \
338         --enable-cmdlib \
339         %{?with_lvmetad:--enable-lvmetad} \
340         --enable-dmeventd \
341         --with-dmeventd-path=%{_sbindir}/dmeventd \
342         --enable-pkgconfig \
343         --enable-udev_sync \
344         --enable-udev_rules \
345 %if %{with cluster}
346         %{?with_corosync:--enable-cmirrord} \
347         --with-clvmd=%{?with_cman:cman,}%{?with_openais:openais,}%{?with_corosync:corosync} \
348 %endif
349         --with-lvm1=internal \
350         --with-pool=internal \
351         --with-cluster=internal \
352         --with-snapshots=internal \
353         --with-mirrors=internal \
354         --with-thin=internal \
355         --with-interface=ioctl \
356         --with-udev-prefix=/ \
357         --with-systemd_dir=%{systemdunitdir} \
358         %{!?with_selinux:--disable-selinux}
359
360 %{__make} -j1
361 %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a
362
363 %install
364 rm -rf $RPM_BUILD_ROOT
365 install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm}
366 %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
367
368 %{__make} install install_system_dirs install_systemd_units install_initscripts \
369         DESTDIR=$RPM_BUILD_ROOT \
370         OWNER="" \
371         GROUP=""
372
373 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
374 install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
375
376 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
377 for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do
378         lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g")
379         slib=$(basename $lib | sed -e 's#\.so\..*#.so#g')
380         ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib
381 done
382
383 touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf
384
385 %if %{with initrd}
386 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
387 install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm
388 install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup
389
390 %{?with_dietlibc:cp -a diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a}
391 %endif
392
393 cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
394
395 %clean
396 rm -rf $RPM_BUILD_ROOT
397
398 %post
399 /sbin/chkconfig --add lvm2-monitor
400 %service lvm2-monitor restart
401 %systemd_post lvm2-monitor.service
402
403 %preun
404 %systemd_preun lvm2-monitor.service
405
406 %postun
407 if [ "$1" = "0" ]; then
408         %service lvm2-monitor stop
409         /sbin/chkconfig --del lvm2-monitor
410 fi
411 %systemd_reload
412
413 %triggerpostun -- %{name} < 2.02.94-1
414 %systemd_trigger lvm2-monitor.service
415
416 %post -n device-mapper
417 /sbin/ldconfig
418 %systemd_post dm-event.socket
419
420 %preun -n device-mapper
421 %systemd_preun dm-event.socket dm-event.service
422
423 %postun -n device-mapper
424 /sbin/ldconfig
425 %systemd_reload
426
427 %triggerpostun -n device-mapper -- device-mapper < 2.02.94-1
428 %systemd_trigger dm-event.socket
429
430 %files
431 %defattr(644,root,root,755)
432 %doc README WHATS_NEW doc/*
433 %attr(755,root,root) %{_sbindir}/fsadm
434 %attr(755,root,root) %{_sbindir}/lv*
435 %attr(755,root,root) %{_sbindir}/pv*
436 %attr(755,root,root) %{_sbindir}/vg*
437 %{_mandir}/man5/lvm.conf.5*
438 %{_mandir}/man8/fsadm.8*
439 %{_mandir}/man8/lv*.8*
440 %{_mandir}/man8/pv*.8*
441 %{_mandir}/man8/vg*.8*
442 %attr(750,root,root) %dir %{_sysconfdir}/lvm
443 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
444 %{_sysconfdir}/tmpfiles.d/lvm2.conf
445 %{systemdunitdir}/lvm2-monitor.service
446 %dir %{_sysconfdir}/lvm/cache
447 %ghost %{_sysconfdir}/lvm/cache/.cache
448 %attr(754,root,root) /etc/rc.d/init.d/lvm2-monitor
449
450 %if %{with cluster}
451 %files clvmd
452 %defattr(644,root,root,755)
453 %attr(755,root,root) %{_usrsbindir}/clvmd
454 %attr(754,root,root) /etc/rc.d/init.d/clvmd
455 %{_mandir}/man8/clvmd.8*
456
457 %if %{with corosync}
458 %files cmirrord
459 %defattr(644,root,root,755)
460 %attr(755,root,root) %{_usrsbindir}/cmirrord
461 %{_mandir}/man8/cmirrord.8*
462 %attr(754,root,root) /etc/rc.d/init.d/cmirrord
463 %endif
464 %endif
465
466 %files -n device-mapper
467 %defattr(644,root,root,755)
468 %doc *_DM
469 %{systemdunitdir}/dm-event.service
470 %{systemdunitdir}/dm-event.socket
471 /lib/udev/rules.d/10-dm.rules
472 /lib/udev/rules.d/11-dm-lvm.rules
473 /lib/udev/rules.d/13-dm-disk.rules
474 /lib/udev/rules.d/95-dm-notify.rules
475 %attr(755,root,root) %{_sbindir}/dmeventd
476 %attr(755,root,root) %{_sbindir}/dmsetup
477 %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.*
478 %attr(755,root,root) /%{_lib}/liblvm2app.so.*.*
479 %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.*
480 %dir %{_libdir}/device-mapper
481 %attr(755,root,root) %{_libdir}/device-mapper/*.so
482 %attr(755,root,root) %{_libdir}/libdevmapper-event-*.so
483 %{_mandir}/man8/dmsetup.8*
484 %{_mandir}/man8/dmeventd.8*
485
486 %files -n device-mapper-devel
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_libdir}/libdevmapper.so
489 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
490 %attr(755,root,root) %{_libdir}/liblvm2app.so
491 %attr(755,root,root) %{_libdir}/liblvm2cmd.so
492 %{_includedir}/libdevmapper*.h
493 %{_includedir}/lvm2app.h
494 %{_includedir}/lvm2cmd.h
495 %{_pkgconfigdir}/devmapper*.pc
496 %{_pkgconfigdir}/lvm2app.pc
497
498 %files -n device-mapper-static
499 %defattr(644,root,root,755)
500 %{_libdir}/libdevmapper*.a
501
502 %if %{with initrd}
503 %if %{with dietlibc}
504 %files -n device-mapper-dietlibc
505 %defattr(644,root,root,755)
506 %{dietlibdir}/libdevmapper.a
507 %endif
508
509 %files -n device-mapper-initrd
510 %defattr(644,root,root,755)
511 %attr(755,root,root) %{_libdir}/initrd/dmsetup
512
513 %files initrd
514 %defattr(644,root,root,755)
515 %attr(755,root,root) %{_libdir}/initrd/lvm
516 %endif
This page took 0.069584 seconds and 3 git commands to generate.