diff options
author | Niels de Vos <ndevos@redhat.com> | 2013-09-30 09:05:14 +0200 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-12-24 04:12:23 -0800 |
commit | b2ee85b3e452678c330c25bf32c522090bb320fc (patch) | |
tree | edcccb745bc4b10127eb29e1e9395a2c3cfac651 /glusterfs.spec.in | |
parent | 828a6eea202e9195f323a7c4b4656c73ecb34256 (diff) |
gfapi.py: support dynamic loading of versioned librariesv3.4.2qa5
Currently gfapi.py 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 and review in the master branch:
> Change-Id: I71e38dabd3ade5dcf24813bf2fc25cda91b571c6
> Signed-off-by: Niels de Vos <ndevos@redhat.com>
> Reviewed-on: http://review.gluster.org/5835
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
BUG: 1005146
Change-Id: Id7665fe5140111be7bf2038454fb775c70b15993
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/6581
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'glusterfs.spec.in')
-rw-r--r-- | glusterfs.spec.in | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 741025c4281..d31f77265b6 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -46,6 +46,12 @@ %global _with_systemd true %endif +# From https://fedoraproject.org/wiki/Packaging:Python#Macros +%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))")} +%endif + Summary: Cluster File System %if ( 0%{_for_fedora_koji_builds} ) Name: glusterfs @@ -284,6 +290,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 @@ -294,7 +302,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 @@ -385,9 +393,17 @@ This package provides the api include files. %{__make} %{?_smp_mflags} +pushd api/examples +FLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +popd + %install %{__rm} -rf %{buildroot} %{__make} install DESTDIR=%{buildroot} +# install the gfapi Python library in /usr/lib/python*/site-packages +pushd api/examples +%{__python} setup.py install --skip-build --verbose --root %{buildroot} +popd # Install include directory %{__mkdir_p} %{buildroot}%{_includedir}/glusterfs %{__install} -p -m 0644 libglusterfs/src/*.h \ @@ -675,9 +691,7 @@ fi %exclude %{_libdir}/*.so %{_libdir}/libgfapi.* %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mount/api* -%if ( 0%{?rhel} && 0%{?rhel} > 5 ) -%{python_sitelib}/gluster/__init__.p* -%endif +%{python_sitelib}/* %if ( 0%{!?_without_ocf:1} ) %files resource-agents @@ -762,6 +776,9 @@ if [ $1 -ge 1 ]; then fi %changelog +* Mon Dec 23 2013 Niels de Vos <ndevos@redhat.com> +- Package gfapi.py into the Python site-packages path (#1005146) + * Wed Oct 9 2013 Kaleb S. KEITHLEY <kkeithle@redhat.com> - Sync with Fedora glusterfs.spec 3.4.1-2+ |