[libtalloc] - Install python bindings in the correct location

Stephen Gallagher sgallagh at fedoraproject.org
Wed Jan 12 20:17:11 UTC 2011


commit de580c654eb2298c21301baaf70df32343780029
Author: Stephen Gallagher <sgallagh at redhat.com>
Date:   Wed Jan 12 15:17:00 2011 -0500

    - Install python bindings in the correct location

 ...hon-bindings-in-the-arch-specific-locatio.patch |   35 ++++++++++++++++++++
 libtalloc.spec                                     |   28 +++++++++-------
 2 files changed, 51 insertions(+), 12 deletions(-)
---
diff --git a/0001-Install-python-bindings-in-the-arch-specific-locatio.patch b/0001-Install-python-bindings-in-the-arch-specific-locatio.patch
new file mode 100644
index 0000000..0488a1e
--- /dev/null
+++ b/0001-Install-python-bindings-in-the-arch-specific-locatio.patch
@@ -0,0 +1,35 @@
+From feff3aad50304450248aa66aed59d09439699234 Mon Sep 17 00:00:00 2001
+From: Stephen Gallagher <sgallagh at redhat.com>
+Date: Wed, 12 Jan 2011 15:01:52 -0500
+Subject: [PATCH] Install python bindings in the arch-specific location
+
+---
+ buildtools/wafsamba/samba_python.py |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
+index a663b1910d063336c1340142ae8855d7e176ecdb..9b72f3fd112288a022a2de0701594814616f202f 100644
+--- a/buildtools/wafsamba/samba_python.py
++++ b/buildtools/wafsamba/samba_python.py
+@@ -51,6 +51,9 @@ def SAMBA_PYTHON(bld, name,
+ 
+     link_name = 'python/%s' % realname
+ 
++    from distutils.sysconfig import get_python_lib
++    arch_install_dir = get_python_lib(1)
++
+     bld.SAMBA_LIBRARY(name,
+                       source=source,
+                       deps=deps,
+@@ -63,7 +66,7 @@ def SAMBA_PYTHON(bld, name,
+                       link_name=link_name,
+                       pyembed=True,
+                       target_type='PYTHON',
+-                      install_path='${PYTHONDIR}',
++                      install_path=arch_install_dir,
+                       enabled=enabled)
+ 
+ Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
+-- 
+1.7.3.4
+
diff --git a/libtalloc.spec b/libtalloc.spec
index cb043f1..91d6728 100644
--- a/libtalloc.spec
+++ b/libtalloc.spec
@@ -6,7 +6,7 @@
 
 Name: libtalloc
 Version: 2.0.5
-Release: 4%{?dist}
+Release: 6%{?dist}
 Group: System Environment/Daemons
 Summary: The talloc library
 License: LGPLv3+
@@ -19,6 +19,9 @@ BuildRequires: libxslt
 BuildRequires: docbook-style-xsl
 BuildRequires: python-devel
 
+# Patches
+Patch0001: 0001-Install-python-bindings-in-the-arch-specific-locatio.patch
+
 %description
 A library that implements a hierarchical allocator with destructors.
 
@@ -49,6 +52,7 @@ Development libraries for pytalloc
 
 %prep
 %setup -q -n talloc-%{version}
+%patch0001 -p1
 
 %build
 ./autogen.sh
@@ -63,13 +67,6 @@ make install DESTDIR=$RPM_BUILD_ROOT
 rm -f $RPM_BUILD_ROOT%{_libdir}/libtalloc.a
 rm -f $RPM_BUILD_ROOT/usr/share/swig/*/talloc.i
 
-# Work around incorrect build-system location
-if [ ! -e $RPM_BUILD_ROOT/%{python_sitearch}/talloc.so ]; then
-    mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}
-    mv $RPM_BUILD_ROOT/usr/lib/python%{python_version}/site-packages/talloc.so \
-       $RPM_BUILD_ROOT/%{python_sitearch}
-fi
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -95,13 +92,20 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/pytalloc-util.pc
 %{_libdir}/libpytalloc-util.so
 
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
 
-%postun
-/sbin/ldconfig
+%post -n pytalloc -p /sbin/ldconfig
+%postun -n pytalloc -p /sbin/ldconfig
 
 %changelog
+* Wed Jan 12 2011 Stephen Gallagher <sgallagh at redhat.com> - 2.0.5-6
+- Install python bindings in the correct location
+
+* Tue Jan 11 2011 Stephen Gallagher <sgallagh at redhat.com> - 2.0.5-5
+- Run ldconfig on pytalloc
+
 * Tue Jan 11 2011 Stephen Gallagher <sgallagh at redhat.com> - 2.0.5-4
 - Fix build failure on 32-bit platforms
 


More information about the scm-commits mailing list