%define ros_distro humble %define RosPkgName kuka-external-control-sdk %global commit a5f81946a9d8079be4c20212622ced94da9811a2 Name: ros-%{ros_distro}-%{RosPkgName} Version: 2.0.0 Release: 1%{?dist} Summary: Client libraries for external control interfaces of KUKA License: Apache-2.0 URL: https://github.com/kroshu/kuka-external-control-sdk # topdir: name-version (created via tar --transform from cloned git source) Source0: %{name}-%{version}.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}/.*$ BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: grpc-devel BuildRequires: grpc-plugins BuildRequires: protobuf-compiler BuildRequires: protobuf-devel BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: tinyxml2-devel BuildRequires: ros-%{ros_distro}-ament-cmake BuildRequires: ros-%{ros_distro}-tinyxml2-vendor Requires: ros-%{ros_distro}-ros-workspace Requires: ros-%{ros_distro}-ament-cmake Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} Provides: %{name}-runtime = %{version}-%{release} %description Client libraries for external control interfaces of KUKA. This SDK provides the Robot class and its IRobot interface for external control of KUKA robots, supporting both iiQKA and KSS controllers via gRPC and UDP communication. %prep %autosetup -n %{name}-%{version} %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} cd kuka_external_control_sdk mkdir -p .obj cd .obj cmake .. \ -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 -DTESTING=OFF \ -DCMAKE_SUPPRESS_REGENERATION=ON make %{?_smp_mflags} %install cd kuka_external_control_sdk/.obj make install DESTDIR=%{buildroot} %files /opt/ros/%{ros_distro} %changelog * Tue Sep 29 2026 AI Importer - 2.0.0-1 - Initial package for kuka-external-control-sdk 2.0.0