summaryrefslogtreecommitdiff
path: root/nebula-continental-common.spec
blob: 4a738242904ad69d6bd313019d9b25d18c458927 (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
# ROS spec:nebula-continental-common
# 上游:tier4/nebula monorepo(https://github.com/tier4/nebula,branch main)
# 本包为 monorepo 子包,源码位于 src/nebula_continental/nebula_continental_common/
# 构建形态:ament_cmake(buildtool 依赖 autoware_cmake + ros_environment)
# Version 取自 ros_pkg_manifest.json 的 target_version=1.2.0
# Source0 用 ros_fetch 实际拉取的 commit 归档(实测根目录名 = <full-sha>,无 nebula- 前缀)

%define ros_distro humble
%define RosPkgName nebula-continental-common
%global commit 26749c80dff89f39000a9817141143c05ec151ab

Name:           ros-%{ros_distro}-%{RosPkgName}
Version:        1.2.0
Release:        1%{?dist}
Summary:        Nebula Common Continental Libraries and headers
License:        Apache-2.0
URL:            https://github.com/tier4/nebula
# ros_fetch 创建的 tarball 解压根目录为 <full-sha>(无 nebula- 前缀),故 -n 与之匹配
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 子包(路径重叠致安装事务冲突)
Provides:       %{name}-devel = %{version}-%{release}
Provides:       %{name}-doc = %{version}-%{release}
Provides:       %{name}-runtime = %{version}-%{release}

# ROS 依赖(均有清单依据,非幻觉):
#   ament-cmake / ros-environment —— SIG 已移植(ros-projects.list)
#   autoware-cmake / nebula-core-common —— SIG 未移植但 rosdistro 全量存在(ros-upstream.list),同 COPR project 注册构建
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  ros-%{ros_distro}-ament-cmake
BuildRequires:  ros-%{ros_distro}-autoware-cmake
BuildRequires:  ros-%{ros_distro}-ros-environment
BuildRequires:  ros-%{ros_distro}-nebula-core-common
# 系统依赖(package.xml <depend>boost</depend>,CMakeLists find_package(Boost))
BuildRequires:  boost-devel

# 运行时 Requires(ROS /opt 被 __requires_exclude_from 豁免,autodeps 扫不到,必须手写)
Requires:       ros-%{ros_distro}-ros-workspace
Requires:       ros-%{ros_distro}-ament-cmake
Requires:       ros-%{ros_distro}-nebula-core-common
# 头包(INTERFACE)通过 ament_export_dependencies 导出 Boost/nebula_core_common,消费方构建期需 boost-devel
Requires:       boost-devel

%description
Nebula Common Continental Libraries and headers. Header-only ament_cmake package
providing Continental SRR520 and ARS548 radar definitions for the Nebula LiDAR
driver stack, built into /opt/ros/%{ros_distro}.

%prep
%autosetup -n %{commit} -p1

%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_continental/nebula_continental_common
cd src/nebula_continental/nebula_continental_common
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_continental/nebula_continental_common/.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-continental-common(ament_cmake / autoware_cmake 形态)。
- 源自 tier4/nebula monorepo commit 26749c80(branch main),子包 src/nebula_continental/nebula_continental_common。
- 头包(INTERFACE),仅安装头文件与 CMake 导出目标。