#! /bin/sh /usr/share/dpatch/dpatch-run
## compile-bindings.dpatch by  <elektranox@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: compile python and lua bindings correctly

@DPATCH@
diff -urNad radare-1.4~/src/plug/hack/Makefile radare-1.4/src/plug/hack/Makefile
--- radare-1.4~/src/plug/hack/Makefile	2009-06-03 22:37:05.000000000 +0200
+++ radare-1.4/src/plug/hack/Makefile	2009-06-03 22:44:16.000000000 +0200
@@ -4,12 +4,12 @@
 	#-${CC} perl.c ${CFLAGS}˘${HARED_CFLAGS}${PERL_CFLAGS} ${PERL_LDFLAGS} -o perl.${SHARED_EXT}
 PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
 PERL_LIBS=`perl -MExtUtils::Embed -e ldopts` -lncurses
-PY_CFLAGS=-I${PREFIX}/include/python2.5/ -I/usr/include/python2.5/
-PY_LIBS=-lpython2.5
-PY26_CFLAGS=-I${PREFIX}/include/python2.6/ -I/usr/include/python2.6/
-PY26_LIBS=-lpython2.6
-LUA_CFLAGS=-I${PREFIX}/include/lua5.1/ -I/usr/include/lua5.1/
-LUA_LIBS=
+PY_CFLAGS=`python2.5-config --cflags`
+PY_LIBS=`python2.5-config --libs`
+PY26_CFLAGS=`python2.6-config --cflags`
+PY26_LIBS=`python2.6-config --libs`
+LUA_CFLAGS=`pkg-config --cflags lua5.1`
+LUA_LIBS=`pkg-config --libs lua5.1`
 RUBY_CFLAGS=-I/usr/lib/ruby/1.8/i386-linux
 RUBY_LIBS=-lruby18
 SO=${SHARED_EXT}
