%define ros_distro humble %define RosPkgName ntrip-client %define ros_pkg_name ntrip_client %define src_version 1.4.1-1 Name: ros-%{ros_distro}-%{RosPkgName} Version: 1.4.1 Release: 1%{?dist} Summary: NTRIP client that will publish RTCM corrections to a ROS topic, and optionally subscribe to NMEA messages to send to an NTRIP server License: MIT URL: https://github.com/LORD-MicroStrain/ntrip_client 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: python3 BuildRequires: ros-%{ros_distro}-nmea-msgs BuildRequires: ros-%{ros_distro}-rtcm-msgs BuildRequires: ros-%{ros_distro}-sensor-msgs BuildRequires: ros-%{ros_distro}-std-msgs Requires: ros-%{ros_distro}-ros-workspace Requires: ros-%{ros_distro}-nmea-msgs Requires: ros-%{ros_distro}-rtcm-msgs Requires: ros-%{ros_distro}-sensor-msgs Requires: ros-%{ros_distro}-std-msgs Requires: python3-serial Requires: python3-rospy Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} Provides: %{name}-runtime = %{version}-%{release} %description NTRIP client that will publish RTCM corrections to a ROS topic, and optionally subscribe to NMEA messages to send to an NTRIP server. %prep %autosetup -n %{RosPkgName}-%{src_version} %build # 纯 Python + launch 文件包,无需编译 %install # Python 模块安装到 ROS python site-packages install -d %{buildroot}/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages/%{ros_pkg_name} cp -r src/%{ros_pkg_name}/*.py \ %{buildroot}/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages/%{ros_pkg_name}/ # ROS 节点脚本 install -d %{buildroot}/opt/ros/%{ros_distro}/lib/%{ros_pkg_name} install -m 0755 scripts/ntrip_ros.py \ %{buildroot}/opt/ros/%{ros_distro}/lib/%{ros_pkg_name}/ntrip_ros install -m 0755 scripts/ntrip_serial_device_ros.py \ %{buildroot}/opt/ros/%{ros_distro}/lib/%{ros_pkg_name}/ntrip_serial_device_ros # launch 文件 install -d %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}/launch install -m 0644 launch/*.launch \ %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}/launch/ # package.xml(ament 包索引需要) install -d %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name} install -m 0644 package.xml \ %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}/ # ament 资源索引注册 install -d %{buildroot}/opt/ros/%{ros_distro}/share/ament_index/resource_index/packages touch %{buildroot}/opt/ros/%{ros_distro}/share/ament_index/resource_index/packages/%{ros_pkg_name} %files /opt/ros/%{ros_distro} %changelog * Tue Sep 16 2026 ai-importer - 1.4.1-1 - Initial import (ROS batch)