[python-shapely] Update to 1.3.0 and add Python 3 version
Volker Fröhlich
volter at fedoraproject.org
Wed Feb 12 10:20:15 UTC 2014
commit ee0257a87f1559f103e32cc0de4e6e927ee227ec
Author: Volker Fröhlich <volker27 at gmx.at>
Date: Wed Feb 12 11:20:21 2014 +0100
Update to 1.3.0 and add Python 3 version
python-shapely-1.3.0-encoding.patch | 33 ++++++++++++++
python-shapely.spec | 80 +++++++++++++++++++++++++++++++++--
2 files changed, 109 insertions(+), 4 deletions(-)
---
diff --git a/python-shapely-1.3.0-encoding.patch b/python-shapely-1.3.0-encoding.patch
new file mode 100644
index 0000000..0804b4b
--- /dev/null
+++ b/python-shapely-1.3.0-encoding.patch
@@ -0,0 +1,33 @@
+diff -Nur Shapely-1.3.0/setup.py Shapely-1.3.0-encoding/setup.py
+--- Shapely-1.3.0/setup.py 2013-12-31 17:20:07.000000000 +0100
++++ Shapely-1.3.0-encoding/setup.py 2014-02-12 10:19:33.995319382 +0100
+@@ -14,6 +14,7 @@
+ from distutils.cmd import Command
+ from distutils.errors import CCompilerError, DistutilsExecError, \
+ DistutilsPlatformError
++import codecs
+ import errno
+ import glob
+ import os
+@@ -67,17 +68,17 @@
+ if version is None:
+ raise ValueError("Could not determine Shapely's version")
+
+-with open('VERSION.txt', 'w') as fp:
++with codecs.open('VERSION.txt', 'w') as fp:
+ fp.write(version)
+
+-with open('README.rst', 'r') as fp:
++with codecs.open('README.rst', 'r') as fp:
+ readme_text = fp.read()
+ readme_text = readme_text.replace(".. include:: CREDITS.txt", "")
+
+-with open('CREDITS.txt', 'r') as fp:
++with codecs.open('CREDITS.txt', 'r', 'utf-8') as fp:
+ credits = fp.read()
+
+-with open('CHANGES.txt', 'r') as fp:
++with codecs.open('CHANGES.txt', 'r') as fp:
+ changes_text = fp.read()
+
+ setup_args = dict(
diff --git a/python-shapely.spec b/python-shapely.spec
index 3f8803c..4231c3f 100644
--- a/python-shapely.spec
+++ b/python-shapely.spec
@@ -1,26 +1,40 @@
+# This module works with Python 3
+%if 0%{?fedora} || 0%{?rhel} > 7
+%global with_python3 1
+%endif
+
Name: python-shapely
-Version: 1.2.18
+Version: 1.3.0
Release: 1%{?dist}
-Summary: Geometric objects, predicates, and operations
+Summary: Manipulation and analysis of geometric objects in the Cartesian plane
Group: Development/Libraries
License: BSD
URL: http://trac.gispython.org/lab/wiki/Shapely
Source0: http://pypi.python.org/packages/source/S/Shapely/Shapely-%{version}.tar.gz
+# Open utf-8-encoded file using codecs.open
+Patch0: %{name}-1.3.0-encoding.patch
+
# Debian also has a patch on a locale test. Since this test doesn't fail
# on our build systems, there's no need to patch it.
# From 1.2.16 setup.py supports building the .c file,
# if the environment variable sdist is set.
-BuildRequires: python-devel
+BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
BuildRequires: geos-devel
-
# Tests use numpy
BuildRequires: numpy
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-numpy
+%endif # if with_python3
+
+
# We don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$
@@ -37,22 +51,61 @@ database using idiomatic Python.
You can use this package with python-matplotlib and numpy.
See README.rst for more information!
+%if 0%{?with_python3}
+%package -n python3-shapely
+Summary: Manipulation and analysis of geometric objects in the Cartesian plane
+Group: Development/Libraries
+
+%description -n python3-shapely
+Shapely is a package for creation, manipulation, and analysis
+of planar geometry objects – designed especially for developers
+of cutting edge geographic information systems. In a nutshell:
+Shapely lets you do PostGIS-ish stuff outside the context of a
+database using idiomatic Python.
+
+You can use this package with python3-matplotlib and python3-numpy.
+See README.rst for more information!
+
+%endif # if with_python3
+
%prep
%setup -q -n Shapely-%{version}
+%patch0 -p1
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif # if with_python3
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+%endif # if with_python3
+
%check
%{__python} setup.py test
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+%endif # if with_python3
+
%install
%{__python} setup.py install --skip-build --root %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+%endif # if with_python3
+
%files
%doc CHANGES.txt README.rst CREDITS.txt LICENSE.txt
@@ -65,8 +118,27 @@ See README.rst for more information!
%{python_sitearch}/shapely/*.py*
%{python_sitearch}/Shapely-%{version}-py*.egg-info
+%if 0%{?with_python3}
+%files -n python3-shapely
+%doc CHANGES.txt README.rst CREDITS.txt LICENSE.txt
+%doc docs
+%doc %{python3_sitearch}/shapely/examples
+%exclude %{python3_sitearch}/shapely/tests
+%{python3_sitearch}/shapely/algorithms
+%{python3_sitearch}/shapely/geometry
+%{python3_sitearch}/shapely/speedups
+%{python3_sitearch}/shapely/*.py*
+%{python3_sitearch}/Shapely-%{version}-py*.egg-info
+%{python3_sitearch}/shapely/__pycache__/*
+%endif # with_python3
%changelog
+* Wed Feb 12 2014 Volker Fröhlich <volker27 at gmx.at> - 1.3.0-1
+- New upstream release
+- Use a better summary
+- Add Python 3 builds
+- Change BR python-devel to python2-devel
+
* Mon Sep 16 2013 Volker Fröhlich <volker27 at gmx.at> - 1.2.18-1
- New upstream release
More information about the scm-commits
mailing list