blob: b2a36b728b96c74f51c2783cf9b5e72a5ca5e25e (
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
|
# SPDX spec: nebula-sample-hw-interfaces (ROS 2 humble)
# 依据 /app/.claude/skills/build-rpm/spec-rules-ros.md 生成
# 关键决策记录(便于后续构建诊断循环回溯):
# 1. 包名纪律:package.xml name=nebula_sample_hw_interfaces,RPM 名经 _→- 归一化为
# ros-humble-nebula-sample-hw-interfaces(与 siblings/ros-upstream.list/SIG 惯例三方一致)。
# 2. Version:manifest target_version=1.3.1-1,剥离发布号 -1 -> 1.3.1。
# 3. ref_type 为空=默认 branch main 拉取。为可追溯性,用 HEAD commit 归档:
# commit 宏=8be1ed77...(ros_fetch shallow clone HEAD,commitdate 2026-10-20)。
# 4. Source0 归档根目录名【实测】:GitHub archive sha.tar.gz 在本仓库解压为
# nebula-full-sha(非纯 SHA,§2 已警告不可一概而论)。用 hash-slash 强制 rpm 内部文件名 +
# autosetup 的 -n 取 nebula-commit 双保险。
# 5. 构建:ament_cmake 形态,monorepo 子包路径 src/nebula_sample/nebula_sample_hw_interfaces,
# 显式 out-of-source(§5:禁止顶层 cmake 宏位置参数坑)。
# 6. 依赖(manifest 依赖字段全空,从 package.xml 推导 + ros-upstream.list 实证):
# - autoware_cmake (buildtool_depend):ros-upstream.list 有据(autowarefoundation/
# autoware_cmake.git 1.4.0-1),SIG 未移植 -> registered_deps 空 -> 照写 BuildRequires,
# 由 verify_spec_requires.py --register-missing 递归引入(§6 处置①,不静默丢弃)。
# - nebula_core_common / nebula_core_hw_interfaces / nebula_sample_common (depend):
# ros-upstream.list 有据(同 monorepo tier4/nebula),且为 siblings 同 COPR 同源解析。
# 7. 运行时 Requires 三件套(§6,/opt/ros 被 autodeps 豁免必须手写)+ exec_depend。
%define ros_distro humble
%define RosPkgName nebula-sample-hw-interfaces
%global commit 8be1ed775b02985eadafe39b00e0e4fc944114e2
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 1.3.1
Release: 1%{?dist}
Summary: Nebula Sample HW Interfaces
License: Apache-2.0
URL: https://github.com/tier4/nebula
# commit 归档;hash-slash 强制 rpm 内部文件名,autosetup 的 -n 匹配实测根目录 nebula-sha
Source0: https://github.com/tier4/nebula/archive/%{commit}.tar.gz#/nebula-%{commit}.tar.gz
# /opt 前缀下 debug 子包无意义,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')
# .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 形态构建工具(§6),ros-projects.list 有据
BuildRequires: ros-%{ros_distro}-ament-cmake
# package.xml <buildtool_depend> autoware_cmake;ros-upstream.list 有据,SIG 未移植,
# 照写让 register-missing 递归引入(§6 处置①,不静默丢弃)
BuildRequires: ros-%{ros_distro}-autoware-cmake
# package.xml <depend>:同 monorepo sibling,ros-upstream.list 有据,同 COPR 同源解析
BuildRequires: ros-%{ros_distro}-nebula-core-common
BuildRequires: ros-%{ros_distro}-nebula-core-hw-interfaces
BuildRequires: ros-%{ros_distro}-nebula-sample-common
# 运行时 Requires 三件套(§6,/opt/ros 被豁免 autodeps 扫不到必须手写)
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
# package.xml <depend> 的 exec 语义 -> Requires
Requires: ros-%{ros_distro}-nebula-core-common
Requires: ros-%{ros_distro}-nebula-core-hw-interfaces
Requires: ros-%{ros_distro}-nebula-sample-common
# 虚拟别名兼容依赖方(§7 单包策略,禁拆实体 devel 子包避免路径重叠)
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
Nebula Sample HW Interfaces — the sample hardware interface package from the
TIER IV nebula LiDAR driver monorepo (ROS 2 %{ros_distro}).
%prep
%autosetup -n nebula-%{commit}
%build
# monorepo 子包路径(相对归档根 nebula-<commit>/)
cd src/nebula_sample/nebula_sample_hw_interfaces
# ROS 基座环境(chroot 已配 ROS SIG repo;无 ROS 依赖的 buildroot 可能无 setup.sh,用 [ -f ] 守卫)
[ -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}
# 显式 out-of-source(§5:openEuler 顶层 cmake 宏带位置参数会错误解析源码目录,build 444 实踩)
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 src/nebula_sample/nebula_sample_hw_interfaces/.obj
%make_install DESTDIR=%{buildroot}
# §7:整树拥有 /opt/ros/<distro>,对"装了没打包"类错误免疫;不逐目录精确列避免重叠
%files
/opt/ros/%{ros_distro}
%changelog
* Wed Oct 21 2026 ROS AI Importer <ros-sig@openeuler.org> - 1.3.1-1
- Initial packaging of ros-humble-nebula-sample-hw-interfaces (autoref 8be1ed77).
- Source: https://github.com/tier4/nebula (monorepo, subpath src/nebula_sample/nebula_sample_hw_interfaces).
- Build deps: autoware-cmake + nebula core/sample siblings (ros-upstream.list verified).
|