Use pkg-config for smbclient include_dirs, fixing rebuild failure.

f38
Tim Waugh 12 years ago
parent e242512dbd
commit d8fbcd20b5

@ -0,0 +1,58 @@
diff -up pysmbc-1.0.13/Makefile.pkg-config pysmbc-1.0.13/Makefile
--- pysmbc-1.0.13/Makefile.pkg-config 2010-08-22 15:59:36.000000000 +0100
+++ pysmbc-1.0.13/Makefile 2012-11-21 12:44:29.051173967 +0000
@@ -4,7 +4,7 @@ SDIST_ARGS=--formats=bztar -d.
smbc.so: force
python setup.py build
- mv build/lib*/$@ .
+ mv build/lib*/smbc*.so .
doc: smbc.so
rm -rf html
@@ -14,7 +14,7 @@ doczip: doc
cd html && zip ../smbc-html.zip *
clean:
- -rm -rf build smbc.so *.pyc tests/*.pyc *~ tests/*~
+ -rm -rf build smbc*.so *.pyc tests/*.pyc *~ tests/*~
dist:
python setup.py sdist $(SDIST_ARGS)
diff -up pysmbc-1.0.13/setup.py.pkg-config pysmbc-1.0.13/setup.py
--- pysmbc-1.0.13/setup.py.pkg-config 2012-02-15 16:12:44.000000000 +0000
+++ pysmbc-1.0.13/setup.py 2012-11-21 12:45:05.362285519 +0000
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-## Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011 Red Hat, Inc
+## Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011, 2012 Red Hat, Inc
## Copyright (C) 2010 Open Source Solution Technology Corporation
## Authors:
## Tim Waugh <twaugh@redhat.com>
@@ -51,6 +51,18 @@ hello
"""
from distutils.core import setup, Extension
+import subprocess
+
+def pkgconfig_I (pkg):
+ dirs = []
+ c = subprocess.Popen (["pkg-config", "--cflags", pkg],
+ stdout=subprocess.PIPE)
+ (stdout, stderr) = c.communicate ()
+ for p in stdout.decode (encoding='ascii').split ():
+ if p.startswith ("-I"):
+ dirs.append (p[2:])
+ return dirs
+
setup (name="pysmbc",
version="1.0.13",
description="Python bindings for libsmbclient",
@@ -74,4 +86,5 @@ setup (name="pysmbc",
"dir.c",
"file.c",
"smbcdirent.c"],
- libraries=["smbclient"])])
+ libraries=["smbclient"],
+ include_dirs=pkgconfig_I("smbclient"))])

@ -10,9 +10,10 @@
Summary: Python bindings for libsmbclient API from Samba
Name: python-smbc
Version: 1.0.13
Release: 5%{?dist}
Release: 6%{?dist}
URL: http://cyberelk.net/tim/software/pysmbc/
Source: http://pypi.python.org/packages/source/p/pysmbc/pysmbc-%{version}.tar.bz2
Patch1: python-smbc-pkg-config.patch
License: GPLv2+
Group: Development/Languages
BuildRequires: python2-devel
@ -49,6 +50,7 @@ Documentation for python-smbc.
%prep
%setup -q -n pysmbc-%{version}
%patch1 -p1 -b .pkg-config
%if 0%{?with_python3}
rm -rf %{py3dir}
@ -100,6 +102,9 @@ chmod 755 %{buildroot}%{python_sitearch}/smbc.so
%changelog
* Wed Nov 21 2012 Tim Waugh <twaugh@redhat.com> - 1.0.13-6
- Use pkg-config for smbclient include_dirs, fixing rebuild failure.
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 1.0.13-5
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

Loading…
Cancel
Save