blob: eb9a5b22523619b1e9b65473292917962fe95171 (
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
|
%define ros_distro humble
%define RosPkgName easynav-costmap-maps-manager
%define src_version 0.5.0-1
# 源码为 humble 分支快照(无 tag),固定实际拉取的 commit 以保证产物可追溯
%global commit 703b73ae55bf6a419bf309b26084ca523b063ddf
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
# Source0 命名与批量 driver 的 create_tarball/tar --transform 对齐:
# <RosPkgName>-<src_version>.tar.gz,顶层目录同名,prep 解压目录须匹配
Source0: %{RosPkgName}-%{src_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: cmake
BuildRequires: make
BuildRequires: gcc-c++
# ament_cmake 构建工具依赖(§6)
BuildRequires: ros-%{ros_distro}-ament-cmake
# package.xml <depend> 中的 ROS 包(ros-projects.list 实证 SIG 源已有)
BuildRequires: ros-%{ros_distro}-ament-index-cpp
BuildRequires: ros-%{ros_distro}-easynav-common
BuildRequires: ros-%{ros_distro}-easynav-core
BuildRequires: ros-%{ros_distro}-easynav-costmap-common
BuildRequires: ros-%{ros_distro}-easynav-sensors
BuildRequires: ros-%{ros_distro}-nav-msgs
BuildRequires: ros-%{ros_distro}-pluginlib
BuildRequires: ros-%{ros_distro}-rclcpp
BuildRequires: ros-%{ros_distro}-rclcpp-lifecycle
BuildRequires: ros-%{ros_distro}-std-srvs
BuildRequires: ros-%{ros_distro}-tf2
BuildRequires: ros-%{ros_distro}-tf2-ros
BuildRequires: ros-%{ros_distro}-yaets
BuildRequires: ros-%{ros_distro}-yaml-cpp-vendor
# 系统依赖(pkg.remap 映射:eigen→eigen3-devel, graphicsmagick→GraphicsMagick-c++-devel)
BuildRequires: eigen3-devel
BuildRequires: GraphicsMagick-c++-devel
# 运行时 Requires(/opt/ros 被 __requires_exclude_from 豁免,autodeps 扫不到,必须手写)
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
Requires: ros-%{ros_distro}-ament-index-cpp
Requires: ros-%{ros_distro}-easynav-common
Requires: ros-%{ros_distro}-easynav-core
Requires: ros-%{ros_distro}-easynav-costmap-common
Requires: ros-%{ros_distro}-easynav-sensors
Requires: ros-%{ros_distro}-nav-msgs
Requires: ros-%{ros_distro}-pluginlib
Requires: ros-%{ros_distro}-rclcpp
Requires: ros-%{ros_distro}-rclcpp-lifecycle
Requires: ros-%{ros_distro}-std-srvs
Requires: ros-%{ros_distro}-tf2
Requires: ros-%{ros_distro}-tf2-ros
Requires: ros-%{ros_distro}-yaets
Requires: ros-%{ros_distro}-yaml-cpp-vendor
# 单包策略:ROS 包严禁拆实体子包,改用虚拟 Provides 别名(§7)
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
Easy Navigation: Simple MapsManager package. Provides the costmap-based maps
manager plugin for the EasyNavigation navigation stack, registered as a
pluginlib plugin for easynav_core. Built and installed under the
/opt/ros/%{ros_distro} ament layout.
%prep
%autosetup -n %{RosPkgName}-%{src_version}
%build
# ROS 基座环境:setup.sh 不存在时静默跳过(严格 sh 下直接 source 不存在文件会中止脚本)
[ -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}
# 单仓多包:目标子包位于 maps_managers/easynav_costmap_maps_manager
cd maps_managers/easynav_costmap_maps_manager
# ament_cmake 形态:显式 out-of-source 构建(避开 openEuler cmake 宏位置参数坑,§5)
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 %{?_smp_mflags}
%install
[ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true
cd maps_managers/easynav_costmap_maps_manager
cd .obj
make install DESTDIR=%{buildroot}
# 单包整树拥有 /opt/ros/<distro>(SIG 标准做法,对"装了没打包"类错误免疫,§7)
%files
/opt/ros/%{ros_distro}
%changelog
* Tue Oct 20 2026 ai-importer <ai-importer@openeuler.org> - 0.5.0-1
- Initial ROS humble spec for easynav-costmap-maps-manager 0.5.0
- Source0 aligned to RosPkgName-src_version.tar.gz for batch driver tarball naming
- Source: easynav_plugins monorepo humble branch, commit %{commit}
|