[python-cssselect] Update to upstream 0.8. Add Python3 and EL6 support.

Eric Smith brouhaha at fedoraproject.org
Fri Jul 26 17:48:18 UTC 2013


commit 292c88ecd8d367a2878943b1e952de82bc8b282e
Author: Eric Smith <brouhaha at fedoraproject.org>
Date:   Fri Jul 26 11:47:45 2013 -0600

    Update to upstream 0.8. Add Python3 and EL6 support.

 .gitignore            |    1 +
 python-cssselect.spec |   69 +++++++++++++++++++++++++++++++++++++++++++-----
 sources               |    2 +-
 3 files changed, 63 insertions(+), 9 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 92d255c..f3e656d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /cssselect-0.7.1.tar.gz
+/cssselect-0.8.tar.gz
diff --git a/python-cssselect.spec b/python-cssselect.spec
index 13472ce..2d2bb81 100644
--- a/python-cssselect.spec
+++ b/python-cssselect.spec
@@ -1,42 +1,95 @@
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+
 Name:           python-cssselect
-Version:        0.7.1
-Release:        4%{?dist}
+Version:        0.8
+Release:        1%{?dist}
+Group:          Development/Libraries
 Summary:        Parses CSS3 Selectors and translates them to XPath 1.0
 
 License:        BSD
 URL:            http://packages.python.org/cssselect/
-Source0:        http://pypi.python.org/packages/source/c/cssselect/cssselect-0.7.1.tar.gz
+Source0:        http://pypi.python.org/packages/source/c/cssselect/cssselect-%{version}.tar.gz
 
 BuildArch:      noarch
-BuildRequires:  python2-devel
-BuildRequires:  python-lxml
+
+BuildRequires:  python2-devel python-setuptools python-lxml
+%if 0%{?with_python3}
+BuildRequires:  python3-devel python3-setuptools python3-lxml
+%endif # if with_python3
 
 %description
 Cssselect parses CSS3 Selectors and translates them to XPath 1.0 expressions. 
 Such expressions can be used in lxml or another XPath engine to find the 
 matching elements in an XML or HTML document.
 
+%if 0%{?with_python3}
+%package -n python3-cssselect
+Group:          Development/Libraries
+Summary:        Parses CSS3 Selectors and translates them to XPath 1.0
+
+%description -n python3-cssselect
+Cssselect parses CSS3 Selectors and translates them to XPath 1.0 expressions. 
+Such expressions can be used in lxml or another XPath engine to find the 
+matching elements in an XML or HTML document.
+%endif # if with_python3
+
 %prep
 %setup -q -n cssselect-%{version}
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
+%endif # with_python3
 
 %build
 python setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
 %check
 PYTHONPATH=$(pwd) python cssselect/tests.py
+%if 0%{?with_python3}
+pushd %{py3dir}
+PYTHONPATH=${py3dir} %{__python3} cssselect/tests.py
+popd
+%endif # with_python3
 
 %install
 python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
-
 chmod 755 $RPM_BUILD_ROOT/%{python_sitelib}/cssselect/tests.py
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+chmod 755 $RPM_BUILD_ROOT/%{python3_sitelib}/cssselect/tests.py
+popd
+%endif # with_python3
+
 %files
 %doc AUTHORS docs README.rst CHANGES LICENSE PKG-INFO
-%{python_sitelib}/cssselect
-%{python_sitelib}/cssselect-%{version}-py2.7.egg-info
+%{python_sitelib}/cssselect*
+
+%if 0%{?with_python3}
+%files -n python3-cssselect
+%doc AUTHORS docs README.rst CHANGES LICENSE PKG-INFO
+%{python3_sitelib}/cssselect*
+%endif # with_python3
 
 %changelog
+* Thu Jul 25 2013 Eric Smith <brouhaha at fedoraproject.org> 0.8-1
+- Update to latest upstream.
+- Added Python 3 support.
+- Added EL6 support (uses Python 2.6 rather than 2.7).
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.1-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 
diff --git a/sources b/sources
index 6bfdb51..781f5ce 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c6c5e9a2e7ca226ce03f6f67a771379c  cssselect-0.7.1.tar.gz
+c4683e050351abcbbd5990b01f5344e2  cssselect-0.8.tar.gz


More information about the scm-commits mailing list