From 584f279f531bd22ff8f6eca1679c1154cdb473cb Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 6 Feb 2002 12:52:40 +0000 Subject: [PATCH] the spec file will now build libxslt-python, fought with shared and other * libxslt.spec.in python/Makefile.am python/libxsl.py: the spec file will now build libxslt-python, fought with shared and other crazyness, seems to work now :-) * doc/libxslt-api.xml: regenerated Daniel --- ChangeLog | 7 +++++++ doc/libxslt-api.xml | 2 +- libxslt.spec.in | 44 ++++++++++++++++++++++++++++++++++++++++++++ python/Makefile.am | 4 ++-- python/libxsl.py | 2 +- 5 files changed, 55 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f9b72a7..742cca08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Feb 6 13:49:55 CET 2002 Daniel Veillard + + * libxslt.spec.in python/Makefile.am python/libxsl.py: the + spec file will now build libxslt-python, fought with shared + and other crazyness, seems to work now :-) + * doc/libxslt-api.xml: regenerated + Wed Feb 6 11:29:31 CET 2002 Daniel Veillard * Makefile.am configure.in tests/Makefile.am tests/*/Makefile.am diff --git a/doc/libxslt-api.xml b/doc/libxslt-api.xml index 8e47d766..f8cedc91 100644 --- a/doc/libxslt-api.xml +++ b/doc/libxslt-api.xml @@ -1392,7 +1392,7 @@ - Save the result result obtained by applying the style stylesheet to a file or URL URL + Save the result result obtained by applying the style stylesheet to a file or URL diff --git a/libxslt.spec.in b/libxslt.spec.in index 8315846b..f7690a28 100644 --- a/libxslt.spec.in +++ b/libxslt.spec.in @@ -9,6 +9,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root URL: http://xmlsoft.org/XSLT/ Requires: libxml2 >= @LIBXML_REQUIRED_VERSION@ BuildRequires: libxml2-devel >= @LIBXML_REQUIRED_VERSION@ +BuildRequires: python python-devel Prefix: %{_prefix} Docdir: %{_docdir} @@ -30,6 +31,22 @@ This C library allows to transform XML files into other XML files mechanism. To use it you need to have a version of libxml2 >= 2.3.8 installed. +%package python +Summary: Python bindings for the libxslt library +Group: Development/Libraries +Requires: libxslt = %{version} +Requires: libxml2 >= @LIBXML_REQUIRED_VERSION@ +Requires: python + +%description python +The libxslt-python package contains a module that permits applications +written in the Python programming language to use the interface +supplied by the libxslt library to apply XSLT transformations. + +This library allows to parse sytlesheets, uses the libxml2-python +to load and save XML and HTML files. Direct access to XPath and +the XSLT transformation context are possible to extend the XSLT language +with XPath functions written in Python. %prep %setup -q @@ -63,6 +80,24 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man1 install -d $RPM_BUILD_ROOT%{_mandir}/man4 make prefix=$RPM_BUILD_ROOT%{prefix} mandir=$RPM_BUILD_ROOT%{_mandir} install +# +# 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_VERSION="$py_version"; \ + make PYTHON="%{prefix}/bin/python$py_version" \ + PYTHON_VERSION="$py_version" \ + prefix=$RPM_BUILD_ROOT%{prefix} \ + mandir=$RPM_BUILD_ROOT%{_mandir} install) + fi +done %clean rm -rf $RPM_BUILD_ROOT @@ -89,6 +124,15 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/include/* %{prefix}/bin/xslt-config %{prefix}/lib/pkgconfig/libxslt.pc +%files python +%defattr(-, root, root) + +%{prefix}/lib/python*/site-packages/libxslt.py +%{prefix}/lib/python*/site-packages/_libxslt.so +%doc python/TODO +%doc python/libxsltclass.txt +%doc python/tests/*.py + %changelog diff --git a/python/Makefile.am b/python/Makefile.am index 3a4d4153..229bf4a0 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS= . tests -LIBS=-L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt $(PYTHON_SITE_PACKAGES)/_libxml.so $(LIBXML_LIBS) +LIBS=-L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt # $(PYTHON_SITE_PACKAGES)/_libxml.so $(LIBXML_LIBS) INCLUDES=-I/usr/include/python$(PYTHON_VERSION) -I$(PYTHON_INCLUDES) $(LIBXML_CFLAGS) -I$(top_srcdir) SHCFLAGS=$(INCLUDES) -Wall -fPIC -g LINK_FLAGS= -shared @@ -29,7 +29,7 @@ _libxslt.so: libxslt.o libxslt-py.o types.o _libxslt.so.dv: libxslt.o libxslt-py.o types.o rm -f _libxslt.so - $(CC) $(LINK_FLAGS) libxslt.o libxslt-py.o types.o -L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt $(HOME)/XML/python/_libxml.so $(HOME)/XML/.libs/libxml2.a -o _libxslt.so + $(CC) $(LINK_FLAGS) -o _libxslt.so libxslt.o libxslt-py.o types.o -L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt # $(HOME)/XML/python/_libxml.so $(HOME)/XML/.libs/libxml2.a install-data-local: $(mkinstalldirs) $(DESTDIR)$(PYTHON_SITE_PACKAGES) diff --git a/python/libxsl.py b/python/libxsl.py index 17c2c712..1ac305fd 100644 --- a/python/libxsl.py +++ b/python/libxsl.py @@ -1,5 +1,5 @@ -from libxml2 import * import _libxslt +from libxml2 import * # # Everything below this point is automatically generated