blob: ac0d33ea5b676784cf86c44dcc32af8bf87f9ad3 (
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
136
137
138
139
140
141
142
143
144
145
146
147
|
# ROS 2 包:easynav_regulated_pp_controller(ament_cmake 形态)
# 来源:EasyNavigation/easynav_plugins 仓库 humble 分支(多包仓库,本包位于
# controllers/easynav_regulated_pp_controller/ 子目录)
# 严格遵循 /app/.claude/skills/build-rpm/spec-rules-ros.md 生成
# ros_distro 取自 session.json(禁止硬编码);RosPkgName 为 package.xml <name>
# 经下划线→连字符归一化(easynav_regulated_pp_controller → easynav-regulated-pp-controller)
%define ros_distro humble
%define RosPkgName easynav-regulated-pp-controller
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.5.0
Release: 3%{?dist}
Summary: Easy Navigation: port of the Nav2 Regulated Pure Pursuit Controller.
License: Apache-2.0
URL: https://github.com/EasyNavigation/easynav_plugins
# 源码取自 humble 分支快照(无 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),非占位值。
# 归档解压根目录(spec-rules-ros.md §2 实测纪律,build 113799 实踩纠正):
# ros_fetch 已将 GitHub archive 重打包,SRPM 内嵌 703b73ae...tar.gz 经 tar tzf
# 实测解压根目录 = easynav-regulated-pp-controller-0.5.0-1(即
# <RosPkgName>-<version>-<manifest发布号>),非纯 commit SHA。round 1 注释误判为
# "纯 commit SHA"(幻觉实测)致 -n %%{commit} 与实际根目录不匹配,build 113799
# %%prep cd 失败。本包据 tar tzf 实测纠正为 -n %%{RosPkgName}-%%{version}-1。
%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 / std-msgs / tf2 / tf2-geometry-msgs / tf2-ros
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}-std-msgs
BuildRequires: ros-%{ros_distro}-tf2
BuildRequires: ros-%{ros_distro}-tf2-geometry-msgs
BuildRequires: ros-%{ros_distro}-tf2-ros
# 系统依赖:CMakeLists 仅 find_package ROS 包(无 PCL/eigen 等系统库),
# 故系统 BuildRequires 仅 cmake/gcc-c++/make。
# 测试依赖(ament_cmake_gtest/ament_lint_*/easynav_controller/easynav_planner/
# lifecycle_msgs/rclcpp_lifecycle)按 spec-rules §5 不写 BuildRequires,BUILD_TESTING=OFF。
# 运行时 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}-std-msgs
Requires: ros-%{ros_distro}-tf2
Requires: ros-%{ros_distro}-tf2-geometry-msgs
Requires: ros-%{ros_distro}-tf2-ros
# 单包策略:严禁拆实体子包(spec-rules §7),用虚拟别名兼容依赖方
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
Easy Navigation: port of the Nav2 Regulated Pure Pursuit Controller.
A regulated pure pursuit controller plugin for the Easy Navigation stack,
ported from Nav2's Regulated Pure Pursuit Controller. Built as an
ament_cmake shared library registered as a pluginlib plugin
(easynav_regulated_pp_controller/RegulatedPurePursuitController via
easynav_core).
%prep
# 解压根目录 = easynav-regulated-pp-controller-0.5.0-1(tar tzf 实测 SRPM 内嵌
# 703b73ae...tar.gz,ros_fetch 重打包根目录,spec-rules §2 实测纪律;非纯 commit SHA)
%autosetup -n %{RosPkgName}-%{version}-1
%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_regulated_pp_controller
# ament_cmake 形态显式 out-of-source(spec-rules §5),避免 openEuler %%cmake 宏位置参数坑
cd controllers/easynav_regulated_pp_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_regulated_pp_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-3
- Fix %prep failure (build 113799): %autosetup -n %{commit} mismatched the
actual tarball root dir. SRPM embeds the ros_fetch-repacked tarball whose
root = easynav-regulated-pp-controller-0.5.0-1 (verified via tar tzf), not
the bare commit SHA a raw GitHub archive would produce. Round 1 comment
wrongly claimed "实测=纯 commit SHA" (hallucinated measurement). Corrected
-n to %{RosPkgName}-%{version}-1 per spec-rules-ros §2 实测纪律.
* Tue Oct 20 2026 AI Importer <ai-importer@opencode> - 0.5.0-2
- Fix build failure: escape %%cmake / %%prep / %%files / %%{commit} in
spec comments — RPM expands macros in comment lines; the parameterized
%%cmake macro's multi-line body leaked out of the comment and spawned a
spurious cmake invocation with "宏位置参数坑" as source dir (build 113783)
* Tue Oct 20 2026 AI Importer <ai-importer@opencode> - 0.5.0-1
- Initial ROS spec for easynav-regulated-pp-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
|