%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 - 2.0.3-1 - Initial package