summaryrefslogtreecommitdiff
path: root/ros-humble-nodl-schema.spec
blob: 10a83b4268c63d20687a5813438ea4da118859ad (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
%define ros_distro humble
%define RosPkgName nodl-schema

# topdir: ros-humble-nodl-schema-2.0.3 (from --transform on nodl_schema/ subdir of monorepo)

Name:           ros-%{ros_distro}-%{RosPkgName}
Version:        2.0.3
Release:        1%{?dist}
Summary:        ROS 2 Node Definition Language (NoDL) schema, validation, and semantic comparison
License:        Apache-2.0
URL:            https://github.com/ros-tooling/nodl
Source0:        %{url}/archive/refs/heads/main.tar.gz#/ros-%{ros_distro}-%{RosPkgName}-%{version}.tar.gz
BuildArch:      noarch

# debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),SIG 模板统一关闭
%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:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  ros-%{ros_distro}-ament-index-python
BuildRequires:  python3-jsonschema
BuildRequires:  python3-pydantic
BuildRequires:  python3-ruamel-yaml
BuildRequires:  python3-pyyaml

Requires:       ros-%{ros_distro}-ros-workspace
Requires:       ros-%{ros_distro}-ament-cmake
Requires:       ros-%{ros_distro}-ament-index-python
Requires:       python3-jsonschema
Requires:       python3-pydantic
Requires:       python3-ruamel-yaml
Requires:       python3-pyyaml

%description
ROS 2 Node Definition Language (NoDL) schema, validation, and semantic
comparison.  This package provides the NoDL schema definitions, in-memory
models (generated via pydantic), and validation helpers for describing ROS 2
node interfaces declaratively.

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

%build
# ROS 基座环境(buildroot 可能没有 setup.sh,用 [ -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}
%py3_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}
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \
    %{__python3} setup.py install -O1 --skip-build \
    --root %{buildroot} --prefix /opt/ros/%{ros_distro}

%files
/opt/ros/%{ros_distro}

%changelog
* Wed Sep 30 2026 ROS_Bot <ROS_Bot@openeuler.org> - 2.0.3-1
- Initial package