# No python-descartes build for EPEL7:
%bcond_with descartes
Name: python-shapely
Version: 1.5.17
Release: 1%{?dist}
Summary: Manipulation and analysis of geometric objects in the Cartesian plane
License: BSD
URL: https://github.com/Toblerity/Shapely
Source0: %{url}/archive/%{version}%{?prerel}.tar.gz
BuildRequires: gcc
BuildRequires: geos-devel
BuildRequires: python2-devel
BuildRequires: python2-Cython
BuildRequires: python2-setuptools
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-Cython
BuildRequires: python%{python3_pkgversion}-setuptools
# Vectorize extra (and tests)
BuildRequires: python2-numpy
BuildRequires: python%{python3_pkgversion}-numpy
# Tests
BuildRequires: python2-pytest
BuildRequires: python%{python3_pkgversion}-pytest
# Documentation
BuildRequires: make
BuildRequires: python2-sphinx
BuildRequires: python2-matplotlib
%if 0%{?with descartes}
BuildRequires: python2-descartes >= 1.0.1
%endif
# We don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in (%{python2_sitearch}|%{python3_sitearch})/.*\.so$
%filter_setup
}
%global _description %{expand:
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 python-matplotlib and numpy. See README.rst for
more information!}
%description %{_description}
%package -n python2-shapely
Summary: %{summary}
%py_provides python2-shapely
%description -n python2-shapely %_description
%package -n python%{python3_pkgversion}-shapely
Summary: %{summary}
%py_provides python%{python3_pkgversion}-shapely
%description -n python%{python3_pkgversion}-shapely %{_description}
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc %_description
%prep
%autosetup -p1 -n Shapely-%{version}%{?prerel}
# Currently, the GitHub tarball does not ship with pre-generated Cython C
# sources. We preventively check for them anyway, as they must be removed if
# they do appear.
find . -type f -name '*.c' -print -delete
%build
%py3_build
%py2_build
%make_build -C docs html
rm -vf docs/_build/html/.buildinfo
%install
%py3_install
%py2_install
# Ensure that neither Cython source files nor Cython-generated C source files
# are installed; they are not useful.
find %{buildroot}%{python3_sitearch}/shapely \
%{buildroot}%{python2_sitearch}/shapely \
-type f \( -name '*.pyx' -o -name '*.c' \) -print -delete
# In EPEL7, setuptools does not know what to do with .pxi files:
mv %{buildroot}%{_prefix}/shapely/_geos.pxi \
%{buildroot}%{python3_sitearch}/shapely/
cp -vp %{buildroot}%{python3_sitearch}/shapely/_geos.pxi \
%{buildroot}%{python2_sitearch}/shapely/
%check
# Ensure the “un-built” package is not imported.
mkdir empty
cd empty
ln -s ../tests/
PYTHONPATH='%{buildroot}%{python3_sitearch}' PYTHONDONTWRITEBYTECODE=1 \
%{__python3} -m pytest
PYTHONPATH='%{buildroot}%{python2_sitearch}' PYTHONDONTWRITEBYTECODE=1 \
%{__python2} -m pytest
%files -n python2-shapely
%license LICENSE.txt
%exclude %{python2_sitearch}/shapely/examples/
%{python2_sitearch}/shapely/
%{python2_sitearch}/Shapely-%{version}%{?prerel}-py*.egg-info/
%files -n python%{python3_pkgversion}-shapely
%license LICENSE.txt
%exclude %{python3_sitearch}/shapely/examples/
%{python3_sitearch}/shapely/
%{python3_sitearch}/Shapely-%{version}%{?prerel}-py*.egg-info/
%files doc
%license LICENSE.txt
%doc CHANGES.txt
%doc CREDITS.txt
%doc GEOS-C-API.txt
%doc README.rst
%doc docs/design.rst
%doc docs/_build/html
%doc shapely/examples/
%changelog
* Fri Mar 12 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.17-1
- New upstream release; 1.5.17 is the last bugfix release in the 1.5.x series
* Thu Mar 11 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.2-3
- De-conditionalize Python 3 support; this is now an EPEL7-only spec file
- Add a _description macro rather than repeating the description
- Build the Python 2 version as a subpackage, like the Python 3 version
- Use the py_provides macro now that it is available
- Update URLs
- Switch to GitHub tarball
- Do not use unversioned python
- Use py?_build/py?_install and similar macros
- Use python3_pkgversion macro
- Improve BR’s
- Filter compiled Python 3 extensions from Provides
- Drop obsolete Group field
- Ensure Cython C sources are always regenerated
- Simplify file lists
- Build HTML documentation and add a -doc subpackage
- Properly install license file
- Use python[23] -m unittest instead of deprecated python[23] setup.py test
- Properly install _geos.pxi
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Jan 5 2015 Volker Fröhlich <volker27@gmx.at> - 1.5.2-1
- New upstream release
* Sat Dec 6 2014 Volker Fröhlich <volker27@gmx.at> - 1.5.1-1
- New upstream release
* Tue Nov 4 2014 Volker Fröhlich <volker27@gmx.at> - 1.4.4-1
- New upstream release
* Wed Oct 8 2014 Volker Fröhlich <volker27@gmx.at> - 1.4.3-1
- New upstream release
* Tue Sep 30 2014 Volker Fröhlich <volker27@gmx.at> - 1.4.2-1
- New upstream release
* Wed Sep 24 2014 Volker Fröhlich <volker27@gmx.at> - 1.4.1-1
- New upstream release
* Thu Sep 18 2014 Volker Fröhlich <volker27@gmx.at> - 1.4.0-1
- New upstream release
- Add BR on Cython/python3-cython and build the C extension
- Update URL
- Remove the obsolete encoding patch
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Fri May 23 2014 Volker Fröhlich <volker27@gmx.at> - 1.3.2-1
- New upstream release
* Thu Apr 24 2014 Volker Fröhlich <volker27@gmx.at> - 1.3.1-1
- New upstream release
* Sat Apr 19 2014 Volker Fröhlich <volker27@gmx.at> - 1.3.0-2
- Replace obsolete python-setuptools-devel with python-setuptools
* Wed Feb 12 2014 Volker Fröhlich <volker27@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@gmx.at> - 1.2.18-1
- New upstream release
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sun Jan 27 2013 Volker Fröhlich <volker27@gmx.at> - 1.2.17-1
- New upstream release
* Tue Sep 18 2012 Volker Fröhlich <volker27@gmx.at> - 1.2.16-1
- New upstream release
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Thu Jun 28 2012 Volker Fröhlich <volker27@gmx.at> - 1.2.15-1
- New upstream release
- Pyx file is no longer part of the sources, thus Cython is no longer BR
- Chaintest is working fine now, drop the patch
* Sun Apr 8 2012 Volker Fröhlich <volker27@gmx.at> - 1.2.14-1
- Update for release 1.2.14
- Remove duplicate PKG-INFO file
- Correct description -- pointing to README.rst now
- Add patch that corrects the attribute chaining test
- Tests now work fine, therefore respect their outcome
- Remove ready-made _speedups.c
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Aug 16 2011 Volker Fröhlich <volker27@gmx.at> - 1.2.13-1
- Update for release 1.2.13
* Tue Aug 16 2011 Volker Fröhlich <volker27@gmx.at> - 1.2.12-1
- Update for release 1.2.12
- Don't ship tests
- Label examples as documentation
* Mon Aug 15 2011 Volker Fröhlich <volker27@gmx.at> - 1.2.11-2
- BR numpy for the tests
* Mon Aug 15 2011 Ville Skyttä <ville.skytta@iki.fi> - 1.2.11-2
- BR geos-devel to actually build arch specific bits
- Drop unneeded geos dep
* Fri Aug 12 2011 Volker Fröhlich <volker27@gmx.at> - 1.2.11-1
- Updated for 1.2.11
- Switch away from noarch
- Remove useless clean section and rm in install
- Debian patch to rebuild Cython .c file
- Avoid private provides for .so
- Extend package description
* Fri Apr 01 2011 Volker Fröhlich <volker27@gmx.at> - 1.2.9-1
- Updated for 1.2.9
- Added tests again, but ignore the results
* Fri Feb 25 2011 Volker Fröhlich <volker27@gmx.at> - 1.2.8-1
- Updated for 1.2.8
- Disable tests
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sat Nov 27 2010 Volker Fröhlich <volker27@gmx.at> - 1.2.7-2
- Explained excluded files; added check section
* Wed Nov 24 2010 Volker Fröhlich <volker27@gmx.at> - 1.2.7-1
- Initial package for Fedora