Blame SOURCES/python-smbc-pkg-config.patch

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