blob: dbc640275065077dda3da3bb668a7f8881d64d69 (
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
|
# ROS spec:nebula-core-hw-interfaces
# 上游:tier4/nebula monorepo(https://github.com/tier4/nebula,branch main)
# 本包为 monorepo 子包,源码位于 src/nebula_core/nebula_core_hw_interfaces/
# 构建形态:ament_cmake(buildtool 依赖 autoware_cmake)
# Version 取自 ros_pkg_manifest.json 的 target_version=1.2.0
# Source0 用 ros_fetch 实际拉取的 commit 归档;SRPM 内捆绑归档实测根目录名 = 纯 commit SHA(spec-rules §2)
%define ros_distro humble
%define RosPkgName nebula-core-hw-interfaces
%global commit 26749c80dff89f39000a9817141143c05ec151ab
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 1.2.0
Release: 1%{?dist}
Summary: Nebula HW Interfaces Base
License: Apache-2.0
URL: https://github.com/tier4/nebula
# 实测 SRPM 内捆绑归档解压根目录为纯 commit SHA(spec-rules §2 + SRPM 归档实测),
# autosetup -n 与之匹配(EUR ROS-humble-3 同包用 -n %{commit} 构建成功证实)
Source0: https://github.com/tier4/nebula/archive/%{commit}.tar.gz
# ROS /opt 前缀:关闭 debug 子包、摘除 python 字节码 brp、豁免自动依赖扫描
%global debug_package %{nil}
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
# 单包策略:虚拟别名兼容依赖方,严禁拆实体 -devel 子包(路径重叠致安装事务冲突,spec-rules §7)
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
# ROS 依赖(均有清单依据,非幻觉):
# ament-cmake —— SIG 已移植(embedded 附加源)
# autoware-cmake —— buildtool_depend,embedded 附加源有
# nebula-core-common —— package.xml <depend>,embedded 附加源有
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: ros-%{ros_distro}-ament-cmake
BuildRequires: ros-%{ros_distro}-autoware-cmake
BuildRequires: ros-%{ros_distro}-nebula-core-common
# 运行时 Requires(ROS /opt 被 __requires_exclude_from 豁免,autodeps 扫不到,必须手写)
Requires: ros-%{ros_distro}-ros-workspace
Requires: ros-%{ros_distro}-ament-cmake
# ament_export_dependencies 导出 nebula_core_common,消费方构建期需此包
Requires: ros-%{ros_distro}-nebula-core-common
%description
Nebula HW Interfaces Base — header-only INTERFACE library providing hardware
interface abstractions (UDP, TCP, CAN, HTTP) for the Nebula sensor driver
framework, built into /opt/ros/%{ros_distro}.
%prep
# 归档根目录为纯 commit SHA(spec-rules §2 + SRPM 内归档实测),autosetup -n 与之匹配
%autosetup -n %{commit}
%build
# ROS 基座环境(chroot 未装 setup.sh 时用 [ -f ] 守卫,避免严格 sh 中止整个 %build)
[ -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 在 src/nebula_core/nebula_core_hw_interfaces
cd src/nebula_core/nebula_core_hw_interfaces
mkdir -p .obj
cd .obj
# 显式 out-of-source 构建(避免 openEuler %cmake 宏位置参数坑,spec-rules §5)
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 -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}
cd src/nebula_core/nebula_core_hw_interfaces/.obj
make install DESTDIR=%{buildroot}
%files
%license LICENSE
# 整树拥有(SIG 模板标准,对「装了没打包」类错误免疫,spec-rules §7)
/opt/ros/%{ros_distro}
%changelog
* Wed Sep 23 2026 AI Importer <ai-importer@opencode.local> - 1.2.0-1
- 初始引入 ros-humble-nebula-core-hw-interfaces(ament_cmake / autoware_cmake 形态)。
- 源自 tier4/nebula monorepo commit 26749c80(branch main),子包 src/nebula_core/nebula_core_hw_interfaces。
- 构建 header-only INTERFACE 库 nebula_core_hw_interfaces,安装硬件接口头文件与 CMake 导出。
|