# ROS spec:fss-sensing # FastSwarmSim monorepo 中的本地 LiDAR 点云仿真包(源码位于 src/fss_sensing), # ament_cmake 形态,构建内嵌 marsim_render 第三方静态库 + local_pointcloud_sim_node。 # 严格遵循 /app/.claude/skills/build-rpm/spec-rules-ros.md %define ros_distro humble %define RosPkgName fss-sensing Name: ros-%{ros_distro}-%{RosPkgName} Version: 0.1.2 Release: 1%{?dist} Summary: ROS 2 sensing wrappers for FastSwarmSim License: BSD-3-Clause URL: https://github.com/shupx/FastSwarmSim # 源码来自 FastSwarmSim monorepo(branch main,commit 快照)。 # target_version=0.1.2-1 由用户显式提供,Version 取 0.1.2(剥离发布号 -1)。 # 记录 commit 以保证产物可追溯(spec-rules-ros.md §2 快照版本纪律)。 %global commit 673ba44eaa1a4054747775ee1f1cdd3a8b8a9bbc # Source0 用 #/ 强制 rpm 内部文件名为 %%{RosPkgName}-%%{version}.tar.gz, # 与 build-rpm §4 的 --transform 本地打包产出的文件名/根目录(fss-sensing-0.1.2) # 对齐——消除对 GitHub 归档实际解压根目录名的猜测(§2 强制重定向方案)。 Source0: https://github.com/shupx/FastSwarmSim/archive/%{commit}.tar.gz#/%{RosPkgName}-%{version}.tar.gz # debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),SIG 模板统一关闭 %global debug_package %{nil} # /opt 下 python 字节码编译会写标准 sitelib 路径,摘掉 brp-python-bytecompile %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') # ROS 包不做自动依赖扫描(.so 全在 /opt/ros 下,由 ament 间接依赖模型替代) %global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$ %global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$ # ── BuildRequires ────────────────────────────────────────────── # ROS 构建工具(ament_cmake 形态,buildtool_depend;analyze_ros_deps 自动补入) BuildRequires: ros-%{ros_distro}-ament-cmake # ROS 包依赖(ros-projects.list / ros-upstream.list 逐一核对,反幻觉铁律 §6) BuildRequires: ros-%{ros_distro}-ament-index-cpp BuildRequires: ros-%{ros_distro}-geometry-msgs BuildRequires: ros-%{ros_distro}-nav-msgs BuildRequires: ros-%{ros_distro}-pcl-conversions BuildRequires: ros-%{ros_distro}-rclcpp BuildRequires: ros-%{ros_distro}-sensor-msgs # 同 session 同 COPR project 构建的兄弟包(fss_time,package.xml + find_package) BuildRequires: ros-%{ros_distro}-fss-time # 系统库依赖(pkg.remap 命中 + dnf repoquery 实证,§6 Debian 名禁令) BuildRequires: eigen3-devel BuildRequires: opencv BuildRequires: glew-devel BuildRequires: mesa-libGL-devel BuildRequires: pcl-devel BuildRequires: yaml-cpp-devel # OpenMP 由 gcc 工具链提供(libgomp),find_package(OpenMP) 无需额外 -devel 包 # glfw3:openEuler 所有源(含 ROS SIG additional_repos)均无 provider # (pkg.remap 显式标注 glfw 无 provider)。本包构建必需(marsim_render # find_package(glfw3 REQUIRED)),照写 BuildRequires,由 verify_spec_requires.py # 注册进 dep_registry 递归引入——本轮不提交、等 glfw 构建完成后重提 # (spec-rules-ros.md §6 "实证无 provider" 处置①,禁止静默丢弃) BuildRequires: glfw-devel # ── Requires(运行时,ROS 特有必须手写,§6)────────────────── # /opt/ros 被 __requires_exclude_from 豁免、autodeps 扫不到,少了这些 Requires # 构建照样成功,但装上的包环境不就绪 Requires: ros-%{ros_distro}-ros-workspace Requires: ros-%{ros_distro}-ament-cmake # package.xml (build+runtime)映射为 ros-humble- Requires: ros-%{ros_distro}-ament-index-cpp Requires: ros-%{ros_distro}-fss-time Requires: ros-%{ros_distro}-geometry-msgs Requires: ros-%{ros_distro}-nav-msgs Requires: ros-%{ros_distro}-pcl-conversions Requires: ros-%{ros_distro}-rclcpp Requires: ros-%{ros_distro}-sensor-msgs # package.xml Requires: ros-%{ros_distro}-launch Requires: ros-%{ros_distro}-launch-ros # 系统库运行时依赖(可执行文件在 /opt/ros 下被排除 autodeps 扫描,需手写) Requires: opencv Requires: glew Requires: pcl Requires: yaml-cpp Requires: mesa-libGL # glfw 运行时同样无 provider,随 glfw-devel 递归引入 Requires: glfw # 单包策略:ROS 包严禁拆实体子包(主包 %%files 整树拥有时必然与 devel 子包 # 路径重叠导致安装事务冲突),改用虚拟别名兼容依赖方(§7) Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} Provides: %{name}-runtime = %{version}-%{release} %description ROS 2 sensing wrappers for FastSwarmSim. This package provides a local LiDAR point-cloud simulator that renders the visible cloud from a vehicle pose against a static PCD map through the bundled marsim_render library, built for the ROS 2 %{ros_distro} distribution and installed under /opt/ros/%{ros_distro}. %prep # -n 与 build-rpm §4 的 --transform 本地打包根目录(fss-sensing-0.1.2)对齐 %autosetup -n %{RosPkgName}-%{version} %build # ROS 基座环境(chroot 已配置 ROS SIG repo;无 ROS 依赖的包 buildroot 里 # 可能没有 setup.sh,必须用 [ -f ] 守卫——直接 source 不存在的文件在 # 严格 sh 下会中止整个 %%build 脚本,|| true 挡不住) [ -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} # 包位于 monorepo 子目录 src/fss_sensing;显式 out-of-source 构建 # (避免 spec 顶层直接 %%cmake 的位置参数坑——openEuler %%cmake 宏带位置 # 参数时会错误解析源码目录,build 444 实踩) cd src/fss_sensing 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}" \ -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \ -DSETUPTOOLS_DEB_LAYOUT=OFF \ -DBUILD_TESTING=OFF \ .. make %{?_smp_mflags} %install cd src/fss_sensing/.obj make install DESTDIR=%{buildroot} %files # 整树拥有:对「装了没打包」类错误免疫(SIG 模板标准做法,§7) /opt/ros/%{ros_distro} %changelog * Wed Sep 30 2026 Peixuan Shu - 0.1.2-1 - Initial RPM package of fss-sensing for openEuler ROS humble