# topdir: ros-humble-cwiid-0.6.00 # 上游 abstrakraft/cwiid 为 autotools(configure.ac + Makefile.in 模板)C 项目, # 无 release tag,版本号取自 configure.ac 的 AC_INIT(CWiid,0.6.00)。 # 本包为 ROS humble 依赖闭包中的第三方系统级蓝牙库/工具,按普通 C 包规范安装到 /usr。 # python 模块因 configure.ac 使用 python2 语法(print sys.version[:3])不兼容 python3,故 --without-python 跳过。 Name: ros-humble-cwiid Version: 0.6.00 Release: 6%{?dist} Summary: CWiid Wiimote Interface — libcwiid and tools (wmgui/wminput/lswm) License: GPLv2 URL: https://github.com/abstrakraft/cwiid Source0: https://github.com/abstrakraft/cwiid/archive/fadf11e89b579bcc0336a0692ac15c93785f3f82.tar.gz#/ros-humble-cwiid-0.6.00.tar.gz # defs.mak.in 硬编码 CFLAGS 覆盖 RPM optflags(含 -specs=generic-hardened-cc1 的 -fPIE), # 而 LDFLAGS 未被覆盖(RPM -specs=generic-hardened-ld 启用 PIE 链接), # 导致 aarch64 编译产物无 PIC 但链接 PIE → R_AARCH64_ADR_PREL_PG_HI21 重定位失败。 # 修复:在 CFLAGS 定义中前置 @CFLAGS@(configure 保存的 RPM optflags)。 Patch0: cwiid-cflags.patch # wmgui/main.c:445 将非字面量 message 直接传给 gtk_message_dialog_new 的 # 格式串参数,触发 -Werror=format-security(RPM optflags 含 -Werror=format-security)。 # 修复:改用 "%s", message 显式格式串。 Patch1: cwiid-format-security.patch # wmdemo/Makefile.in 的 LDLIBS 仅含 -lcwiid,缺 -lbluetooth;wmdemo.c 调用 # str2ba()(libbluetooth 符号)。generic-hardened-ld 的 -z,now 禁止 # 传递性 DSO 解析,导致 "DSO missing from command line" 链接失败。 # 修复:与 wmgui/lswm/wminput 一致,LDLIBS 追加 -lbluetooth。 Patch2: cwiid-wmdemo-bluetooth.patch Group: Development/Libraries Packager: openEuler Builder BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: autoconf BuildRequires: automake BuildRequires: flex BuildRequires: bison BuildRequires: bluetooth-devel BuildRequires: gtk2-devel BuildRequires: glib2-devel BuildRequires: kernel-headers %description CWiid provides a C library (libcwiid) and a set of tools to interface with the Nintendo Wiimote over Bluetooth: * libcwiid — wiimote C API (shared library). * wmgui — GTK GUI for inspecting the wiimote. * wminput — event/joystick/mouse driver for the wiimote (with plugins). * lswm — list wiimote devices. The Python binding is disabled in this build (upstream uses Python 2 syntax incompatible with openEuler's Python 3). %package devel Summary: Development files for %{name} Group: Development/Libraries Packager: openEuler Builder Requires: %{name} = %{version}-%{release} Requires: bluetooth-devel %description devel Header files, static library, development symlink and pkg-config file for %{name}. # 用 %setup + 显式 %patch -p1 替代 %autosetup:本 chroot 的 rpm 中 # %autosetup 展开后调用 patch 不带 -p 参数(-p0),对 git diff 多层路径 # (a/wmgui/main.c)报 "No file to patch";单层路径(a/defs.mak.in)靠 # patch 智能重试偶然成功。显式 -p1 剥掉 a//b/ 前缀,两层 patch 均可靠应用。 %prep %setup -n %{name}-%{version} %patch0 -p1 %patch1 -p1 %patch2 -p1 %build # 源码仅含 configure.ac,需先生成 configure 脚本 autoreconf -if %configure \ --without-python \ --with-cwiid-config-dir=%{_sysconfdir}/cwiid \ --with-cwiid-plugins-dir=%{_libdir}/cwiid/plugins # LDCONFIG=true 抑制 install_shared 在构建环境调用 ldconfig(DESTDIR 下无意义且会失败) %make_build LDCONFIG=true %install %make_install LDCONFIG=true %files %license COPYING %doc README NEWS ChangeLog AUTHORS # doc/Makefile.in 安装 Xmodmap 与 wminput.list 到 $(docdir)=/usr/share/doc/cwiid # (autoconf PACKAGE_TARNAME 取 AC_INIT(CWiid) → "cwiid",非 RPM 包名), # 与 %doc 宏的 /usr/share/doc/ros-humble-cwiid 不同,需显式声明。 %{_defaultdocdir}/cwiid/ %{_libdir}/libcwiid.so.1 %{_libdir}/libcwiid.so.1.0 %{_bindir}/wmgui %{_bindir}/wminput %{_bindir}/lswm %{_libdir}/cwiid/ %config(noreplace) %{_sysconfdir}/cwiid/ %{_mandir}/man1/wmgui.1* %{_mandir}/man1/wminput.1* %files devel %{_includedir}/cwiid.h %{_libdir}/libcwiid.so %{_libdir}/libcwiid.a %{_libdir}/pkgconfig/cwiid.pc %changelog * Thu Oct 22 2026 openEuler Builder - 0.6.00-6 - Fix "Installed (but unpackaged) file(s)": package /usr/share/doc/cwiid/ (Xmodmap, wminput.list installed by doc/Makefile.in to autoconf docdir). * Thu Oct 22 2026 openEuler Builder - 0.6.00-5 - Fix wmdemo link failure: add -lbluetooth to LDLIBS in wmdemo/Makefile.in (str2ba symbol from libbluetooth; -z,now forbids transitive DSO resolution). * Thu Oct 22 2026 openEuler Builder - 0.6.00-4 - Fix Patch1 apply failure ("No file to patch"): replace %autosetup with explicit %setup + %patch -p1; this chroot's rpm expands %autosetup to patch without -p, which fails on multi-path git diffs (a/wmgui/main.c). * Thu Oct 22 2026 openEuler Builder - 0.6.00-3 - Fix -Werror=format-security in wmgui/main.c: use "%s" format literal for gtk_message_dialog_new. * Thu Oct 22 2026 openEuler Builder - 0.6.00-2 - Fix aarch64 PIE link failure: include @CFLAGS@ (RPM optflags with -fPIE) in defs.mak.in. * Thu Oct 22 2026 openEuler Builder - 0.6.00-1 - Initial package for openEuler (ROS humble dependency closure).