Clean up spec file, compile in lvmetad, autoactivation.

This commit is contained in:
Peter Rajnoha 2012-07-02 11:46:03 +02:00
parent e4104ab6f2
commit f8e882d209
2 changed files with 2099 additions and 81 deletions

File diff suppressed because it is too large Load Diff

127
lvm2.spec
View File

@ -1,41 +1,19 @@
%define device_mapper_version 1.02.75
%define enable_thin 0
%define enable_thin 1
%define enable_cluster 1
%define enable_openais 1
%define enable_cmirror 1
%define enable_udev 1
%define enable_systemd 1
%define udev_systemd_merge 0
%define enable_lvmetad 0
%define udev_systemd_merge 1
%define enable_lvmetad 1
%if "%{fedora}" == "12"
%define enable_systemd 0
%define enable_udev 0
%define configure_default_data_alignment --with-default-data-alignment=0
%else
%if "%{fedora}" == "13"
%define enable_systemd 0
%define udev_version 153-1
%define configure_default_data_alignment --with-default-data-alignment=0
%else
%if "%{fedora}" == "14"
%define enable_systemd 0
%define udev_version 158-1
%else
%if "%{fedora}" == "15"
%define udev_version 158-1
%else
%if "%{fedora}" == "16"
%define udev_version 158-1
%else
%if "%{fedora}" == "17"
%define udev_version 176-1
%define enable_thin 1
%define enable_openais 0
%define udev_systemd_merge 0
%define corosync_version 1.99.9-1
%else
%if 0%{?rhel}
%define enable_lvmetad 0
%else %if 0%{?rhel}
%ifarch i686 x86_64
%define enable_cluster 1
%define enable_cmirror 1
@ -43,26 +21,13 @@
%define enable_cluster 0
%define enable_cmirror 0
%endif
%define enable_thin 1
%define enable_openais 0
%define enable_lvmetad 1
%define udev_version 176-1
%define udev_systemd_merge 0
%define corosync_version 1.99.9-1
%else
# rawhide
%else # rawhide
%define udev_version 183-1
%define enable_thin 1
%define persistent_data_version 0.1.4
%define enable_openais 0
%define corosync_version 1.99.9-1
%define udev_systemd_merge 1
%endif
%endif
%endif
%endif
%endif
%endif
%endif
%if %{enable_cluster}
@ -71,15 +36,8 @@
%else
%define configure_cmirror --disable-cmirrord
%endif
%if %{enable_openais}
%define corosync_version 1.2.0-1
%define openais_version 1.1.1-1
%define clusterlib_version 3.0.6-1
%define configure_cluster --with-cluster=internal --with-clvmd=cman,openais,corosync
%else
%define dlm_version 3.99.1-1
%define configure_cluster --with-cluster=internal --with-clvmd=corosync
%endif
%else
%define configure_cluster --with-cluster=internal --with-clvmd=none
%define configure_cmirror --disable-cmirrord
@ -92,25 +50,21 @@
Summary: Userland logical volume management tools
Name: lvm2
Version: 2.02.96
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://sources.redhat.com/lvm2
Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
Patch0: lvm2-set-default-preferred_names.patch
Patch1: lvm2-2_02_97-composite-patch-for-udev-systemd-lvmetad-upstream-changes.patch
BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel
BuildRequires: ncurses-devel
BuildRequires: readline-devel
%if %{enable_cluster}
BuildRequires: corosynclib-devel >= %{corosync_version}
%if %{enable_openais}
BuildRequires: openaislib-devel >= %{openais_version}
BuildRequires: clusterlib-devel >= %{clusterlib_version}
%else
BuildRequires: dlm-devel >= %{dlm_version}
%endif
%endif
BuildRequires: module-init-tools
BuildRequires: pkgconfig
%if %{enable_udev}
@ -147,13 +101,13 @@ or more physical volumes and creating one or more logical volumes
%prep
%setup -q -n LVM2.%{version}
%patch0 -p1 -b preferred_names
%patch0 -p1 -b .preferred_names
%patch1 -p1 -b .upstream
%build
%define _exec_prefix ""
%define _bindir /bin
%define _sbindir /sbin
%define _libdir /%{_lib}
%define _default_dm_run_dir /run
%define _default_run_dir /run/lvm
%define _default_locking_dir /run/lock/lvm
%if %{enable_udev}
%define _udevbasedir /lib/udev
@ -169,7 +123,7 @@ or more physical volumes and creating one or more logical volumes
%define configure_lvmetad --enable-lvmetad
%endif
%configure --enable-lvm1_fallback --enable-fsadm --with-pool=internal --with-user= --with-group= --with-usrlibdir=/usr/%{_lib} --with-usrsbindir=/usr/sbin --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd %{configure_cluster} %{configure_cmirror} %{?configure_udev} %{?configure_default_data_alignment} %{?configure_thin} %{?configure_lvmetad}
%configure --with-default-dm-run-dir=%{_default_dm_run_dir} --with-default-run-dir=%{_default_run_dir} --with-default-locking-dir=%{_default_locking_dir} --with-usrlibdir=%{_libdir} --enable-lvm1_fallback --enable-fsadm --with-pool=internal --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd %{configure_cluster} %{configure_cmirror} %{?configure_udev} %{?configure_default_data_alignment} %{?configure_thin} %{?configure_lvmetad}
make %{?_smp_mflags}
@ -341,6 +295,7 @@ fi
%if %{enable_udev}
%{_udevdir}/11-dm-lvm.rules
%if %{enable_lvmetad}
%{_mandir}/man8/lvmetad.8.gz
%{_udevdir}/69-dm-lvm-metad.rules
%endif
%endif
@ -350,8 +305,8 @@ fi
%dir %{_sysconfdir}/lvm/backup
%dir %{_sysconfdir}/lvm/cache
%dir %{_sysconfdir}/lvm/archive
%dir %{_localstatedir}/lock/lvm
%dir %{_localstatedir}/run/lvm
%dir %{_default_locking_dir}
%dir %{_default_run_dir}
%if %{enable_systemd}
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
%{_unitdir}/lvm2-monitor.service
@ -384,12 +339,12 @@ the lvm2 libraries.
%files devel
%defattr(-,root,root,-)
/usr%{_libdir}/liblvm2app.so
/usr%{_libdir}/liblvm2cmd.so
%{_libdir}/liblvm2app.so
%{_libdir}/liblvm2cmd.so
%{_includedir}/lvm2app.h
%{_includedir}/lvm2cmd.h
/usr%{_libdir}/pkgconfig/lvm2app.pc
/usr%{_libdir}/libdevmapper-event-lvm2.so
%{_libdir}/pkgconfig/lvm2app.pc
%{_libdir}/libdevmapper-event-lvm2.so
%package libs
Summary: Shared libraries for lvm2
@ -437,12 +392,7 @@ Requires(preun): chkconfig
Requires(preun): device-mapper >= %{device_mapper_version}
Requires(preun): lvm2 >= 2.02
Requires: corosync >= %{corosync_version}
%if %{enable_openais}
Requires: openais >= %{openais_version}
Requires: cman >= %{clusterlib_version}
%else
Requires: dlm >= %{dlm_version}
%endif
%description cluster
@ -483,9 +433,6 @@ Group: System Environment/Base
Requires(post): chkconfig
Requires(preun): chkconfig
Requires: corosync >= %{corosync_version}
%if %{enable_openais}
Requires: openais >= %{openais_version}
%endif
Requires: device-mapper >= %{device_mapper_version}-%{release}
%description -n cmirror
@ -558,7 +505,7 @@ for the kernel device-mapper.
%files -n device-mapper
%defattr(-,root,root,-)
%doc COPYING COPYING.LIB WHATS_NEW_DM VERSION_DM README INSTALL
%attr(755,root,root) /sbin/dmsetup
%attr(755,root,root) %{_sbindir}/dmsetup
%{_mandir}/man8/dmsetup.8.gz
%if %{enable_udev}
%doc udev/12-dm-permissions.rules
@ -584,9 +531,9 @@ the device-mapper libraries.
%files -n device-mapper-devel
%defattr(-,root,root,-)
/usr%{_libdir}/libdevmapper.so
%{_libdir}/libdevmapper.so
%{_includedir}/libdevmapper.h
/usr%{_libdir}/pkgconfig/devmapper.pc
%{_libdir}/pkgconfig/devmapper.pc
%package -n device-mapper-libs
Summary: Device-mapper shared library
@ -690,11 +637,29 @@ the device-mapper event library.
%files -n device-mapper-event-devel
%defattr(-,root,root,-)
/usr%{_libdir}/libdevmapper-event.so
%{_libdir}/libdevmapper-event.so
%{_includedir}/libdevmapper-event.h
/usr%{_libdir}/pkgconfig/devmapper-event.pc
%{_libdir}/pkgconfig/devmapper-event.pc
%changelog
* Mon Jul 02 2012 Peter Rajnoha <prajnoha@redhat.com> - 2.02.96-2
- Compile with lvmetad support enabled.
- Add support for volume autoactivation using lvmetad.
- Update man pages with --activate ay option and auto_activation_volume_list.
- Use vgchange -aay instead of vgchange -ay in clmvd init script.
- Add activation/auto_activation_volume_list to lvm.conf.
- Add --activate ay to lvcreate, lvchange, pvscan and vgchange.
- Add --activate synonym for --available arg and prefer --activate.
- Open device read-only to obtain readahead value.
- Add configure --enable-udev-rule-exec-detection to detect exec path in rules.
- Use sbindir in udev rules by default and remove executable path detection.
- Remove hard-coded paths for dmeventd fifos and use default-dm-run-dir.
- Add configure --with-lvmetad-pidfile to remove hard-coded value.
- Add configure --with-default-pid-dir for common directory with pid files.
- Add configure --with-default-dm-run-dir to set run directory for dm tools.
- Add documentation references in systemd units.
- Clean up spec file and keep support only for Fedora 17 upwards.
* Mon Jun 18 2012 Alasdair Kergon <agk@redhat.com> - 2.02.96-1
- Require device-mapper-persistent-data package for thin provisioning.
- Set delay_resume_if_new on deptree snapshot origin.