%define ros_distro humble %define RosPkgName scenario-execution-x11 Name: ros-%{ros_distro}-%{RosPkgName} Version: 1.2.0 Release: 1%{?dist} Summary: Scenario Execution library for X11 License: Apache-2.0 URL: https://github.com/cps-test-lab/scenario-execution Source0: https://github.com/cps-test-lab/scenario-execution/archive/refs/heads/humble.tar.gz # 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 / .py 全在 /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 # scenario_execution —— 同仓库基座包,rosdistro 全量清单(ros-upstream.list)真实存在 BuildRequires: ros-%{ros_distro}-scenario-execution # 运行时 Requires(ROS 特有,必须手写):/opt/ros 被 __requires_exclude_from 豁免、autodeps 扫不到 # 三件套:ros-workspace 提供 /opt/ros//setup.sh 与环境 hooks;ament-cmake 提供 ament 运行期钩子 Requires: ros-%{ros_distro}-ros-workspace Requires: ros-%{ros_distro}-ament-cmake # scenario_execution 的 exec 部分 Requires: ros-%{ros_distro}-scenario-execution # ffmpeg —— openEuler 默认源已有 provider(ffmpeg-6.1.x) Requires: ffmpeg # 单包策略:ROS 包严禁拆实体子包,用虚拟 Provides 别名兼容依赖方 Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} Provides: %{name}-runtime = %{version}-%{release} %description Scenario Execution library for X11. Provides actions to interact with the X window system (capture_screen via ffmpeg x11grab) and an OSC library (x11.osc) for the scenario execution framework. %prep %autosetup -n scenario-execution-humble %build # ROS 基座环境(chroot 可能无 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} export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} # monorepo 子包:进入 libs/scenario_execution_x11 构建 cd libs/scenario_execution_x11 %{__python3} setup.py 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} export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} cd libs/scenario_execution_x11 # ament_python 形态:setup.py install 装进 /opt/ros/ 前缀 # --prefix 使 pure-python 模块装进 lib/python/site-packages,data_files 装进 share/ %{__python3} setup.py install --skip-build --root=%{buildroot} --prefix=/opt/ros/%{ros_distro} %files # 整树拥有 /opt/ros/(SIG 模板标准做法,对「装了没打包」类错误免疫) /opt/ros/%{ros_distro} %changelog * Fri Oct 23 2026 openEuler ROS SIG - 1.2.0-1 - Initial package for scenario-execution-x11 (ament_python, from cps-test-lab/scenario-execution humble branch)