summaryrefslogtreecommitdiff
path: root/pointcloud-to-ply.spec
blob: 4402ebc2a5fc9e1a7e6ea3ec37f1b509e5b4e4b2 (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
%define ros_distro humble
%define RosPkgName pointcloud-to-ply

Name:       ros-%{ros_distro}-%{RosPkgName}
Version:    0.0.2
Release:    1%{?dist}
Summary:    Subscribe to a PointCloud2 topic, reconstruct a mesh, and save to OBJ/PLY.
License:    BSD
URL:        https://github.com/li9i/pointcloud-to-ply
# branch 归档实测解压根目录为 pointcloud-to-ply-humble-devel
Source0:    https://github.com/li9i/pointcloud-to-ply/archive/refs/heads/humble-devel.tar.gz#/pointcloud-to-ply-humble-devel.tar.gz

# debug 子包无意义(/opt 前缀),统一关闭
%global debug_package %{nil}
# /opt 下 python 字节码编译路径非常规,摘掉 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 下)
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$

# official_deps_rpm(manifest)
BuildRequires:  ros-%{ros_distro}-ament-cmake
BuildRequires:  ros-%{ros_distro}-rclpy
BuildRequires:  ros-%{ros_distro}-sensor-msgs
# ament_python 构建工具
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-numpy

# 所有 ROS 包强制
Requires:       ros-%{ros_distro}-ros-workspace
# exec_depend 运行时依赖
Requires:       ros-%{ros_distro}-rclpy
Requires:       ros-%{ros_distro}-sensor-msgs
Requires:       python3-numpy
# open3d 在 openEuler 仓库中暂不可用,需手动 pip install open3d

Provides:       %{name}-devel = %{version}-%{release}
Provides:       %{name}-doc = %{version}-%{release}
Provides:       %{name}-runtime = %{version}-%{release}

%description
Subscribe to a PointCloud2 topic, reconstruct a mesh, and save to OBJ/PLY.

%prep
%autosetup -n pointcloud-to-ply-humble-devel

%build
source /opt/ros/%{ros_distro}/setup.sh 2>/dev/null || 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}
%{__python3} -m pip wheel --no-deps --no-build-isolation -w dist .

%install
source /opt/ros/%{ros_distro}/setup.sh 2>/dev/null || 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}
%{__python3} -m pip install --no-deps --no-build-isolation \
    --prefix=/opt/ros/%{ros_distro} \
    --root=%{buildroot} \
    dist/*.whl

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

%changelog
* Wed Sep 16 2026 ROS SIG <ros-sig@openeuler.org> - 0.0.2-1
- Initial package for ros-%{ros_distro}-%{RosPkgName}