From ba6159f30a81357eec0f7c43691fbc5e96bf7bb667e7df85188244fed89b4422 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 14 Feb 2025 03:18:09 +0000 Subject: [PATCH] - Switch to pyproject macros. - Stop using libdir macro, which now doesn't return /usr/lib64. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Rtree?expand=0&rev=6 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + Rtree-0.9.7.tar.gz | 3 ++ Rtree-opensuse-noarch.patch | 65 +++++++++++++++++++++++++++++++ python-Rtree-rpmlintrc | 2 + python-Rtree.changes | 28 +++++++++++++ python-Rtree.spec | 78 +++++++++++++++++++++++++++++++++++++ rtree-1.3.0.tar.gz | 3 ++ 8 files changed, 203 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Rtree-0.9.7.tar.gz create mode 100644 Rtree-opensuse-noarch.patch create mode 100644 python-Rtree-rpmlintrc create mode 100644 python-Rtree.changes create mode 100644 python-Rtree.spec create mode 100644 rtree-1.3.0.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Rtree-0.9.7.tar.gz b/Rtree-0.9.7.tar.gz new file mode 100644 index 0000000..eb1429f --- /dev/null +++ b/Rtree-0.9.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be8772ca34699a9ad3fb4cfe2cfb6629854e453c10b3328039301bbfc128ca3e +size 44877 diff --git a/Rtree-opensuse-noarch.patch b/Rtree-opensuse-noarch.patch new file mode 100644 index 0000000..3cf2245 --- /dev/null +++ b/Rtree-opensuse-noarch.patch @@ -0,0 +1,65 @@ +Index: rtree-1.3.0/setup.py +=================================================================== +--- rtree-1.3.0.orig/setup.py ++++ rtree-1.3.0/setup.py +@@ -4,60 +4,11 @@ from pathlib import Path + from setuptools import setup + from setuptools.command.install import install + from setuptools.dist import Distribution +-from wheel.bdist_wheel import bdist_wheel as _bdist_wheel + + # current working directory of this setup.py file + _cwd = Path(__file__).resolve().parent + +- +-class bdist_wheel(_bdist_wheel): # type: ignore[misc] +- def finalize_options(self) -> None: +- _bdist_wheel.finalize_options(self) +- self.root_is_pure = False +- +- +-class BinaryDistribution(Distribution): # type: ignore[misc] +- """Distribution which always forces a binary package with platform name""" +- +- def has_ext_modules(foo) -> bool: +- return True +- +- +-class InstallPlatlib(install): # type: ignore[misc] +- def finalize_options(self) -> None: +- """ +- Copy the shared libraries and header files into the wheel. Note that +- this will *only* check in `rtree/lib` and `include` rather than +- anywhere on the system so if you are building a wheel you *must* copy +- or symlink the `.so`/`.dll`/`.dylib` files into `rtree/lib` and +- `.h` into `rtree/include`. +- """ +- install.finalize_options(self) +- if self.distribution.has_ext_modules(): +- self.install_lib = self.install_platlib +- +- # source files to copy +- source_dir = _cwd / "rtree" +- +- # destination for the files in the build directory +- target_dir = Path(self.build_lib) / "rtree" +- +- # copy lib tree +- source_lib = source_dir / "lib" +- if source_lib.is_dir(): +- target_lib = target_dir / "lib" +- self.copy_tree(str(source_lib), str(target_lib)) +- +- # copy include tree +- source_include = source_dir / "include" +- if source_include.is_dir(): +- target_include = target_dir / "include" +- self.copy_tree(str(source_include), str(target_include)) +- +- + # See pyproject.toml for other project metadata + setup( + name="Rtree", +- distclass=BinaryDistribution, +- cmdclass={"bdist_wheel": bdist_wheel, "install": InstallPlatlib}, + ) diff --git a/python-Rtree-rpmlintrc b/python-Rtree-rpmlintrc new file mode 100644 index 0000000..0302807 --- /dev/null +++ b/python-Rtree-rpmlintrc @@ -0,0 +1,2 @@ +# pure python package does not link but access it via ctypes +addFilter("explicit-lib-dependency libspatialindex") diff --git a/python-Rtree.changes b/python-Rtree.changes new file mode 100644 index 0000000..c699375 --- /dev/null +++ b/python-Rtree.changes @@ -0,0 +1,28 @@ +------------------------------------------------------------------- +Fri Feb 14 03:17:29 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. +- Stop using libdir macro, which now doesn't return /usr/lib64. + +------------------------------------------------------------------- +Tue Sep 17 11:34:46 UTC 2024 - Nico Krapp + +- Update to 1.3.0 + * Upgrade binary wheels with libspatialindex-2.0.0 (#316) + * Fix binary wheels for musllinux (#316) + * Update code style, replace isort and black with ruff, modern numpy rng (#319) + * Remove libsidx version testing (#313) + +------------------------------------------------------------------- +Wed May 19 10:29:54 UTC 2021 - Ben Greiner + +- Use a more sophisticated approach in order to find the correct + runtime dependency for libspatialindex + +------------------------------------------------------------------- +Mon May 17 22:22:43 UTC 2021 - Ben Greiner + +- initial specfile for 0.9.7 +- New requirement for spyder 5.0.3 +- add Rtree-opensuse-noarch.patch: we don't put spatialindex into a + wheel, so the module is kept pure. diff --git a/python-Rtree.spec b/python-Rtree.spec new file mode 100644 index 0000000..fdbea52 --- /dev/null +++ b/python-Rtree.spec @@ -0,0 +1,78 @@ +# +# spec file for package python-Rtree +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-Rtree +Version: 1.3.0 +Release: 0 +Summary: R-Tree spatial index for Python GIS +License: MIT +URL: https://github.com/Toblerity/rtree +Source: https://files.pythonhosted.org/packages/source/R/Rtree/rtree-%{version}.tar.gz +Source99: python-Rtree-rpmlintrc +# PATCH-FIX-OPENSUSE Rtree-opensuse-noarch.patch -- we don't put spatialindex into a wheel so the module is kept pure. +Patch0: Rtree-opensuse-noarch.patch +BuildRequires: %{python_module numpy} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +# only for the shlib requirement, no headers needed +BuildRequires: spatialindex-devel +BuildRequires: python-rpm-macros +# Since this is noarch, _libdir doesn't work for 64 bit arches +Requires: %(rpm -q --queryformat "%%{NAME}" -f $(readlink -f /usr/lib*/libspatialindex.so)) +Provides: python-rtree = %{version}-%{release} +BuildArch: noarch +%python_subpackages + +%description +A ctypes Python wrapper of libspatialindex that provides a number of advanced +spatial indexing features for the spatially curious Python user. + +* Nearest neighbor search +* Intersection search +* Multi-dimensional indexes +* Clustered indexes (store Python pickles directly with index entries) +* Bulk loading +* Deletion +* Disk serialization +* Custom storage implementation (to implement spatial indexing in ZODB, + for example) + +%prep +%autosetup -p1 -n rtree-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%doc README.md +%license LICENSE.txt +%{python_sitelib}/rtree +%{python_sitelib}/Rtree-%{version}.dist-info + +%changelog diff --git a/rtree-1.3.0.tar.gz b/rtree-1.3.0.tar.gz new file mode 100644 index 0000000..5f4676d --- /dev/null +++ b/rtree-1.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b36e9dd2dc60ffe3d02e367242d2c26f7281b00e1aaf0c39590442edaaadd916 +size 48190