%define ros_distro humble %define RosPkgName swri-geometry-util %define src_version 3.11.0-1 Name: ros-%{ros_distro}-%{RosPkgName} Version: 3.11.0 Release: 1%{?dist} Summary: Commonly used geometry routines, implemented in a ROS friendly package. License: BSD URL: https://github.com/swri-robotics/marti_common/tree/ros2-devel Source0: %{RosPkgName}-%{src_version}.tar.gz %global debug_package %{nil} %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') %global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$ %global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$ BuildRequires: cmake BuildRequires: ros-%{ros_distro}-ament-cmake BuildRequires: ros-%{ros_distro}-tf2 BuildRequires: eigen3-devel BuildRequires: opencv BuildRequires: geos-devel Requires: ros-%{ros_distro}-ros-workspace Requires: ros-%{ros_distro}-ament-cmake Requires: ros-%{ros_distro}-tf2 Requires: eigen3-devel Requires: opencv Requires: geos-devel Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} Provides: %{name}-runtime = %{version}-%{release} %description Commonly used geometry routines, implemented in a ROS friendly package. %prep %autosetup -n %{RosPkgName}-%{src_version} # openEuler 的 geos-devel 不提供 GEOSConfig.cmake,手写 FindGEOS.cmake 供 cmake 使用 mkdir -p %{_builddir}/cmake_modules cat > %{_builddir}/cmake_modules/FindGEOS.cmake << 'EOF' find_path(GEOS_INCLUDE_DIR geos_c.h PATH_SUFFIXES geos) find_library(GEOS_C_LIBRARY NAMES geos_c) find_library(GEOS_LIBRARY NAMES geos) if(GEOS_INCLUDE_DIR AND GEOS_C_LIBRARY) set(GEOS_FOUND TRUE) set(GEOS_INCLUDE_DIRS ${GEOS_INCLUDE_DIR}) set(GEOS_LIBRARIES ${GEOS_C_LIBRARY}) if(NOT TARGET GEOS::geos_c) add_library(GEOS::geos_c UNKNOWN IMPORTED) set_target_properties(GEOS::geos_c PROPERTIES IMPORTED_LOCATION "${GEOS_C_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${GEOS_INCLUDE_DIR}") endif() if(NOT TARGET geos_c) add_library(geos_c UNKNOWN IMPORTED) set_target_properties(geos_c PROPERTIES IMPORTED_LOCATION "${GEOS_C_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${GEOS_INCLUDE_DIR}") endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GEOS DEFAULT_MSG GEOS_C_LIBRARY GEOS_INCLUDE_DIR) EOF %build [ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH} export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} cd swri_geometry_util mkdir -p .obj && cd .obj %cmake3 \ -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \ -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \ -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro};/usr" \ -DCMAKE_MODULE_PATH="%{_builddir}/cmake_modules" \ -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \ -DSETUPTOOLS_DEB_LAYOUT=OFF \ -DBUILD_TESTING=OFF -DTESTING=OFF -DCMAKE_SUPPRESS_REGENERATION=ON \ .. make %{?_smp_mflags} %install [ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH} export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} cd swri_geometry_util cd .obj make install DESTDIR=%{buildroot} %files /opt/ros/%{ros_distro} %changelog * Sun Sep 20 2026 ai-importer - 3.11.0-1 - Initial import (ROS batch)