Source: lvm2 Version: 2.02.111-2 Severity: wishlist Tags: patch The upstream lvm2 source includes Python bindings for the lilvm2app2.2 API. These would be useful for scripting snapshots for backups, etc., but are not enabled in the current Debian packages.
I have attached a patch I created to locally enable the Python bindings to be built and installed as a separate package (python-lvm2). I have not submitted a patch to Debian before, so apologies if I've got anything wrong (particularly the Python-related bits!). -- David Taylor
diff -Nru lvm2-2.02.111/debian/changelog lvm2-2.02.111/debian/changelog --- lvm2-2.02.111/debian/changelog 2014-09-25 21:05:16.000000000 +0200 +++ lvm2-2.02.111/debian/changelog 2014-12-21 19:55:15.000000000 +0100 @@ -1,3 +1,9 @@ +lvm2 (2.02.111-3) experimental; urgency=medium + + * Add new binary package python-lvm2, with liblvm2app2.2 python bindings. + + -- David Taylor <davidt-debian-...@yadt.co.uk> Fri, 19 Dec 2014 22:30:13 +0000 + lvm2 (2.02.111-2) unstable; urgency=medium * Install additional man-pages. (closes: #587277, #760679) diff -Nru lvm2-2.02.111/debian/control lvm2-2.02.111/debian/control --- lvm2-2.02.111/debian/control 2014-09-06 18:47:11.000000000 +0200 +++ lvm2-2.02.111/debian/control 2014-12-21 19:55:15.000000000 +0100 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Debian LVM Team <pkg-lvm-maintain...@lists.alioth.debian.org> Uploaders: Bastian Blank <wa...@debian.org> -Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 8.1.3~), dh-systemd, automake, libcman-dev (>> 2), libcorosync-dev, libdlm-dev (>> 2), libreadline-gplv2-dev, libselinux1-dev, libudev-dev, openais-dev, pkg-config +Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 8.1.3~), dh-systemd, automake, libcman-dev (>> 2), libcorosync-dev, libdlm-dev (>> 2), libreadline-gplv2-dev, libselinux1-dev, libudev-dev, openais-dev, pkg-config, dh-python, python-all-dev (>= 2.6.6-3~) Standards-Version: 3.9.5 Homepage: http://sources.redhat.com/lvm2/ Vcs-Svn: svn://svn.debian.org/pkg-lvm/lvm2/trunk/ @@ -165,6 +165,15 @@ to the basic LVM objects and provides functions to enumerate, create or modify them. +Package: python-lvm2 +Section: python +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, liblvm2app2.2 (= ${binary:Version}), ${python:Depends} +Multi-Arch: same +Description: Python bindings for LVM2 application library + This package contains the Python bindings for the lvm2app shared library. + It allows the LVM2 API to be used from Python scripts. + Package: liblvm2cmd2.02 Section: libs Architecture: any diff -Nru lvm2-2.02.111/debian/python-lvm2.install lvm2-2.02.111/debian/python-lvm2.install --- lvm2-2.02.111/debian/python-lvm2.install 1970-01-01 01:00:00.000000000 +0100 +++ lvm2-2.02.111/debian/python-lvm2.install 2014-12-21 19:55:15.000000000 +0100 @@ -0,0 +1 @@ +usr/lib/python2.7/site-packages/lvm.so diff -Nru lvm2-2.02.111/debian/rules lvm2-2.02.111/debian/rules --- lvm2-2.02.111/debian/rules 2014-09-14 23:37:03.000000000 +0200 +++ lvm2-2.02.111/debian/rules 2014-12-21 19:55:15.000000000 +0100 @@ -94,7 +94,8 @@ --enable-pkgconfig \ --enable-readline \ --enable-udev_rules \ - --enable-udev_sync + --enable-udev_sync \ + --enable-python_bindings touch $@ $(STAMPS_DIR)/setup_udeb: SOURCE_DIR = $(BUILD_DIR)/source @@ -241,6 +242,14 @@ dh_makeshlibs -V -- -c2 +$(MAKE_SELF) install-base +install_python-lvm2: export DH_OPTIONS = -ppython-lvm2 +install_python-lvm2: DIR = $(BUILD_DIR)/install_deb +install_python-lvm2: install_liblvm2 + +$(MAKE_SELF) install-base-prep INSTALL_DIR='$(DIR)' + dh_makeshlibs -V -- -c2 + dh_python2 + +$(MAKE_SELF) install-base + install_lvm2: export DH_OPTIONS = -plvm2 install_lvm2: DIR = $(BUILD_DIR)/install_deb install_lvm2: $(STAMPS_DIR)/install_deb @@ -258,7 +267,7 @@ +$(MAKE_SELF) install-base binary-indep: -binary-arch: $(addprefix install_,libdevmapper libdevmapper-udeb libdevmapper-event libdevmapper-dev dmsetup dmsetup-udeb dmeventd liblvm2 lvm2 lvm2-udeb clvm) +binary-arch: $(addprefix install_,libdevmapper libdevmapper-udeb libdevmapper-event libdevmapper-dev dmsetup dmsetup-udeb dmeventd liblvm2 python-lvm2 lvm2 lvm2-udeb clvm) binary: binary-indep binary-arch