summaryrefslogtreecommitdiff
path: root/ntrip-client.spec
blob: cc12b8d84cf293b8d70249e758ace5e28c2c26c9 (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
%define ros_distro humble
%define RosPkgName ntrip-client
%define ros_pkg_name ntrip_client
%define src_version 1.4.1-1

Name:           ros-%{ros_distro}-%{RosPkgName}
Version:        1.4.1
Release:        1%{?dist}
Summary:        NTRIP client that will publish RTCM corrections to a ROS topic, and optionally subscribe to NMEA messages to send to an NTRIP server
License:        MIT
URL:            https://github.com/LORD-MicroStrain/ntrip_client
Source0:        %{RosPkgName}-%{src_version}.tar.gz

%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}/.*$

BuildRequires:  python3
BuildRequires:  ros-%{ros_distro}-nmea-msgs
BuildRequires:  ros-%{ros_distro}-rtcm-msgs
BuildRequires:  ros-%{ros_distro}-sensor-msgs
BuildRequires:  ros-%{ros_distro}-std-msgs

Requires:       ros-%{ros_distro}-ros-workspace
Requires:       ros-%{ros_distro}-nmea-msgs
Requires:       ros-%{ros_distro}-rtcm-msgs
Requires:       ros-%{ros_distro}-sensor-msgs
Requires:       ros-%{ros_distro}-std-msgs
Requires:       python3-serial
Requires:       python3-rospy

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

%description
NTRIP client that will publish RTCM corrections to a ROS topic, and optionally
subscribe to NMEA messages to send to an NTRIP server.

%prep
%autosetup -n %{RosPkgName}-%{src_version}

%build
# 纯 Python + launch 文件包,无需编译

%install
# Python 模块安装到 ROS python site-packages
install -d %{buildroot}/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages/%{ros_pkg_name}
cp -r src/%{ros_pkg_name}/*.py \
    %{buildroot}/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages/%{ros_pkg_name}/

# ROS 节点脚本
install -d %{buildroot}/opt/ros/%{ros_distro}/lib/%{ros_pkg_name}
install -m 0755 scripts/ntrip_ros.py \
    %{buildroot}/opt/ros/%{ros_distro}/lib/%{ros_pkg_name}/ntrip_ros
install -m 0755 scripts/ntrip_serial_device_ros.py \
    %{buildroot}/opt/ros/%{ros_distro}/lib/%{ros_pkg_name}/ntrip_serial_device_ros

# launch 文件
install -d %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}/launch
install -m 0644 launch/*.launch \
    %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}/launch/

# package.xml(ament 包索引需要)
install -d %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}
install -m 0644 package.xml \
    %{buildroot}/opt/ros/%{ros_distro}/share/%{ros_pkg_name}/

# ament 资源索引注册
install -d %{buildroot}/opt/ros/%{ros_distro}/share/ament_index/resource_index/packages
touch %{buildroot}/opt/ros/%{ros_distro}/share/ament_index/resource_index/packages/%{ros_pkg_name}

%files
/opt/ros/%{ros_distro}

%changelog
* Tue Sep 16 2026 ai-importer <ai-importer@openeuler.org> - 1.4.1-1
- Initial import (ROS batch)