blob: fc41e450a5b5a006d78accf0c45eee9bd9857bf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# ROS 2 包:easynav_mppi_controller(ament_cmake 形态)
# 来源:EasyNavigation/easynav_plugins 仓库 humble 分支(多包仓库,本包位于
# controllers/easynav_mppi_controller/ 子目录)
# 严格遵循 /app/.claude/skills/build-rpm/spec-rules-ros.md 生成
# ros_distro 取自 session.json(禁止硬编码);RosPkgName 为 package.xml <name>
# 经下划线→连字符归一化(easynav_mppi_controller → easynav-mppi-controller)
%define ros_distro humble
%define RosPkgName easynav-mppi-controller
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.5.0
Release: 1%{?dist}
Summary: Easy Navigation: MPPI Controller package.
License: Apache-2.0
URL: https://github.com/EasyNavigation/easynav_plugins
# 源码取自 humble 分支 HEAD(branch 快照,无 0.5.0 tag)。target_version=0.5.0-1
# 已由 manifest/gate 给定,Version 取 0.5.0(剥离发布号 -1);记录实际 commit 以保可追溯。
# commit 为 ros_fetch checkout 后实测的 HEAD(git rev-parse),非占位值。
# 归档解压根目录:GitHub archive/<full-sha>.tar.gz(commit 归档)解压根目录是
# 纯完整 commit SHA(如 703b73ae...),既非 <repo>-<sha> 也非 <repo>-<shortsha7>
# (spec-rules-ros §2 实测纪律;build 113779 实踩:-n easynav_plugins-<sha> 导致
# %prep cd 失败,本地 tar tzf build/SOURCES/703b73a*.tar.gz 顶层目录确认为纯 SHA)。
%global commit 703b73ae55bf6a419bf309b26084ca523b063ddf
Source0: https://github.com/EasyNavigation/easynav_plugins/archive/%{commit}.tar.gz
# debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),统一关闭
%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: cmake
BuildRequires: gcc-c++
BuildRequires: make
# ament_cmake 形态构建工具依赖(spec-rules §6);ros-workspace 提供 /opt/ros setup.sh
BuildRequires: ros-%{ros_distro}-ament-cmake
BuildRequires: ros-%{ros_distro}-ros-workspace
# package.xml <depend> → ros-humble-<dep>(均经 ros-projects.list 实证为 SIG 维护包):
# easynav-common / easynav-core / easynav-sensors / easynav-system(ros-projects.list maintained)
# geometry-msgs / nav-msgs / pluginlib / rclcpp / tf2 / tf2-geometry-msgs / tf2-ros / visualization-msgs
BuildRequires: ros-%{ros_distro}-easynav-common
BuildRequires: ros-%{ros_distro}-easynav-core
BuildRequires: ros-%{ros_distro}-easynav-sensors
BuildRequires: ros-%{ros_distro}-easynav-system
BuildRequires: ros-%{ros_distro}-geometry-msgs
BuildRequires: ros-%{ros_distro}-nav-msgs
BuildRequires: ros-%{ros_distro}-pluginlib
BuildRequires: ros-%{ros_distro}-rclcpp
BuildRequires: ros-%{ros_distro}-tf2
BuildRequires: ros-%{ros_distro}-tf2-geometry-msgs
BuildRequires: ros-%{ros_distro}-tf2-ros
BuildRequires: ros-%{ros_distro}-visualization-msgs
# 系统依赖:package.xml 声明 libpcl-all-dev,CMakeLists find_package(PCL COMPONENTS common io)
# data/ros/global_config/pkg.remap 映射 libpcl-all-dev → pcl-devel(buildroot 需 cmake(PCL))
BuildRequires: pcl-devel
# 运行时 Requires(spec-rules §6 三件套 + <depend> 运行期依赖):
# ros-workspace 提供 /opt/ros/<distro>/setup.sh 与环境 hooks(所有 ROS 包强制)
# ament-cmake ament 运行期钩子(ament_cmake 形态强制)
# /opt/ros 被 __requires_exclude_from 豁免、autodeps 扫不到,故运行期依赖手写
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
Requires: ros-%{ros_distro}-easynav-common
Requires: ros-%{ros_distro}-easynav-core
Requires: ros-%{ros_distro}-easynav-sensors
Requires: ros-%{ros_distro}-easynav-system
Requires: ros-%{ros_distro}-geometry-msgs
Requires: ros-%{ros_distro}-nav-msgs
Requires: ros-%{ros_distro}-pluginlib
Requires: ros-%{ros_distro}-rclcpp
Requires: ros-%{ros_distro}-tf2
Requires: ros-%{ros_distro}-tf2-geometry-msgs
Requires: ros-%{ros_distro}-tf2-ros
Requires: ros-%{ros_distro}-visualization-msgs
# 控制器 .so 动态链接 libpcl_common/libpcl_io(位于 /usr/lib64),/opt/ros 下 .so 被豁免
# 不扫 requires,故显式声明运行期 pcl
Requires: pcl
# 单包策略:严禁拆实体子包(spec-rules §7),用虚拟别名兼容依赖方
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
Easy Navigation: MPPI Controller package.
A Model Predictive Path Integral (MPPI) controller implementation for the
Easy Navigation stack. Built as an ament_cmake shared library registered as
a pluginlib plugin (easynav::MPPIController, base easynav::ControllerMethodBase)
via easynav_core.
%prep
# 解压根目录 = 纯完整 commit SHA(本地 tar tzf 实测 build/SOURCES,spec-rules §2)
%autosetup -n %{commit}
%build
# ROS 基座环境(spec-rules §4):setup.sh 用 [ -f ] 守卫,避免无 ROS 依赖 chroot 中止脚本
[ -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}
# 多包仓库:仅构建目标包子目录 controllers/easynav_mppi_controller
# ament_cmake 形态显式 out-of-source(spec-rules §5),避免 openEuler %cmake 宏位置参数坑
cd controllers/easynav_mppi_controller
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_build
%install
cd controllers/easynav_mppi_controller/.obj
make install DESTDIR=%{buildroot}
%files
# %files 整树拥有(spec-rules §7):对「装了没打包」类错误免疫
/opt/ros/%{ros_distro}
%changelog
* Tue Oct 20 2026 AI Importer <ai-importer@opencode> - 0.5.0-1
- Initial ROS spec for easynav-mppi-controller (humble)
- Source: easynav_plugins humble branch snapshot (commit 703b73a)
- ament_cmake shared library, pluginlib plugin via easynav_core
- Single-package policy with virtual devel/doc/runtime Provides
- Fix round 1 (build 113779): %autosetup -n easynav_plugins-<sha> → -n %{commit}
GitHub commit 归档解压根目录为纯完整 SHA(tar tzf 实测确认),非 <repo>-<sha>
|