summaryrefslogtreecommitdiff
path: root/navmap-ros-interfaces.spec
blob: 5c78ef29ba69455ca68a5fb333d9e58b8d9561fe (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
# ROS 2 interface package (ament_cmake) from NavMap monorepo
# topdir: navmap-ros-interfaces-0.6.0 (via --transform)
# target subpackage: navmap_ros_interfaces/

%define ros_distro humble

Name:           navmap-ros-interfaces
Version:        0.6.0
Release:        1%{?dist}
Summary:        ROS 2 interfaces for NavMap (messages for visualization and layers)

License:        Apache-2.0
URL:            https://github.com/EasyNavigation/NavMap
Source0:        https://github.com/EasyNavigation/NavMap/archive/refs/heads/humble.tar.gz#/navmap-ros-interfaces-0.6.0.tar.gz

Group:          Development/Libraries
Packager:       openEuler Builder <builder@openeuler.org>

# debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规)
%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}/.*$

BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  ros-%{ros_distro}-ament-cmake
BuildRequires:  ros-%{ros_distro}-builtin-interfaces
BuildRequires:  ros-%{ros_distro}-rosidl-default-generators
BuildRequires:  ros-%{ros_distro}-std-msgs

# Runtime Requires (ROS 特有:/opt/ros 被 __requires_exclude_from 豁免,autodeps 扫不到)
Requires:       ros-%{ros_distro}-ros-workspace
Requires:       ros-%{ros_distro}-ament-cmake
Requires:       ros-%{ros_distro}-rosidl-default-runtime
Requires:       ros-%{ros_distro}-builtin-interfaces
Requires:       ros-%{ros_distro}-std-msgs

# Single package strategy: no real subpackages, virtual provides for compat
Provides:       %{name}-devel = %{version}-%{release}
Provides:       %{name}-doc = %{version}-%{release}
Provides:       %{name}-runtime = %{version}-%{release}

%description
ROS 2 interfaces for NavMap (messages for visualization and layers).
This package provides NavMap, NavMapLayer, and NavMapSurface message
definitions for the NavMap navigation framework.

%prep
%autosetup -n %{name}-%{version}

%build
# ROS base environment (chroot may not have setup.sh, guard with [ -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}

# Monorepo: cd into target subdirectory before cmake (avoids scanning
# sibling submodules' CMakeLists.txt)
cd navmap_ros_interfaces
mkdir -p .obj
cd .obj
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 %{?_smp_mflags}

%install
# ROS base environment
[ -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: cd into subpackage build directory
cd navmap_ros_interfaces/.obj
%make_install

%files
%license LICENSE
/opt/ros/%{ros_distro}

%changelog
* Sat Oct 10 2026 openEuler Builder <builder@openeuler.org> - 0.6.0-1
- Initial package