All pastes #1455115 Raw Edit

Mine

public text v1 · immutable
#1455115 ·published 2009-06-10 09:48 UTC
rendered paste body
Index: setup.py
===================================================================
--- setup.py	(Revision 2666)
+++ setup.py	(Arbeitskopie)
@@ -1,15 +1,27 @@
 
 
 from distutils.core import setup, Extension
+import os
+modname='libburn-1'
 
+if os.system('pkg-config --exists '+modname+' 2> /dev/null') == 0:
+    pkgcfg = os.popen('pkg-config --cflags-only-I '+modname)
+    cflags = pkgcfg.readline().strip()
+    cflags = cflags[2:].split(' -I')
+    pkgcfg.close()
+
+    pkgcfg = os.popen('pkg-config --libs-only-l '+modname)
+    libs = pkgcfg.readline().strip()
+    libs = libs[2:].split(' -l')
+    pkgcfg.close()
+
 setup(name = "python-libburn",
         version = "0.0.1",
         description = "Python bindings to libburn",
         ext_modules = [Extension("pyburn", 
             ["pyburn.cpp"],
-            libraries=[':libburn.so'],
-            include_dirs=['/usr/include/libburn'],  # FIXME: make this more 
-                                                    # portable
+            libraries=libs,
+            include_dirs=cflags,
             )]
         )