diff --git a/.gitignore b/.gitignore index 8a5177d..39d6a7a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ lxml-2.2.7.tar.gz.asc /lxml-3.3.6.tgz.asc /lxml-3.4.4.tgz /lxml-3.4.4.tgz.asc +/lxml-3.6.4.tar.gz diff --git a/python-lxml-2.2.6-fix-2to3.patch b/python-lxml-2.2.6-fix-2to3.patch deleted file mode 100644 index 37b7743..0000000 --- a/python-lxml-2.2.6-fix-2to3.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up lxml-2.2.6/src/lxml/html/__init__.py.fix-2to3 lxml-2.2.6/src/lxml/html/__init__.py ---- lxml-2.2.6/src/lxml/html/__init__.py.fix-2to3 2010-07-26 13:36:42.333672181 -0400 -+++ lxml-2.2.6/src/lxml/html/__init__.py 2010-07-26 13:36:52.379671732 -0400 -@@ -823,7 +823,8 @@ def submit_form(form, extra_values=None, - def open_http_urllib(method, url, values): - ## FIXME: should test that it's not a relative URL or something - try: -- from urllib import urlencode, urlopen -+ from urllib import urlencode -+ from urllib import urlopen - except ImportError: # Python 3 - from urllib.request import urlopen - from urllib.parse import urlencode diff --git a/python-lxml.spec b/python-lxml.spec index 9aaef6a..ff58e25 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -1,159 +1,90 @@ -%if 0%{?fedora} > 12 -%global with_python3 1 -%endif +%global pypi_name lxml -%if 0%{?fedora} >= 20 -%global with_python3_cssselect 1 -%endif +Name: python-%{pypi_name} +Version: 3.6.4 +Release: 1%{?dist} +Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} - -Name: python-lxml -Version: 3.4.4 -Release: 5%{?dist} -Summary: ElementTree-like Python bindings for libxml2 and libxslt - -Group: Development/Libraries License: BSD URL: http://lxml.de -Source0: http://lxml.de/files/lxml-%{version}.tgz -Source1: http://lxml.de/files/lxml-%{version}.tgz.asc +Source0: https://files.pythonhosted.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +BuildRequires: libxml2-devel BuildRequires: libxslt-devel -BuildRequires: python-devel BuildRequires: python-setuptools -BuildRequires: python-cssselect -BuildRequires: Cython >= 0.20 +BuildRequires: python2-devel -Requires: python-cssselect - -%if 0%{?with_python3} -BuildRequires: python3-devel BuildRequires: python3-setuptools -%if 0%{?with_python3_cssselect} -BuildRequires: python3-cssselect -%endif -%endif +BuildRequires: python3-devel %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 -a more Pythonic interface to libxml2 and libxslt than the default -bindings. In particular, lxml deals with Python Unicode strings -rather than encoded UTF-8 and handles memory management automatically, -unlike the default bindings. +lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It +provides safe and convenient access to these libraries using the ElementTree It +extends the ElementTree API significantly to offer support for XPath, RelaxNG, +XML Schema, XSLT, C14N and much more.To contact the project, go to the project +home page < or see our bug tracker at case you want to use the current ... -%package docs -Summary: Documentation for %{name} -Group: Documentation -BuildArch: noarch -%description docs -This package provides the documentation for %{name}, e.g. the API as html. +%package -n python2-%{pypi_name} +Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API +Requires: python-cssselect +Requires: python-html5lib +Requires: python-beautifulsoup4 +%{?python_provide:%python_provide python2-%{pypi_name}} +%description -n python2-%{pypi_name} +lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It +provides safe and convenient access to these libraries using the ElementTree It +extends the ElementTree API significantly to offer support for XPath, RelaxNG, +XML Schema, XSLT, C14N and much more.To contact the project, go to the project +home page < or see our bug tracker at case you want to use the current ... -%if 0%{?with_python3} -%package -n python3-lxml -Summary: ElementTree-like Python 3 bindings for libxml2 and libxslt -Group: Development/Libraries -%if 0%{?with_python3_cssselect} +%package -n python3-%{pypi_name} +Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API Requires: python3-cssselect -%endif +Requires: python3-html5lib +Requires: python3-beautifulsoup4 +%{?python_provide:%python_provide python3-%{pypi_name}} -%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 +%description -n python3-%{pypi_name} +lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It +provides safe and convenient access to these libraries using the ElementTree It +extends the ElementTree API significantly to offer support for XPath, RelaxNG, +XML Schema, XSLT, C14N and much more.To contact the project, go to the project +home page < or see our bug tracker at case you want to use the current ... %prep -%setup -q -n lxml-%{version} - -# remove the C extension so that it will be rebuilt using the latest Cython -rm -f src/lxml/lxml.etree.c -rm -f src/lxml/lxml.etree.h -rm -f src/lxml/lxml.etree_api.h -rm -f src/lxml/lxml.objectify.c - -chmod a-x doc/rest2html.py -sed -i 's/\r//' doc/s5/ui/default/print.css \ - doc/s5/ep2008/atom.rng \ - doc/s5/ui/default/iepngfix.htc - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -r . %{py3dir} -%endif +%autosetup -n %{pypi_name}-%{version} +rm -rf %{pypi_name}.egg-info %build -CFLAGS="%{optflags}" %{__python} setup.py build --with-cython - -%if 0%{?with_python3} -cp src/lxml/lxml.etree.c %{py3dir}/src/lxml -cp src/lxml/lxml.etree.h %{py3dir}/src/lxml -cp src/lxml/lxml.etree_api.h %{py3dir}/src/lxml -cp src/lxml/lxml.objectify.c %{py3dir}/src/lxml - -pushd %{py3dir} -CFLAGS="%{optflags}" %{__python3} setup.py build --with-cython -popd -%endif +%py2_build +%py3_build %install -%{__python} setup.py install --skip-build --no-compile --with-cython --root %{buildroot} - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --no-compile --with-cython --root %{buildroot} -popd -%endif +%py3_install +%py2_install %check -BUILD_LIB_DIR=$(find $(pwd) -name "*.so" | head -n 1 | xargs dirname) -cp $BUILD_LIB_DIR/*.so src/lxml -export LANG=en_US.utf8 -%{__python} test.py -p -v -export PYTHONPATH=src -%{__python} selftest.py -%{__python} selftest2.py +%{__python2} setup.py test +%{__python3} setup.py test -%if 0%{?with_python3} -pushd %{py3dir} +%files -n python2-%{pypi_name} +%license doc/licenses/ZopePublicLicense.txt LICENSES.txt +%doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +%{python2_sitearch}/%{pypi_name} +%{python2_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info -BUILD_LIB_DIR=$(find $(pwd) -name "*.so" | head -n 1 | xargs dirname) -cp $BUILD_LIB_DIR/*.so src/lxml -export LANG=en_US.utf8 -%{__python3} test.py -p -v -export PYTHONPATH=src -%{__python3} selftest.py -%{__python3} selftest2.py - -popd -%endif - - -%files -%{!?_licensedir:%global license %%doc} -%license LICENSES.txt -%doc PKG-INFO CREDITS.txt CHANGES.txt -%{python_sitearch}/lxml -%{python_sitearch}/lxml-*.egg-info - -%files docs -%doc doc/* - -%if 0%{?with_python3} -%files -n python3-lxml -%license LICENSES.txt -%doc PKG-INFO CREDITS.txt CHANGES.txt -%{python3_sitearch}/lxml-*.egg-info -%{python3_sitearch}/lxml -%endif +%files -n python3-%{pypi_name} +%license doc/licenses/ZopePublicLicense.txt LICENSES.txt +%doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +%{python3_sitearch}/%{pypi_name} +%{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info %changelog +* Thu Sep 08 2016 Fabio Alessandro Locati - 3.6.4-1 +- Update to 3.6.4 + * Tue Jul 19 2016 Fedora Release Engineering - 3.4.4-5 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index 063e362..efabe57 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -a9a65972afc173ec7a39c585f4eea69c lxml-3.4.4.tgz -32178b79a94cff09e71b562bfa65c60a lxml-3.4.4.tgz.asc +6dd7314233029d9dab0156e7b1c7830b lxml-3.6.4.tar.gz