trying to conciliate --with-python= requirements and RPM builds, a PITA

* configure.in libxml.spec.in python/Makefile.am: trying
  to conciliate --with-python= requirements and RPM builds,
  a PITA really...
Daniel
diff --git a/ChangeLog b/ChangeLog
index 2165ac3..85f869a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed May 14 14:56:46 EDT 2003 Daniel Veillard <daniel@veillard.com>
+
+	* configure.in libxml.spec.in python/Makefile.am: trying
+	  to conciliate --with-python= requirements and RPM builds,
+	  a PITA really...
+
 Tue May 13 18:30:34 EDT 2003 Daniel Veillard <daniel@veillard.com>
 
 	* HTMLparser.c: oops last commit introduced a memory leak.
diff --git a/configure.in b/configure.in
index c6b8149..a2dfa32 100644
--- a/configure.in
+++ b/configure.in
@@ -251,6 +251,7 @@
 PYTHON_VERSION=
 PYTHON_INCLUDES=
 PYTHON_SITE_PACKAGES=
+pythondir=
 AC_ARG_WITH(python,
 [  --with-python[[=DIR]]     build Python bindings if found])
 if test "$with_python" != "no" ; then
@@ -299,6 +300,12 @@
 	    fi
 	fi
     fi
+    if test "$with_python" != ""
+    then
+        pythondir='$(PYTHON_SITE_PACKAGES)'
+    else
+        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
+    fi
 fi
 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
 if test "$PYTHON_INCLUDES" != ""
@@ -307,6 +314,7 @@
 else
     PYTHON_SUBDIR=
 fi
+AC_SUBST(pythondir)
 AC_SUBST(PYTHON_SUBDIR)
 
 dnl
diff --git a/libxml.spec.in b/libxml.spec.in
index ef9471c..c9b10a1 100644
--- a/libxml.spec.in
+++ b/libxml.spec.in
@@ -1,7 +1,7 @@
 Summary: Library providing XML and HTML support
 Name: libxml2
 Version: @VERSION@
-Release: 1
+Release: 667
 License: MIT
 Group: Development/Libraries
 Source: ftp://xmlsoft.org/libxml2-%{version}.tar.gz
@@ -73,26 +73,6 @@
 
 %makeinstall
 
-#
-# this is a bit ugly but tries to generate the bindings for all versions
-# of python installed
-#
-for i in %{prefix}/include/python*
-do
-    py_version=`echo $i | sed "s+%{prefix}/include/python++"`
-    if test -x %{prefix}/bin/python$py_version
-    then
-        echo generating bindings for Python $py_version
-      (cd python ; make clean ; \
-         make PYTHON="%{prefix}/bin/python$py_version" \
-            PYTHON_INCLUDES="%{prefix}/include/python$py_version" \
-            PYTHON_VERSION="$py_version"; \
-%makeinstall PYTHON="%{prefix}/bin/python$py_version" \
-            PYTHON_INCLUDES="%{prefix}/include/python$py_version" \
-            PYTHON_VERSION="$py_version" )
-    fi
-done
-
 %clean
 rm -fr %{buildroot}
 
diff --git a/python/Makefile.am b/python/Makefile.am
index 5d97657..d1e0808 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -31,7 +31,6 @@
 
 all-local:	libxml2.py
 
-pythondir = $(libdir)/python${PYTHON_VERSION}/site-packages
 python_LTLIBRARIES = libxml2mod.la
 
 libxml2mod_la_SOURCES = libxml.c types.c libxml2-py.c
@@ -41,9 +40,9 @@
 	cat $(srcdir)/libxml.py $(srcdir)/libxml2class.py > libxml2.py
 
 install-data-local:
-	$(mkinstalldirs) $(DESTDIR)$(libdir)/python${PYTHON_VERSION}/site-packages
-	@INSTALL@ -m 0644 libxml2.py $(DESTDIR)$(libdir)/python${PYTHON_VERSION}/site-packages
-	@INSTALL@ -m 0644 drv_libxml2.py $(DESTDIR)$(libdir)/python${PYTHON_VERSION}/site-packages
+	$(mkinstalldirs) $(DESTDIR)$(pythondir)
+	@INSTALL@ -m 0644 libxml2.py $(DESTDIR)$(pythondir)
+	@INSTALL@ -m 0644 drv_libxml2.py $(DESTDIR)$(pythondir)
 	$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
 	@(for doc in $(DOCS) ; \
 	   do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)