# krunner-pinyin-search.spec # Maintainer: Your Name # Fedora 40+ / Plasma 6 / KF6 / Qt6 %global git_url https://github.com/AOSC-Dev/krunner-pinyin-search %global git_commit 87598886467701cd8a97727149eedf45b9e1d60e %global git_short 8759888 %global commit_date 20250923 Name: krunner-pinyin-search Version: 0.0.0 Release: 4.%{commit_date}git%{git_short}%{?dist} Summary: KRunner plugin for Pinyin search of applications in KDE License: LGPL-2.1-or-later URL: %{git_url} # ===== 构建依赖 ===== BuildRequires: cmake >= 3.16 BuildRequires: extra-cmake-modules >= 6.0 BuildRequires: gcc-c++ BuildRequires: git # Qt6 / KF6 开发包 BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qttools-devel BuildRequires: kf6-kcoreaddons-devel BuildRequires: kf6-ki18n-devel BuildRequires: kf6-kservice-devel BuildRequires: kf6-krunner-devel BuildRequires: kf6-kio-devel BuildRequires: kf6-kjobwidgets-devel %description KRunner plugin supporting Pinyin/Initials/Chinese mixed input for KDE Plasma 6. %prep # 直接 git clone(不使用 --depth 1,确保短 hash 可解析) rm -rf %{name}-%{version} git clone %{git_url} %{name}-%{version} pushd %{name}-%{version} git checkout %{git_commit} popd %build pushd %{name}-%{version} %cmake -B _build \ -DCMAKE_BUILD_TYPE=Release \ -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} %cmake_build _build popd %install pushd %{name}-%{version} %cmake_install _build popd # 调试:打印生成的 .so 文件路径 find %{buildroot} -name '*.so' -type f >&2 || true %check # 验证插件文件存在(宽松检查) if ! test -f %{buildroot}%{_libdir}/qt6/plugins/kf6/krunner/krunner_pinyin_search.so; then echo "WARNING: Plugin not found at expected path, listing all .so files:" >&2 find %{buildroot} -name '*.so' >&2 || true fi %files # 插件主文件(kf6/krunner 命名空间) %{_libdir}/qt6/plugins/kf6/krunner/krunner_pinyin_search.so # 翻译文件(如果存在) %{_datadir}/locale/*/LC_MESSAGES/plasma_runner_org.kde.krunner_pinyin_search.mo # 文档 %doc %{name}-%{version}/README.md %license %{name}-%{version}/LICENSE %changelog * Tue Sep 23 2025 Your Name - 0.0.0-4.20250923git8759888 - Fix: use real commit hash 87598886467701cd8a97727149eedf45b9e1d60e - Remove macro from comments to avoid RPM warning - Conservative plugin path check for compatibility