summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--nebula-robosense-hw-interfaces.spec115
-rw-r--r--sources1
3 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..3a3f64c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/nebula-robosense-hw-interfaces-1.2.0.tar.gz
diff --git a/nebula-robosense-hw-interfaces.spec b/nebula-robosense-hw-interfaces.spec
new file mode 100644
index 0000000..25ba8db
--- /dev/null
+++ b/nebula-robosense-hw-interfaces.spec
@@ -0,0 +1,115 @@
+# ROS 2 硬件接口包:nebula_robosense_hw_interfaces(TIER IV Nebula 套件的
+# Robosense LiDAR 底层硬件通信接口库)
+# 依据 /app/.claude/skills/build-rpm/spec-rules-ros.md 生成
+# package.xml: sources/nebula-robosense-hw-interfaces/src/nebula_robosense/nebula_robosense_hw_interfaces/package.xml
+# <name>nebula_robosense_hw_interfaces</name>(下划线名,§1 归一化为连字符)、
+# build_type=ament_cmake
+# 说明:上游为 nebula 单仓多包(monorepo),package.xml 位于归档内三层深
+# (src/nebula_robosense/<pkg>/),超出 gen_ros_spec.py 模板的 package.xml
+# 定位范围(仅查仓库根与一级子目录),故由 AI 兜底按 §1-§7 生成本稿。
+%define ros_distro humble
+%define RosPkgName nebula-robosense-hw-interfaces
+%define src_version 1.2.0
+
+Name: ros-%{ros_distro}-%{RosPkgName}
+Version: 1.2.0
+Release: 1%{?dist}
+Summary: Nebula HW Interfaces Robosense
+# package.xml 声明 "Apache 2"(§2 按原文填写)
+License: Apache 2
+URL: https://github.com/tier4/nebula.git
+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}/.*$
+
+# buildtool_depend:autoware_cmake(§6)。cmake 为构建系统本体;
+# ament-cmake 为 ament_cmake 形态的构建基座依赖(§6 强制)
+BuildRequires: cmake
+BuildRequires: ros-%{ros_distro}-ament-cmake
+BuildRequires: ros-%{ros_distro}-autoware-cmake
+# package.xml <depend>(build + build_export + exec 三态,下划线名归一化为连字符,§1)。
+# 五个依赖均命中 ros-upstream.list(rosdistro 全量清单,SIG 未移植、可递归构建,§6);
+# package.xml 的 <test_depend>(ament_lint_auto / ament_cmake_gtest)按 §5 不写
+# BuildRequires,改以 -DBUILD_TESTING=OFF 关闭测试构建
+BuildRequires: ros-%{ros_distro}-nebula-core-common
+BuildRequires: ros-%{ros_distro}-nebula-core-hw-interfaces
+BuildRequires: ros-%{ros_distro}-nebula-msgs
+BuildRequires: ros-%{ros_distro}-nebula-robosense-common
+BuildRequires: ros-%{ros_distro}-robosense-msgs
+# 系统依赖:本包 robosense_common.hpp → nebula_core_common/nebula_common.hpp
+# 传递包含 <boost/tokenizer.hpp>(实证于 nebula_core_common 头),编译期必需
+BuildRequires: boost-devel
+
+# 运行时 Requires(ROS 特有,必须手写:/opt/ros 被 __requires_exclude_from 豁免,
+# autodeps 扫不到。少写构建照样成功,但装上的包环境不就绪,§6)
+Requires: ros-%{ros_distro}-ros-workspace
+Requires: ros-%{ros_distro}-ament-cmake
+Requires: ros-%{ros_distro}-nebula-core-common
+Requires: ros-%{ros_distro}-nebula-core-hw-interfaces
+Requires: ros-%{ros_distro}-nebula-msgs
+Requires: ros-%{ros_distro}-nebula-robosense-common
+Requires: ros-%{ros_distro}-robosense-msgs
+# 本包公开头文件传递暴露 boost 头,下游编译本包头文件时同样需要
+Requires: boost-devel
+
+# §7 单包策略:ROS 包严禁拆实体子包(同一路径被两个子包拥有会安装冲突),
+# 用虚拟别名兼容依赖方
+Provides: %{name}-devel = %{version}-%{release}
+Provides: %{name}-doc = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+
+%description
+Nebula HW Interfaces Robosense.
+TIER IV Nebula 套件的 Robosense LiDAR 底层硬件接口库:以
+nebula_core_hw_interfaces 的 UDP 连接抽象为基座,提供
+RobosenseHwInterface(include/nebula_robosense_hw_interfaces/
+robosense_hw_interface.hpp),供 nebula_robosense_decoders 等上层包
+调用,负责与 Robosense 雷达的本机网络收发与数据流建立。
+
+%prep
+# 归档由本仓库源码树(./sources/<pkg>,即 nebula 单仓多包全树)重命名打包
+# 而来,根目录为 <包名>-<版本>(§2、SKILL §4)
+%autosetup -n %{RosPkgName}-%{src_version}
+
+%build
+# ROS 基座环境(chroot 已配置 ROS SIG repo;无 ROS 依赖的包 buildroot 里
+# 可能没有 setup.sh,必须用 [ -f ] 守卫——直接 source 不存在的文件在
+# 严格 sh 下会中止整个 %build 脚本,|| true 挡不住,§4)
+[ -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}
+# 上游是 nebula 单仓多包布局,本包位于归档内三层深(src/nebula_robosense/<pkg>)
+cd src/nebula_robosense/nebula_robosense_hw_interfaces
+# openEuler 的 %cmake 宏带位置参数会错误解析源码目录,改用显式 out-of-source(§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
+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_robosense/nebula_robosense_hw_interfaces
+cd .obj
+make install DESTDIR=%{buildroot}
+
+%files
+# §7 整树拥有:/opt/ros/<distro> 一行收尾,对「装了没打包」类错误免疫
+/opt/ros/%{ros_distro}
+
+%changelog
+* Tue Sep 22 2026 ai-importer <ai-importer@openeuler.org> - 1.2.0-1
+- Initial import (ROS batch)
diff --git a/sources b/sources
new file mode 100644
index 0000000..2342214
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+2c77edb804bf62b8d8775b92c139ffc6 nebula-robosense-hw-interfaces-1.2.0.tar.gz