%bcond_with sanlock # sanlock support in lvmlockd
%bcond_with replicator # internal replicator support
%bcond_without selinux # SELinux support
-%bcond_without python # Python binding
+%bcond_without python2 # Python 2.x binding
+%bcond_without python3 # Python 3.x binding
# lvmlockd requires lvmetad and lvmpolld
%if %{without lvmetad} || %{without lvmpolld}
Summary: The new version of Logical Volume Manager for Linux
Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa
Name: lvm2
-Version: 2.02.132
+Version: 2.02.162
Release: 1
License: GPL v2 and LGPL v2.1
Group: Applications/System
Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
-# Source0-md5: 80af5af726949bbbb2aceb15b24b7d20
+# Source0-md5: cc108c19b1e1b5b2002fb0a9bcb2d077
Source1: clvmd.sysconfig
Patch0: %{name}-selinux.patch
Patch1: %{name}-diet.patch
Patch6: %{name}-lvm_path.patch
Patch7: %{name}-clvmd_cmd_timeout.patch
Patch8: device-mapper-dmsetup-deps-export.patch
+Patch9: %{name}-run-dir.patch
URL: http://www.sourceware.org/lvm2/
BuildRequires: autoconf >= 2.61
BuildRequires: automake
# for /run detection
+BuildRequires: autoconf-archive
BuildRequires: filesystem >= 3.0-43
BuildRequires: libblkid-devel >= 2.24
%{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
%{?with_selinux:BuildRequires: libsepol-devel}
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
-%{?with_python:BuildRequires: python-devel >= 2}
+%{?with_python2:BuildRequires: python-devel >= 1:2.6}
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-modules >= 1:3.2
+%endif
BuildRequires: readline-devel
BuildRequires: rpmbuild(macros) >= 1.647
%{?with_sanlock:BuildRequires: sanlock-devel >= 3.2.4}
%description -n python-lvm -l pl.UTF-8
Interfejs Pythona do LVM2.
+%package -n python3-lvm
+Summary: Python interface to LVM2
+Summary(pl.UTF-8): Interfejs Pythona do LVM2
+Group: Libraries/Python
+Requires: device-mapper-libs = %{version}-%{release}
+
+%description -n python3-lvm
+Python interface to LVM2.
+
+%description -n python3-lvm -l pl.UTF-8
+Interfejs Pythona do LVM2.
+
%package -n device-mapper
Summary: Userspace support for the device-mapper
Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
# do not force --export-symbol linker option for e.g. statically linked executables
# -rdynamic compiler option drives linker in the right way.
%endif
%{?with_lvmetad:--enable-lvmetad} \
--enable-ocf \
- %{?with_python:--enable-python_bindings} \
+ %{?with_python2:--enable-python2-bindings} \
+ %{?with_python3:--enable-python3-bindings} \
--enable-readline \
%{!?with_selinux:--disable-selinux} \
--enable-pkgconfig \
rm -rf $RPM_BUILD_ROOT
%post
+/sbin/chkconfig --add lvm2-lvmetad
+%service lvm2-lvmetad restart
/sbin/chkconfig --add lvm2-monitor
%service lvm2-monitor restart
+/sbin/chkconfig --add lvm2-lvmpolld
+%service lvm2-lvmpolld restart
+# no service restart available
/sbin/chkconfig --add blk-availability
-# no service blk-availability restart
-%postun
+%preun
if [ "$1" = "0" ]; then
+ %service lvm2-lvmetad stop
+ /sbin/chkconfig --del lvm2-lvmetad
+ %service lvm2-lvmpolld stop
+ /sbin/chkconfig --del lvm2-lvmpolld
%service lvm2-monitor stop
/sbin/chkconfig --del lvm2-monitor
- #no service blk-availability stop
/sbin/chkconfig --del blk-availability
fi
# re-exec instead
/usr/sbin/clvmd -S 2>/dev/null || :
-%postun clvmd
+%preun clvmd
if [ "$1" = "0" ]; then
%service clvmd stop
/sbin/chkconfig --del clvmd
%attr(754,root,root) /etc/rc.d/init.d/lvm2-lvmpolld
%endif
%attr(754,root,root) /etc/rc.d/init.d/lvm2-monitor
-%attr(700,root,root) %dir /run/lvm
%attr(700,root,root) %dir /var/lock/lvm
+%attr(700,root,root) %dir /var/run/lvm
%if %{with cluster}
%files clvmd
%dir %{_prefix}/lib/ocf/resource.d/lvm2
%attr(755,root,root) %{_prefix}/lib/ocf/resource.d/lvm2/VolumeGroup
-%if %{with python}
+%if %{with python2}
%files -n python-lvm
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/lvm.so
%{py_sitedir}/lvm-%{version}_*-py*.egg-info
%endif
+%if %{with python3}
+%files -n python3-lvm
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/lvm*.so
+%{py3_sitedir}/lvm-%{version}_*-py*.egg-info
+%endif
+
%files -n device-mapper
%defattr(644,root,root,755)
%doc *_DM