blob: c501a1e908ea11f7ef84e26aaf56024081574166 (
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
|
# ROS spec:easynav_simple_maps_manager(EasyNav Plugins 仓内的单地图管理器子包)
# 依据:/app/.claude/skills/build-rpm/spec-rules-ros.md
# 元数据来源:pkgs/easynav-simple-maps-manager/ros_pkg_manifest.json +
# sources/easynav-simple-maps-manager/maps_managers/easynav_simple_maps_manager/package.xml
# 无 reference 基线、无 package_fix 修正资产,从零按 §2-§7 生成。
# ── §1/§2 命名纪律:ros_distro 取 session.json(禁止硬编码),RosPkgName 取
# package.xml <name> 经 `_`→`-` 归一化(easynav_simple_maps_manager → easynav-simple-maps-manager)。
# Name 展开须等于 ros-humble-easynav-simple-maps-manager(verify_ros_spec_deps.py 机械校验)。
%define ros_distro humble
%define RosPkgName easynav-simple-maps-manager
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.5.0
Release: 1%{?dist}
Summary: Easy Navigation: Simple MapsManager package.
License: Apache-2.0
URL: https://github.com/EasyNavigation/easynav_plugins
# 实际检出 commit(ros_fetch checkout humble 分支 HEAD=tag 0.5.0 指向),用于产物追溯。
# #/ 强制重定向(§2 选项2):配合 build-rpm §4 的 tar --transform(重命名源码根为
# RosPkgName-version),autosetup 的 -n 即用该目录名——非臆测上游归档解压根目录。
%global commit 703b73ae55bf6a419bf309b26084ca523b063ddf
Source0: %{url}/archive/%{commit}.tar.gz#/%{RosPkgName}-%{version}.tar.gz
# §2:/opt 前缀下 debug 子包无意义(strip/debugedit 路径非常规),统一关闭
%global debug_package %{nil}
# §2:摘掉 brp-python-bytecompile(/opt 下 python 字节码会写标准 sitelib 路径)
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# §2:ROS 包不做自动依赖扫描(.so 全在 /opt/ros 下,由 ament 间接依赖模型替代)
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
# 基础构建工具链(ament_cmake C++ 构建必需,非 ROS 依赖、非幻觉)
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: make
# 构建工具依赖(ament_cmake 形态,§5/§6)
BuildRequires: ros-%{ros_distro}-ament-cmake
# package.xml <depend> 中命中 ros-projects.list(SIG 源已有)的依赖,照 §6 写 ros-humble-<dep>
BuildRequires: ros-%{ros_distro}-ament-index-cpp
BuildRequires: ros-%{ros_distro}-nav-msgs
BuildRequires: ros-%{ros_distro}-pluginlib
BuildRequires: ros-%{ros_distro}-rclcpp
BuildRequires: ros-%{ros_distro}-std-srvs
BuildRequires: ros-%{ros_distro}-tf2-ros
# 注:package.xml 另有 <depend>easynav_common</depend>、<depend>easynav_core</depend>、
# <depend>easynav_sensors</depend>、<depend>easynav_simple_common</depend>、
# <depend>yaets</depend>——这些是 EasyNav 基座框架包(独立 EasyNavigation 基座仓,
# 非 rosdistro、非 SIG 源)。ros-projects.list 与 ros-upstream.list 两级均查不到,
# 按 §6 反幻觉铁律"查不到就留空让构建失败诊断循环兜底,不得编造"——此处不写
# ros-humble-easynav-* / ros-humble-yaets BuildRequires(写成必被 verify_ros_spec_deps.py
# 判为幻觉名打回)。easynav_simple_common 虽为本批兄弟(同 COPR project),但两级清单
# 均无其名,§3.6 门禁无 batch 旁路,同样不能写。构建将在
# `find_package(easynav_common REQUIRED)` 等处诚实失败,由 lead 从基座仓补引后补 BR。
# 此非"静默丢弃以骗过构建":依赖确属 find_package REQUIRED + 链接目标,缺口如实暴露。
# <test_depend>(ament_cmake_gtest/ament_lint_auto/ament_lint_common/rclcpp_lifecycle)
# 按 §5 不写 BuildRequires。
# §6 运行时 Requires(ROS 特有,/opt 被 __requires_exclude_from 豁免、autodeps 扫不到,
# 少了这些 Requires 构建照样成功但装上后环境不就绪——spec-rules-ros.md §6)
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
# package.xml <depend> = build+run(REP 149),运行时 Requires 同上映射
Requires: ros-%{ros_distro}-ament-index-cpp
Requires: ros-%{ros_distro}-nav-msgs
Requires: ros-%{ros_distro}-pluginlib
Requires: ros-%{ros_distro}-rclcpp
Requires: ros-%{ros_distro}-std-srvs
Requires: ros-%{ros_distro}-tf2-ros
# EasyNav 基座框架包运行时依赖同 BuildRequires 注释所述不写(两级清单均无,§6 反幻觉铁律)
# §7:单包策略——严禁拆实体子包(路径与主包 %files 整树重叠致安装事务冲突),
# 用虚拟 Provides 别名兼容依赖方
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
Easy Navigation: Simple MapsManager package.
easynav_simple_maps_manager is a minimal example map manager (SimpleMap)
for the EasyNav framework, registered as a pluginlib plugin for
easynav_core::MapsManagerBase. It serves as a default plugin implementation
when the navigation system configuration does not specify one.
%prep
# §2:强制重定向目录名(配合 build-rpm skill §4 --transform,非臆测上游归档名)
%autosetup -n %{RosPkgName}-%{version}
%build
# §4 ROS 基座环境(chroot 可能未装 setup.sh,用 [ -f ] 守卫——|| true 挡不住严格 sh)
[ -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 子包:CMakeLists.txt 位于 maps_managers/easynav_simple_maps_manager/
cd maps_managers/easynav_simple_maps_manager
# §5:显式 out-of-source 构建,规避 openEuler cmake 宏的位置参数坑
# 注:注释行内不得出现“百分号 + cmake”字样——RPM 在注释内仍展开宏,
# 该宏为多行宏体,会溢出注释把行尾文字当位置参数喂给 cmake,
# 致 "source directory does not exist"(前轮 build 113756 即踩此坑)。
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 -DTESTING=OFF -DCMAKE_SUPPRESS_REGENERATION=ON \
..
%make_build
%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}
# install 段起始 cwd 回到解压根,重新进入构建目录
cd maps_managers/easynav_simple_maps_manager/.obj
%make_install
%files
%license LICENSE
# §7:%files 整树拥有(对「装了没打包」类错误免疫;不逐目录精确列)
/opt/ros/%{ros_distro}
%changelog
* Tue Oct 20 2026 ROS SIG - 0.5.0-1
- Initial RPM packaging of easynav_simple_maps_manager for openEuler ROS humble.
|