path: root/
diff options
authorNiels de Vos <>2013-09-30 09:05:14 +0200
committerAnand Avati <>2013-10-02 13:04:03 -0700
commitc499ef86a2dfd4e7727ce876b6cf18ba79c94fe5 (patch)
treecfe2a3ec9a71a8901f5e482a179caec56020a056 /
parenta66bf67965dddd9decd9210c3a530fdc85b6430c (diff) support dynamic loading of versioned libraries
Currently only loads libraries by filename ending in ".so". On an installed system without development packages, the <lib>.so filenames are not available. ctypes.util.find_library() can be used to detect the files dynamically. In addition to this, also fixing some minor indention errors and package the library into the Python site-packages path. Python applications and libraries can now access libgfapi through 'from glusterfs import gfapi'. Change-Id: I71e38dabd3ade5dcf24813bf2fc25cda91b571c6 BUG: 1005146 Signed-off-by: Niels de Vos <> Reviewed-on: Reviewed-by: Kaleb KEITHLEY <> Tested-by: Gluster Build System <>
Diffstat (limited to '')
1 files changed, 21 insertions, 1 deletions
diff --git a/ b/
index 96341adf9..8940fdc0f 100644
--- a/
+++ b/
@@ -63,6 +63,12 @@
%global _with_systemd true
+# From
+%if ( 0%{?rhel} && 0%{?rhel} <= 5 )
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Summary: Cluster File System
%if ( 0%{_for_fedora_koji_builds} )
Name: glusterfs
@@ -315,6 +321,8 @@ This package provides the glusterfs server daemon.
Summary: Clustered file-system api library
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
+# we provide the Python package/namespace 'gluster'
+Provides: python-gluster = %{version}-%{release}
%description api
GlusterFS is a clustered file-system capable of scaling to several
@@ -325,7 +333,7 @@ terms of features and extensibility. It borrows a powerful concept
called Translators from GNU Hurd kernel. Much of the code in GlusterFS
is in user space and easily manageable.
-This package provides the glusterfs libgfapi library
+This package provides the glusterfs libgfapi library.
%if ( 0%{!?_without_ocf:1} )
%package resource-agents
@@ -437,9 +445,17 @@ regression testing of Gluster.
%{__make} %{?_smp_mflags}
+pushd api/examples
+FLAGS="$RPM_OPT_FLAGS" %{__python} build
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
+# install the gfapi Python library in /usr/lib/python*/site-packages
+pushd api/examples
+%{__python} install --skip-build --verbose --root %{buildroot}
# Install include directory
%{__mkdir_p} %{buildroot}%{_includedir}/glusterfs
%{__install} -p -m 0644 libglusterfs/src/*.h \
@@ -768,6 +784,7 @@ fi
%exclude %{_libdir}/*.so
%if ( 0%{!?_without_ocf:1} )
%files resource-agents
@@ -858,6 +875,9 @@ if [ $1 -ge 1 ]; then
+* Thu Sep 30 2013 Niels de Vos <>
+- Package into the Python site-packages path (#1005146)
* Tue Sep 17 2013 Harshavardhana <>
- Provide a new package called "glusterfs-regression-tests" for standalone
regression testing.