rpms/python-lxml/devel python-lxml.spec,1.38,1.39
Jeffrey C. Ollie
jcollie at fedoraproject.org
Fri Nov 6 02:01:26 UTC 2009
Author: jcollie
Update of /cvs/pkgs/rpms/python-lxml/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv19029
Modified Files:
python-lxml.spec
Log Message:
* Thu Nov 5 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 2.2.3-2
- Add option to build a Python 3 subpackage, original patch by David Malcolm
Index: python-lxml.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-lxml/devel/python-lxml.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -r1.38 -r1.39
--- python-lxml.spec 30 Oct 2009 20:57:17 -0000 1.38
+++ python-lxml.spec 6 Nov 2009 02:01:26 -0000 1.39
@@ -1,8 +1,14 @@
+%global with_python3 0
+
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%if %{with_python3}
+%{!?python3_sitearch: %define python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%endif
+
Name: python-lxml
Version: 2.2.3
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: ElementTree-like Python bindings for libxml2 and libxslt
Group: Development/Libraries
@@ -20,6 +26,12 @@ BuildRequires: python-setuptools-devel
BuildRequires: python-setuptools
%endif
+%if %{with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%global py3dir ../python3-lxml-%{version}
+%endif
+
%description
lxml provides a Python binding to the libxslt and libxml2 libraries.
It follows the ElementTree API as much as possible in order to provide
@@ -28,18 +40,49 @@ bindings. In particular, lxml deals wit
rather than encoded UTF-8 and handles memory management automatically,
unlike the default bindings.
+%if %{with_python3}
+%package -n python3-lxml
+Summary: ElementTree-like Python 3 bindings for libxml2 and libxslt
+Group: Development/Libraries
+
+%description -n python3-lxml
+lxml provides a Python 3 binding to the libxslt and libxml2 libraries.
+It follows the ElementTree API as much as possible in order to provide
+a more Pythonic interface to libxml2 and libxslt than the default
+bindings. In particular, lxml deals with Python 3 Unicode strings
+rather than encoded UTF-8 and handles memory management automatically,
+unlike the default bindings.
+%endif
+
%prep
%setup -q -n lxml-%{version}
chmod a-x doc/rest2html.py
+%if %{with_python3}
+cp -r . %{py3dir}
+chmod a-x %{py3dir}/doc/rest2html.py
+%endif
+
%build
CFLAGS="%{optflags}" %{__python} -c 'import setuptools; execfile("setup.py")' build
+%if %{with_python3}
+pushd %{py3dir}
+CFLAGS="%{optflags}" %{__python3} setup.py build
+popd
+%endif
+
%install
rm -rf %{buildroot}
%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot}
+%if %{with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
+
%clean
rm -rf %{buildroot}
@@ -48,7 +91,17 @@ rm -rf %{buildroot}
%doc README.txt LICENSES.txt PKG-INFO CREDITS.txt CHANGES.txt doc/
%{python_sitearch}/*
+%if %{with_python3}
+%files -n python3-lxml
+%defattr(-,root,root,-)
+%doc README.txt LICENSES.txt PKG-INFO CREDITS.txt CHANGES.txt doc/
+%{python3_sitearch}/*
+%endif
+
%changelog
+* Thu Nov 5 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 2.2.3-2
+- Add option to build a Python 3 subpackage, original patch by David Malcolm
+
* Fri Oct 30 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 2.2.3-1
- 2.2.3 (2009-10-30)
- Bugs fixed
More information about the fedora-extras-commits
mailing list