Hi

I added and tested python binding on rrdtool package, use it as you want !

Here is my comment about the patch:

add python binding
openpkg don't include package version in directory name,
rrdtool's configure expect to find include file in
"python2.5" instead of "python" directory
my patch search in both dir
I also changed setup.py, it work like that, but I'm not sure this is
required.
The change was done to make setup.py works in standalone,
after the package was installed without binding.


diff -rNu rrdtool.orig/rrdtool-python.patch rrdtool/rrdtool-python.patch
--- rrdtool.orig/rrdtool-python.patch   1970-01-01 01:00:00.000000000 +0100
+++ rrdtool/rrdtool-python.patch        2007-08-03 04:38:43.000000000 +0200
@@ -0,0 +1,27 @@
+diff -r -u rrdtool-1.2.23.orig/bindings/python/setup.py rrdtool-1.2.23
/bindings/python/setup.py
+--- rrdtool-1.2.23.orig/bindings/python/setup.py       2007-05-02 20:06:
10.000000000 +0200
++++ rrdtool-1.2.23/bindings/python/setup.py    2007-08-03 03:31:
16.000000000 +0200
+@@ -47,7 +47,7 @@
+           Extension(
+             "rrdtoolmodule",
+             ["rrdtoolmodule.c"],
+-            libraries=['rrd'],
++            libraries=['rrd', 'freetype', 'art_lgpl', 'png', 'z'],
+             runtime_library_dirs=[library_dir],
+             library_dirs=[library_dir],
+             include_dirs=[include_dir],
+diff -r -u rrdtool-1.2.23.orig/configure rrdtool-1.2.23/configure
+--- rrdtool-1.2.23.orig/configure      2007-05-02 20:07:06.000000000 +0200
++++ rrdtool-1.2.23/configure   2007-08-03 04:37:34.000000000 +0200
+@@ -27259,9 +27259,9 @@
+ echo $ECHO_N "checking for headers required to compile python
extensions... $ECHO_C" >&6
+ py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+ py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
++PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}
-I${py_prefix}/include/python"
+ if test "$py_prefix" != "$py_exec_prefix"; then
+-  PYTHON_INCLUDES="$PYTHON_INCLUDES
-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
++  PYTHON_INCLUDES="$PYTHON_INCLUDES
-I${py_exec_prefix}/include/python${PYTHON_VERSION}
-I${py_exec_prefix}/include/python"
+ fi
+
+ save_CPPFLAGS="$CPPFLAGS"
diff -rNu rrdtool.orig/rrdtool.spec rrdtool/rrdtool.spec
--- rrdtool.orig/rrdtool.spec   2007-05-14 10:05:16.000000000 +0200
+++ rrdtool/rrdtool.spec        2007-08-03 04:45:30.000000000 +0200
@@ -38,13 +38,14 @@
 Group:        Database
 License:      LGPL
 Version:      %{V_rrdtool}
-Release:      20070514
+Release:      20070514_asx

 #   list of sources
 Source0:      http://oss.oetiker.ch/rrdtool/pub/rrdtool-%{V_rrdtool}.tar.gz
 Source1:
http://www.cpan.org/authors/id/M/MS/MSCHILLI/RRDTool-OO-%{V_rrdtool_oo}.tar.gz
 Source2:
http://www.cpan.org/authors/id/N/NI/NICOLAW/RRD-Simple-%{V_rrd_simple}.tar.gz
 Patch0:       rrdtool.patch
+Patch1:       rrdtool-python.patch

 #   build information
 Prefix:       %{l_prefix}
@@ -87,7 +88,8 @@
     %setup -q
     %setup -q -D -T -a 1
     %setup -q -D -T -a 2
-    %patch -p0
+    %patch0 -p0
+    %patch1 -p1
     rm -f bindings/perl-shared/ntmake.pl

 %build
@@ -105,7 +107,7 @@
         --prefix=%{l_prefix} \
         --disable-shared \
         --disable-tcl \
-        --disable-python \
+        --enable-python \
         --disable-ruby \
         --enable-local-libpng \
         --enable-local-zlib \
@@ -139,7 +141,6 @@

     #   strip down installation hierarchy
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/rrdtool-*
     rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/rrdtutorial.es.1
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
@@ -155,4 +156,3 @@

 %clean
     rm -rf $RPM_BUILD_ROOT
-




-- 
Alain Spineux
aspineux gmail com
May the sources be with you

Reply via email to