summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--kuka-event-broadcaster.spec93
-rw-r--r--sources1
3 files changed, 95 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..feeb9dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/3adea8cf8b356144558f69374a168a70c2356304.tar.gz
diff --git a/kuka-event-broadcaster.spec b/kuka-event-broadcaster.spec
new file mode 100644
index 0000000..b94f223
--- /dev/null
+++ b/kuka-event-broadcaster.spec
@@ -0,0 +1,93 @@
+%define ros_distro humble
+%define RosPkgName kuka-event-broadcaster
+
+# 实测 GitHub archive/<full-sha>.tar.gz 解压根目录为 kuka_drivers-<full-sha>,
+# 而非纯 commit SHA;故 autosetup -n 用实测目录名(见下方 %%prep)。
+# 该 commit 为 kuka_drivers humble 分支 HEAD,与同 monorepo 各 sibling 包一致。
+%global commit 3adea8cf8b356144558f69374a168a70c2356304
+
+Name: ros-%{ros_distro}-%{RosPkgName}
+Version: 1.1.0
+Release: 1%{?dist}
+Summary: Broadcaster of hardware events of KUKA robots
+License: Apache-2.0
+URL: https://github.com/kroshu/kuka_drivers
+Source0: https://github.com/kroshu/kuka_drivers/archive/%{commit}.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 全在 /opt/ros 下,由 ament 间接依赖模型替代)
+%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
+%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
+
+# 依赖来源:package.xml <buildtool_depend> + <depend>,逐条在 ros-projects.list /
+# ros-upstream.list 核实——controller-interface / pluginlib 为 rosdistro 真实包且
+# SIG 源已有;kuka-drivers-core 为同 monorepo sibling,同 COPR project 内构建。
+# package.xml 的 <depend> 同时承担 build 与 run 语义,故 BuildRequires / Requires 各写一遍。
+BuildRequires: ros-%{ros_distro}-ament-cmake
+BuildRequires: ros-%{ros_distro}-controller-interface
+BuildRequires: ros-%{ros_distro}-pluginlib
+BuildRequires: ros-%{ros_distro}-kuka-drivers-core
+BuildRequires: cmake
+BuildRequires: gcc-c++
+BuildRequires: make
+
+# /opt/ros 被 __requires_exclude_from 豁免、autodeps 扫不到,运行时 Requires 必须手写。
+# ros-workspace 提供 /opt/ros/<distro>/setup.sh 与环境 hooks,装上即环境就绪(所有 ROS 包强制)。
+Requires: ros-%{ros_distro}-ros-workspace
+Requires: ros-%{ros_distro}-ament-cmake
+Requires: ros-%{ros_distro}-controller-interface
+Requires: ros-%{ros_distro}-pluginlib
+Requires: ros-%{ros_distro}-kuka-drivers-core
+
+# 单包策略:ROS 包严禁拆实体子包(主包 %files 整树拥有 /opt/ros/<distro> 时
+# 必与 devel 子包路径重叠致安装事务冲突),改用虚拟 Provides 兼容依赖方
+Provides: %{name}-devel = %{version}-%{release}
+Provides: %{name}-doc = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+
+%description
+Broadcaster of hardware events of KUKA robots. Part of the kuka_drivers stack
+for ROS 2 (humble). This package builds the kuka_event_broadcaster pluginlib
+plugin (a ros2_control controller) from the kuka_drivers monorepo
+(subdirectory controllers/kuka_event_broadcaster).
+
+%prep
+%autosetup -n kuka_drivers-%{commit}
+
+%build
+# ROS 基座环境(chroot 已配置 ROS SIG repo;无 ROS 依赖的包 buildroot 里
+# 可能没有 setup.sh,必须用 [ -f ] 守卫——直接 source 不存在的文件在
+# 严格 sh 下会中止整个 %build 脚本,|| true 挡不住)
+[ -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 子目录 controllers/kuka_event_broadcaster
+cd controllers/kuka_event_broadcaster
+# 显式 out-of-source 构建,规避 openEuler %cmake 宏位置参数解析源码目录的坑
+mkdir -p .obj
+cd .obj
+%cmake3 \
+ -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \
+ -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \
+ -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \
+ -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \
+ -DSETUPTOOLS_DEB_LAYOUT=OFF \
+ -DBUILD_TESTING=OFF \
+ ..
+%make_build
+
+%install
+cd controllers/kuka_event_broadcaster/.obj
+make install DESTDIR=%{buildroot}
+
+%files
+# 整树拥有 /opt/ros/<distro>,对"装了没打包"类错误免疫
+/opt/ros/%{ros_distro}
+
+%changelog
+* Wed Sep 23 2026 openEuler ROS SIG <ros@openeuler.org> - 1.1.0-1
+- Initial package for kuka-event-broadcaster (ROS 2 humble)
diff --git a/sources b/sources
new file mode 100644
index 0000000..ec947d7
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8cb27ea9b2260b397ca57360033ec508 3adea8cf8b356144558f69374a168a70c2356304.tar.gz