blob: f6a594a90d224598a5a0147629cb54736b06d3e1 (
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
|
# ROS spec: autoware-mission-details-overlay-rviz-plugin
# 由 AI 引包流程生成,遵循 /app/.claude/skills/build-rpm/spec-rules-ros.md
# 源码仓库: autowarefoundation/autoware_rviz_plugins(monorepo,含多个兄弟包)
# 本包位于子目录 autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/
%define ros_distro humble
%define RosPkgName autoware-mission-details-overlay-rviz-plugin
# 实际拉取源为 main 分支 HEAD(commit b3d5979),该 commit 恰为上游 0.6.0 release tag。
# 仓库无 0.5.0 tag,故 tarball 基于实际 commit 以保证可追溯。
# Version 取自 ros_pkg_manifest.json 的 target_version(0.5.0),系 gate 决策值(规则 §2 优先级)。
# Source0 使用本地 tarball(submit_fix.py _ensure_tarball 用 --transform 统一目录名),
# 不使用 GitHub archive URL——规则 §2 实测:GitHub commit 归档在 COPR rpmuncompress 下
# 解压根目录为纯 SHA 而非 <repo>-<sha>,猜测目录名必导致 %prep cd 失败(build 113554 实踩)。
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.5.0
Release: 4%{?dist}
Summary: RViz2 plugin for 2D overlays for mission details in the 3D view
License: Apache-2.0
URL: https://github.com/autowarefoundation/autoware_rviz_plugins
Source0: %{RosPkgName}-%{version}.tar.gz
# /opt 前缀,debug 子包无意义
%global debug_package %{nil}
# /opt 下 python 字节码编译路径非常规,摘掉 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}/.*$
# 构建工具(package.xml <buildtool_depend>ament_cmake_auto</buildtool_depend>)
# ament_cmake_auto 提供宏 ament_auto_find_build_dependencies(),
# cmake find_package(ament_cmake_auto REQUIRED) 需其独立 cmake 配置文件,
# ros-humble-ament-cmake 不含 ament_cmake_auto 的 cmake config(build 113564 实踩)
BuildRequires: ros-%{ros_distro}-ament-cmake
BuildRequires: ros-%{ros_distro}-ament-cmake-auto
# 系统依赖(package.xml <depend>boost + CMakeLists 用 qt5_wrap_cpp/Qt5Widgets,经 pkg.remap 映射)
BuildRequires: boost-devel
BuildRequires: qt5-qtbase-devel
# ROS 依赖(package.xml <depend>;manifest 依赖分析字段为空,按规则 §6 line 94 不得静默丢弃)
# rviz-2d-overlay-msgs / rviz-2d-overlay-plugins / rviz-common / rviz-ogre-vendor / rviz-rendering
# 均在 ros-projects.list(SIG 已有);autoware-internal-msgs 不在任何清单,由 verify 门禁注册递归引入
BuildRequires: ros-%{ros_distro}-autoware-internal-msgs
BuildRequires: ros-%{ros_distro}-rviz-2d-overlay-msgs
BuildRequires: ros-%{ros_distro}-rviz-2d-overlay-plugins
BuildRequires: ros-%{ros_distro}-rviz-common
BuildRequires: ros-%{ros_distro}-rviz-ogre-vendor
BuildRequires: ros-%{ros_distro}-rviz-rendering
# 运行时 Requires(ROS 特有,/opt 被 __requires_exclude_from 豁免、autodeps 扫不到,规则 §6)
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
Requires: ros-%{ros_distro}-autoware-internal-msgs
Requires: ros-%{ros_distro}-rviz-2d-overlay-msgs
Requires: ros-%{ros_distro}-rviz-2d-overlay-plugins
Requires: ros-%{ros_distro}-rviz-common
Requires: ros-%{ros_distro}-rviz-ogre-vendor
Requires: ros-%{ros_distro}-rviz-rendering
# package.xml <depend>boost 对应运行时
Requires: boost
# 单包策略:虚拟别名兼容依赖方(规则 §7,严禁拆实体 devel 子包)
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
RViz2 plugin for 2D overlays for mission details in the 3D view.
This package is part of the Autoware rviz plugins suite.
%prep
%autosetup -n %{RosPkgName}-%{version}
%build
# ROS 基座环境 bootstrap(规则 §4,[ -f ] 守卫避免 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}
# monorepo:进入本包子目录做 out-of-source 构建(规则 §5,避免 cmake 宏位置参数坑)
cd autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin
mkdir -p .obj && cd .obj
cmake .. \
-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 \
-DCMAKE_BUILD_TYPE=Release
make %{?_smp_mflags}
%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}
cd autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/.obj
make install DESTDIR=%{buildroot}
%files
# 整树拥有(规则 §7,对「装了没打包」免疫)
/opt/ros/%{ros_distro}
%changelog
* Mon Oct 12 2026 AI Importer <ai-importer@opencode> - 0.5.0-4
- Fix %build: add BuildRequires ros-humble-ament-cmake-auto
- Root cause: package.xml declares buildtool_depend ament_cmake_auto,
CMakeLists.txt line 4 calls find_package(ament_cmake_auto REQUIRED)
but spec only had ros-humble-ament-cmake which does not provide
ament_cmake_auto cmake config (build 113564)
* Mon Oct 12 2026 AI Importer <ai-importer@opencode> - 0.5.0-3
- Fix build: remove RPM macro reference from comment in %%build section
- Root cause: spec comment contained "%%cmake" which RPM expanded even in
comment lines; expanded cmake command was executed by shell with stray
comment text as source dir arg, causing CMake source dir error (build 113562)
- Reworded comment to avoid mentioning macro name verbatim
* Mon Oct 12 2026 AI Importer <ai-importer@opencode> - 0.5.0-2
- Fix %prep: switch from GitHub archive URL to local tarball (submit_fix --transform)
- Root cause: rpmuncompress on COPR extracts commit archive to pure-SHA dir,
not <repo>-<sha> as guessed; %autosetup -n autoware_rviz_plugins-%{commit} failed
- %autosetup -n now uses %{RosPkgName}-%{version} matching local tarball dir name
* Mon Oct 12 2026 AI Importer <ai-importer@opencode> - 0.5.0-1
- Initial package for ros-humble-autoware-mission-details-overlay-rviz-plugin
- Source fetched from autowarefoundation/autoware_rviz_plugins main (commit b3d5979)
- ament_cmake build type, installed into /opt/ros/humble prefix
|