Panu Matilainen f5c5c3
--- rpm-4.11.0.1/python/setup.py.in.setuppy-fixes	2012-11-07 13:55:24.000000000 +0100
Panu Matilainen f5c5c3
+++ rpm-4.11.0.1/python/setup.py.in	2013-04-03 14:16:48.149931703 +0200
Panu Matilainen f5c5c3
@@ -1,13 +1,19 @@
Panu Matilainen f5c5c3
 #!/usr/bin/env python
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
 from distutils.core import setup, Extension
Panu Matilainen f5c5c3
+import os
Panu Matilainen f5c5c3
 import subprocess
Panu Matilainen f5c5c3
 from glob import glob
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
 def pkgconfig(what):
Panu Matilainen f5c5c3
     out = []
Panu Matilainen f5c5c3
     cmd = 'pkg-config %s %s' % (what, '@PACKAGE_NAME@')
Panu Matilainen f5c5c3
-    pcout = subprocess.check_output(cmd.split()).decode()
Panu Matilainen f5c5c3
+    env = dict(os.environ, **{'PKG_CONFIG_PATH': '..'})
Panu Matilainen f5c5c3
+    proc = subprocess.Popen(cmd.split(),
Panu Matilainen f5c5c3
+                            stdout=subprocess.PIPE,
Panu Matilainen f5c5c3
+                            stderr=subprocess.PIPE,
Panu Matilainen f5c5c3
+                            env=env)
Panu Matilainen f5c5c3
+    pcout = proc.communicate()[0].decode()
Panu Matilainen f5c5c3
     for token in pcout.split():
Panu Matilainen f5c5c3
         out.append(token[2:])
Panu Matilainen f5c5c3
     return out
Panu Matilainen f5c5c3
@@ -18,7 +24,8 @@
Panu Matilainen f5c5c3
         srcs.extend(glob('%s*.c' % n))
Panu Matilainen f5c5c3
     return srcs
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
-cflags = ['-std=c99']
Panu Matilainen f5c5c3
+cflags = ['-std=c99', '-I../include']
Panu Matilainen f5c5c3
+additional_link_args = ['-Wl,-L../rpmio/.libs', '-Wl,-L../lib/.libs', '-Wl,-L../build/.libs', '-Wl,-L../sign/.libs']
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
 rpmmod = Extension('rpm._rpm',
Panu Matilainen f5c5c3
                    sources = mksources([
Panu Matilainen f5c5c3
@@ -28,21 +35,24 @@
Panu Matilainen f5c5c3
                              ]),
Panu Matilainen f5c5c3
                    include_dirs = pkgconfig('--cflags'),
Panu Matilainen f5c5c3
                    libraries = pkgconfig('--libs'),
Panu Matilainen f5c5c3
-                   extra_compile_args = cflags
Panu Matilainen f5c5c3
+                   extra_compile_args = cflags,
Panu Matilainen f5c5c3
+                   extra_link_args = additional_link_args
Panu Matilainen f5c5c3
                   )
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
 rpmbuild_mod = Extension('rpm._rpmb',
Panu Matilainen f5c5c3
                    sources = mksources(['rpmbmodule', 'spec']),
Panu Matilainen f5c5c3
                    include_dirs = pkgconfig('--cflags'),
Panu Matilainen f5c5c3
                    libraries = pkgconfig('--libs') + ['rpmbuild'],
Panu Matilainen f5c5c3
-                   extra_compile_args = cflags
Panu Matilainen f5c5c3
+                   extra_compile_args = cflags,
Panu Matilainen f5c5c3
+                   extra_link_args = additional_link_args
Panu Matilainen f5c5c3
                   )
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
 rpmsign_mod = Extension('rpm._rpms',
Panu Matilainen f5c5c3
                    sources = mksources(['rpmbmodule']),
Panu Matilainen f5c5c3
                    include_dirs = pkgconfig('--cflags'),
Panu Matilainen f5c5c3
                    libraries = pkgconfig('--libs') + ['rpmsign'],
Panu Matilainen f5c5c3
-                   extra_compile_args = cflags
Panu Matilainen f5c5c3
+                   extra_compile_args = cflags,
Panu Matilainen f5c5c3
+                   extra_link_args = additional_link_args
Panu Matilainen f5c5c3
                   )
Panu Matilainen f5c5c3
 
Panu Matilainen f5c5c3
 setup(name='@PACKAGE_NAME@-python',