summaryrefslogtreecommitdiff
path: root/nebula-hesai-common.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-08 09:17:02 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-08 09:17:02 +0000
commit099420e28a08f99a1bdfa54edd7685f4af95da40 (patch)
treeb05ad038974e6ab263a333cbf7652a6d2bdd53d6 /nebula-hesai-common.spec
parentc08092a825296b4f2d4dfa0b10a6b97cd02154a7 (diff)
automatic import of ros-humble-nebula-hesai-common
Diffstat (limited to 'nebula-hesai-common.spec')
-rw-r--r--nebula-hesai-common.spec90
1 files changed, 50 insertions, 40 deletions
diff --git a/nebula-hesai-common.spec b/nebula-hesai-common.spec
index fe95165..bf1cbfb 100644
--- a/nebula-hesai-common.spec
+++ b/nebula-hesai-common.spec
@@ -1,72 +1,82 @@
+# 禁止硬编码 distro/包名/版本——一律走宏(spec-rules-ros.md §2)
%define ros_distro humble
%define RosPkgName nebula-hesai-common
-%global commit 26749c80dff89f39000a9817141143c05ec151ab
+# 源码取自 tier4/nebula 仓库 main 分支 HEAD,记录 commit 以保证产物可追溯
+%global commit 8ce64073f41c2ec1166334ce7f8fb2edc13c86e5
-Name: ros-%{ros_distro}-%{RosPkgName}
-Version: 1.2.0^20260917git26749c8
-Release: 1%{?dist}
-Summary: Nebula Common Hesai Libraries and headers
-License: Apache 2.0
-URL: https://github.com/tier4/nebula
-Source0: https://github.com/tier4/nebula/archive/%{commit}.tar.gz#/%{commit}.tar.gz
+Name: ros-%{ros_distro}-%{RosPkgName}
+Version: 1.2.0
+Release: 1%{?dist}
+Summary: Nebula Common Hesai Libraries and headers
+License: Apache-2.0
+URL: https://github.com/tier4/nebula
+# 实测 GitHub commit 归档解压根目录为纯完整 commit SHA(§2 Source0 归档解压目录名)
+Source0: https://github.com/tier4/nebula/archive/%{commit}.tar.gz
+# /opt 前缀下 debug 子包无意义,统一关闭(§2)
%global debug_package %{nil}
+# 摘掉 brp-python-bytecompile,避免 /opt 下 Python 字节码写入标准 sitelib(§2)
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
+# ROS 包不做自动依赖扫描,由 ament 间接依赖模型替代(§2)
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
+# 构建工具依赖(buildtool_depend + ament_cmake 形态基座,§5/§6)
BuildRequires: ros-%{ros_distro}-ament-cmake
BuildRequires: ros-%{ros_distro}-autoware-cmake
BuildRequires: ros-%{ros_distro}-ros-environment
+# ROS 库依赖(package.xml <depend>,§6 反幻觉铁律:同批 sibling nebula-core-common 已在 COPR 递归构建)
BuildRequires: ros-%{ros_distro}-nebula-core-common
-BuildRequires: boost-devel
-BuildRequires: nlohmann-json-devel
-BuildRequires: cmake
-BuildRequires: gcc-c++
-Requires: ros-%{ros_distro}-ros-workspace
-Requires: ros-%{ros_distro}-ament-cmake
-Requires: ros-%{ros_distro}-nebula-core-common
+# 运行时 Requires:/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
-Provides: %{name}-devel = %{version}-%{release}
-Provides: %{name}-doc = %{version}-%{release}
-Provides: %{name}-runtime = %{version}-%{release}
+# 单包策略:禁止拆实体子包,改用虚拟别名兼容依赖方(§7)
+Provides: %{name}-devel = %{version}-%{release}
+Provides: %{name}-doc = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
%description
-Nebula Common Hesai Libraries and headers for the Nebula multi-sensor
-driver framework (ROS 2 %{ros_distro}).
+Nebula Common Hesai Libraries and headers — TIER IV Nebula 激光雷达驱动栈中
+Hesai 传感器的公共头文件 INTERFACE 库,提供 Hesai 驱动各子包共享的类型定义与接口。
+构建自 tier4/nebula monorepo(包名:nebula_hesai_common)。
%prep
+# 归档解压根目录为纯完整 commit SHA,已实测确认(§2)
%autosetup -n %{commit}
%build
+# ROS 基座环境引导:setup.sh 可能不存在,须用 [ -f ] 守卫(§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}
-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 \
- ../src/nebula_hesai/nebula_hesai_common
-make %{?_smp_mflags}
+# monorepo 子目录构建:nebula_hesai_common 位于 src/nebula_hesai/nebula_hesai_common
+cd src/nebula_hesai/nebula_hesai_common
+mkdir -p .obj
+cd .obj
+# ament_cmake 形态:显式 out-of-source 构建,避免 cmake 宏位置参数坑(§3/§5/§9)
+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 \
+ ..
+%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}
-
-cd .obj
-%make_install
+cd src/nebula_hesai/nebula_hesai_common/.obj
+%make_install DESTDIR=%{buildroot}
%files
-/opt/ros/%{ros_distro}/
+# 整树拥有 /opt/ros/<distro>,对"装了没打包"类错误免疫(§7)
+/opt/ros/%{ros_distro}
%changelog
-* Sun Sep 21 2026 ROS SIG <ros@openeuler.org> - 1.2.0^20260917git26749c8-1
-- Fix: use autosetup -n commit, cmake3, add boost-devel/nlohmann-json-devel to match nebula-core-common build pattern
+* Thu Oct 08 2026 AI Importer <ai-importer@openeuler.org> - 1.2.0-1
+- 初始引入 ros-humble-nebula-hesai-common
+- Version 取自 manifest target_version 1.2.0;源码为 tier4/nebula main 分支 HEAD(commit 8ce6407)