summaryrefslogtreecommitdiff
path: root/octovis.spec
diff options
context:
space:
mode:
Diffstat (limited to 'octovis.spec')
-rw-r--r--octovis.spec87
1 files changed, 87 insertions, 0 deletions
diff --git a/octovis.spec b/octovis.spec
new file mode 100644
index 0000000..d734fc5
--- /dev/null
+++ b/octovis.spec
@@ -0,0 +1,87 @@
+%define ros_distro humble
+%define RosPkgName octovis
+%define src_version 1.9.8-1
+
+Name: ros-%{ros_distro}-%{RosPkgName}
+Version: 1.9.8
+Release: 1%{?dist}
+Summary: octovis is visualization tool for the OctoMap library based on Qt and libQGLVie
+License: GPLv2
+URL: https://github.com/octomap/octomap/tree/devel
+Source0: %{RosPkgName}-%{src_version}.tar.gz
+# 已移除 Patch0: octovis-fix-qglviewer.patch(fix round 2)——
+# 该补丁目标路径为 ros-humble-octovis-1.9.8/CMakeModules/FindQGLViewer.cmake,
+# 只适用于 1.9.8 发布 tarball 的布局;本包源码取自 octomap/octomap devel
+# (1.10.0),CMakeModules 位于 octovis/CMakeModules/,-p1 后路径不存在,
+# 实测 `patch -p1 --dry-run` 报 "can't find file to patch",
+# 且 1.10.0 的 FindQGLViewer.cmake 已无 qmake 调用(补丁修的问题不存在)。
+
+%global debug_package %{nil}
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
+%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
+%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
+
+BuildRequires: ros-%{ros_distro}-octomap
+BuildRequires: mesa-libGL-devel
+BuildRequires: qt5-qtbase
+BuildRequires: qt5-qtbase-devel
+BuildRequires: qt5-qtbase-gui
+BuildRequires: cmake
+BuildRequires: mesa-libGLU-devel
+# fix round 2:删除 libqglviewer2-qt5 / libqt5-opengl 两行(Debian 名,非 RPM 名)
+# - libqglviewer2-qt5(上游 package.xml 的 exec_depend,构建期并不需要):
+# dnf repoquery --whatprovides 在 everything/update/EPOL + COPR result +
+# ROS SIG additional_repos 全部无 provider,libQGLViewer 在 openEuler 不存在。
+# 本包源码 1.10.0 自带 vendored QGLViewer(octovis/src/extern/QGLViewer),
+# CMakeLists 在未找到已安装 QGLViewer 时自动走 vendored 分支,故无需该依赖。
+# - libqt5-opengl:RPM 侧能力由 qt5-qtbase-gui 提供 libQt5OpenGL.so.5()(64bit)、
+# qt5-qtbase-devel 提供 cmake(Qt5OpenGL),二者均已在本 spec 中,
+# 映射见 pkg.remap 的 `libqt5-opengl-dev qt5-qtbase-devel`。
+
+Requires: ros-%{ros_distro}-ros-workspace
+Requires: ros-%{ros_distro}-octomap
+Requires: mesa-libGL-devel
+Requires: qt5-qtbase
+Requires: qt5-qtbase-gui
+
+Provides: %{name}-devel = %{version}-%{release}
+Provides: %{name}-doc = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+
+%description
+octovis is visualization tool for the OctoMap library based on Qt and libQGLViewer. See
+ http://octomap.github.io for details.
+
+%prep
+%autosetup -n %{RosPkgName}-%{src_version}
+
+%build
+[ -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 octovis
+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 -DTESTING=OFF -DCMAKE_SUPPRESS_REGENERATION=ON \
+ ..
+make %{?_smp_mflags}
+
+%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 octovis
+cd .obj
+make install DESTDIR=%{buildroot}
+
+%files
+/opt/ros/%{ros_distro}
+
+%changelog
+* Mon Sep 21 2026 ai-importer <ai-importer@openeuler.org> - 1.9.8-1
+- Initial import (ROS batch)