%global python3_pkgversion 3.11 %global srcname rasterio Name: python-%{srcname} Version: 1.3.8 Release: 2.ac14.py3.11%{?dist} Summary: Fast and direct raster I/O for use with Numpy and SciPy License: BSD-3-Clause URL: https://github.com/rasterio/rasterio # PyPI tarball doesn't include test data. Source0: https://github.com/rasterio/rasterio/archive/%{version}/%{srcname}-%{version}.tar.gz Patch: 0001-Loosen-up-build-requirements.patch BuildRequires: gcc-c++ BuildRequires: gdal >= 1.11 BuildRequires: gdal-devel >= 1.11 %global _description \ Rasterio reads and writes geospatial raster data. Geographic information \ systems use GeoTIFF and other formats to organize and store gridded, or raster, \ datasets. Rasterio reads and writes these formats and provides a Python API \ based on ND arrays. %description %{_description} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel %description -n python%{python3_pkgversion}-%{srcname} %{_description} %pyproject_extras_subpkg -n python3-%{srcname} ipython plot s3 %prep %autosetup -n %{srcname}-%{version} -p1 %generate_buildrequires %pyproject_buildrequires -r -x ipython,plot,test %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{srcname} %check rm -r %{srcname} # Don't try unbuilt copy. # test_outer_boundless_pixel_fidelity is very flaky, so skip it. # Skip debian tests since we are not on debian %{pytest} -ra -m 'not network and not wheel' \ -k 'not test_outer_boundless_pixel_fidelity and not debian' for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc README.rst AUTHORS.txt CHANGES.txt CITATION.txt %license LICENSE.txt %{_bindir}/rio-%{python3_pkgversion} %changelog * Mon Apr 29 2024 Ding-Yi Chen - 1.3.8-2.ac14.py3.11 - Cut corner packaging