master - config: fix copy error in examples
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4b47ee529639c7...
Commit: 4b47ee529639c7dd5ced56d7729747fe26b458e7
Parent: cf06d942b8aad5643fe0a20be49279d06f3bee62
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Nov 3 11:07:27 2015 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Nov 3 11:07:27 2015 -0600
config: fix copy error in examples
The same example was copied without
changing the variable name.
---
lib/config/config_settings.h | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index dd2b407..52954d5 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1066,9 +1066,9 @@ cfg_array(activation_volume_list_CFG, "volume_list", activation_CFG_SECTION, CFG
" or VG.\n"
" @*\n"
" Selects an LV if a tag defined on the host is also set on the LV\n"
- " or VG. See tags/hosttags. If any host tags exist but volume_list\n"
- " is not defined, a default single-entry list containing '@*' is\n"
- " assumed.\n"
+ " or VG. See tags/hosttags. If any host tags exist but the volume\n"
+ " list is not defined, a default single-entry list containing '@*'\n"
+ " is assumed.\n"
"#\n"
"Example\n"
"volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
@@ -1102,12 +1102,12 @@ cfg_array(activation_auto_activation_volume_list_CFG, "auto_activation_volume_li
" or VG.\n"
" @*\n"
" Selects an LV if a tag defined on the host is also set on the LV\n"
- " or VG. See tags/hosttags. If any host tags exist but volume_list\n"
- " is not defined, a default single-entry list containing '@*' is\n"
- " assumed.\n"
+ " or VG. See tags/hosttags. If any host tags exist but the volume\n"
+ " list is not defined, a default single-entry list containing '@*'\n"
+ " is assumed.\n"
"#\n"
"Example\n"
- "volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
+ "auto_activation_volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
"#\n")
cfg_array(activation_read_only_volume_list_CFG, "read_only_volume_list", activation_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 89), NULL, 0, NULL,
@@ -1127,12 +1127,12 @@ cfg_array(activation_read_only_volume_list_CFG, "read_only_volume_list", activat
" or VG.\n"
" @*\n"
" Selects an LV if a tag defined on the host is also set on the LV\n"
- " or VG. See tags/hosttags. If any host tags exist but volume_list\n"
- " is not defined, a default single-entry list containing '@*' is\n"
- " assumed.\n"
+ " or VG. See tags/hosttags. If any host tags exist but the volume\n"
+ " list is not defined, a default single-entry list containing '@*'\n"
+ " is assumed.\n"
"#\n"
"Example\n"
- "volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
+ "read_only_volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
"#\n")
cfg(activation_mirror_region_size_CFG, "mirror_region_size", activation_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_RAID_REGION_SIZE, vsn(1, 0, 0), NULL, vsn(2, 2, 99),
8 years, 5 months
master - test: api subdirectory is needed in PATH by pytest
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cf06d942b8aad5...
Commit: cf06d942b8aad5643fe0a20be49279d06f3bee62
Parent: 83d3cc76f3d4bc7b2be3b61cc1fd20f2cd5bbf85
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Nov 2 14:16:46 2015 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Nov 2 14:16:46 2015 +0100
test: api subdirectory is needed in PATH by pytest
---
test/Makefile.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index f258cde..81b8cc7 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -270,7 +270,7 @@ lib/paths-installed: lib/paths-common
$(RM) $@-t
cat lib/paths-common > $@-t
echo 'installed_testsuite=1' >> $@-t
- echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:$$PATH' >> $@-t
+ echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:@datadir@/lvm2-testsuite/api:$$PATH' >> $@-t
mv $@-t $@
lib/paths: lib/paths-common
8 years, 5 months
master - test: Run pytest with installed libs
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=83d3cc76f3d4bc...
Commit: 83d3cc76f3d4bc7b2be3b61cc1fd20f2cd5bbf85
Parent: 89574055f7a0d2e7dd10a781f5fbde4eeae1f637
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Nov 2 12:52:30 2015 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Nov 2 12:52:30 2015 +0100
test: Run pytest with installed libs
---
test/api/pytest.sh | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/test/api/pytest.sh b/test/api/pytest.sh
index 7ede416..8a8d084 100644
--- a/test/api/pytest.sh
+++ b/test/api/pytest.sh
@@ -30,15 +30,21 @@ aux prepare_dmeventd
# gdb -ex r --args python FULL_PATH/lvm2/test/api/python_lvm_unit.py -v TestLvm.test_lv_active_inactive
#Locate the python binding library to use.
-python_lib=$(find $abs_top_builddir -name lvm.so)
-# Unable to test python bindings if library not available
-test -n "$python_lib" || skip
+if [[ -n $abs_top_builddir ]]; then
+ python_lib=$(find $abs_top_builddir -name lvm.so)
+ # Unable to test python bindings if library not available
+ test -n "$python_lib" || skip "lvm2-python-libs not built"
+
+ export PYTHONPATH=$(dirname $python_lib):$PYTHONPATH
+elif rpm -q lvm2-python-libs &>/dev/null; then
+ true
+else
+ skip "lvm2-python-libs neither built nor installed"
+fi
#If you change this change the unit test case too.
aux prepare_pvs 6
-export PYTHONPATH=$(dirname $python_lib):$PYTHONPATH
-
#Setup which devices the unit test can use.
export PY_UNIT_PVS=$(cat DEVICES)
8 years, 5 months
master - spec: Add python bindings
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=89574055f7a0d2...
Commit: 89574055f7a0d2e7dd10a781f5fbde4eeae1f637
Parent: 7831a650914f35c97f9deab6b871970b303a8948
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Nov 2 11:33:13 2015 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Nov 2 12:42:32 2015 +0100
spec: Add python bindings
---
spec/build.inc | 58 +++++++++++++++++++++++++++++---------------
spec/packages.inc | 69 +++++++++++++++++++++++++++++++++++++++++-----------
spec/source.inc | 25 +++++++++++++++++++
3 files changed, 117 insertions(+), 35 deletions(-)
diff --git a/spec/build.inc b/spec/build.inc
index 7bab437..bc57436 100644
--- a/spec/build.inc
+++ b/spec/build.inc
@@ -1,3 +1,22 @@
+%with default-dm-run-dir %{_default_dm_run_dir}
+%with default-run-dir %{_default_run_dir}
+%with default-pid-dir %{_default_pid_dir}
+%with default-locking-dir %{_default_locking_dir}
+%with usrlibdir %{_libdir}
+%enableif 1 lvm1_fallback
+%enableif 1 fsadm
+%with pool internal
+%with user
+%with group
+%with device-uid 0
+%with device-gid 6
+%with device-mode 0660
+%enableif 1 pkgconfig
+%enableif 1 applib
+%enableif 1 cmdlib
+%enableif 1 dmeventd
+%enableif 1 write_install
+
%with udevdir %{_udevdir}
%enableif %{enable_cmirror} cmirrord
%enableif %{enable_udev} udev_sync
@@ -11,28 +30,22 @@
%enableif %{enable_lockd_dlm} lockd-dlm
%enableif %{enable_lockd_sanlock} lockd-sanlock
%endif
+%enableif %{enable_python} python-bindings
+%enableif %{enable_python} applib
%build
-%configure \
- --with-default-dm-run-dir=%{_default_dm_run_dir} \
- --with-default-run-dir=%{_default_run_dir} \
- --with-default-pid-dir=%{_default_pid_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 \
- --enable-write_install \
- %{configure_flags}
+
+%if %{enable_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+pushd %{py3dir}
+%configure %{configure_flags} PYTHON=/usr/bin/python3 PYTHON_CONFIG=/usr/bin/python3-config
+
+make %{?_smp_mflags}
+popd
+%endif
+
+%configure %{configure_flags}
make %{?_smp_mflags}
%{?extra_build_commands}
@@ -50,6 +63,11 @@ make install_initscripts DESTDIR=$RPM_BUILD_ROOT
%if %{enable_testsuite}
make -C test install DESTDIR=$RPM_BUILD_ROOT
%endif
+%if %{enable_python3}
+pushd %{py3dir}
+make -C python install DESTDIR=$RPM_BUILD_ROOT
+popd
+%endif
# when building an src.rpm from freestanding specfiles
test -e %{_sourcedir}/source.inc || cp source.inc build.inc packages.inc macros.inc %{_sourcedir}
diff --git a/spec/packages.inc b/spec/packages.inc
index e0a6010..6c3dfde 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -411,6 +411,60 @@ fi
%endif
##############################################################################
+# Python bindings
+##############################################################################
+%if %{enable_python}
+%package python-libs
+Summary: Python module to access LVM
+License: LGPLv2
+Group: Development/Libraries
+Provides: python-lvm = %{version}-%{release}
+Requires: %{name}-libs = %{version}-%{release}
+
+%description python-libs
+Python module to allow the creation and use of LVM
+logical volumes, physical volumes, and volume groups.
+
+%files python-libs
+%{python_sitearch}/*
+%endif
+
+%if %{enable_python3}
+%package python3-libs
+Summary: Python 3 module to access LVM
+License: LGPLv2
+Group: Development/Libraries
+Provides: python3-lvm = %{version}-%{release}
+Requires: %{name}-libs = %{version}-%{release}
+
+%description python3-libs
+Python 3 module to allow the creation and use of LVM
+logical volumes, physical volumes, and volume groups.
+
+%files python3-libs
+%{python3_sitearch}/*
+%endif
+
+##############################################################################
+# Testsuite subpackage
+##############################################################################
+%if %{enable_testsuite}
+%package testsuite
+Summary: LVM2 Testsuite
+License: LGPLv2
+Group: Development
+
+%description testsuite
+An extensive functional testsuite for LVM2.
+
+%files testsuite
+%defattr(-,root,root,-)
+%{_datadir}/lvm2-testsuite/
+%{_libexecdir}/lvm2-testsuite/
+%{_bindir}/lvm2-testsuite
+%endif
+
+##############################################################################
# Device-mapper subpackages
##############################################################################
%package -n device-mapper
@@ -571,18 +625,3 @@ the device-mapper event library.
%{_includedir}/libdevmapper-event.h
%{_libdir}/pkgconfig/devmapper-event.pc
-%if %{enable_testsuite}
-%package testsuite
-Summary: LVM2 Testsuite
-License: LGPLv2
-Group: Development
-
-%description testsuite
-An extensive functional testsuite for LVM2.
-
-%files testsuite
-%defattr(-,root,root,-)
-%{_datadir}/lvm2-testsuite/
-%{_libexecdir}/lvm2-testsuite/
-%{_bindir}/lvm2-testsuite
-%endif
diff --git a/spec/source.inc b/spec/source.inc
index 2681375..07859ba 100644
--- a/spec/source.inc
+++ b/spec/source.inc
@@ -5,6 +5,9 @@
%global enable_profiling 0
%global enable_testsuite 1
+%global enable_python 1
+# Off by default - <= does not work well with or:
+%global enable_python3 0
%global enable_udev 1
%global enable_systemd 1
%global enable_cmirror 1
@@ -65,6 +68,25 @@
##############################################################
+%if %{rhel} == 5
+%global enable_python 0
+%endif
+
+%if %{rhel} >= 8 || %{fedora} >= 20
+%global enable_python3 1
+%endif
+
+%if %{enable_python}
+ %global buildreq_python2_devel python2-devel
+ %global buildreq_python_setuptools python-setuptools
+%endif
+%if %{enable_python3}
+ %global buildreq_python3_devel python3-devel
+ %global buildreq_python_setuptools python-setuptools
+%endif
+
+##############################################################
+
%if %{fedora} == 16 || %{rhel} == 6
%global enable_systemd 0
@@ -143,6 +165,9 @@ BuildRequires: pkgconfig
%maybe BuildRequires: %{?buildreq_cluster}
%maybe BuildRequires: %{?buildreq_lockd_dlm}
%maybe BuildRequires: %{?buildreq_lockd_sanlock}
+%maybe BuildRequires: %{?buildreq_python2_devel}
+%maybe BuildRequires: %{?buildreq_python3_devel}
+%maybe BuildRequires: %{?buildreq_python_setuptools}
%description
LVM2 includes all of the support for handling read/write operations on
8 years, 5 months