%bcond_without python %bcond_without check %global forgeurl https://github.com/google/s2geometry %global date 20230310 %global commit 7773d518b1f29caa1c2045eb66ec519e025be108 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %forgemeta Name: s2geometry Version: 0.10.0 Release: %autorelease Summary: Computational geometry and spatial indexing on the sphere License: Apache-2.0 URL: %{forgeurl} Source0: %{forgesource} BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: abseil-cpp-devel BuildRequires: openssl-devel BuildRequires: gflags-devel BuildRequires: glog-devel BuildRequires: gtest-devel %description S2 Geometry Library is a package for manipulating geometric shapes. Unlike many geometry libraries, S2 is primarily designed to work with spherical geometry, i.e., shapes drawn on a sphere rather than on a planar 2D map. This makes it especially suitable for working with geographic data. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %if %{with python} %package python3-%{name} Summary: Python 3 bindings for the %{name} BuildRequires: python3-devel BuildRequires: swig Requires: %{name}%{?_isa} = %{version}-%{release} Provides: %{name}-python3 = %{version}-%{release} %description python3-%{name} The python3-%{name} package contains Python bindings for %{name}. %endif %prep %forgeautosetup -p1 # delete the line that contains 'cmake_build_extension' sed -i '/cmake_build_extension/d' pyproject.toml rm setup.py %generate_buildrequires %pyproject_buildrequires %build %cmake \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ %if %{with python} -DWITH_PYTHON=ON \ %endif -DCMAKE_CXX_STANDARD=17 \ %cmake_build %pyproject_wheel %install %cmake_install %pyproject_save_files '*' %if %{with check} %check %ctest %endif %files %license LICENSE %doc README.md %{_libdir}/libs2.so.0* %files devel %{_includedir}/s2/ %{_libdir}/libs2.so %if %{with python} %files python3-%{name} -f %{pyproject_files} #%{python3_sitelib}/__pycache__/pywraps2.*.pyc #%{python3_sitelib}/_pywraps2.so #%{python3_sitelib}/pywraps2.py %endif %changelog %autochangelog