File copyq.spec of Package copyq

#
# spec file for package copyq
#
# Copyright (c) 2026 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%if 0%{?suse_version} > 1600
%bcond_without miniaudio
%endif
Name:           copyq
Version:        @SERVICE@
Release:        0
Summary:        Clipboard manager with advanced features
License:        GPL-3.0-or-later
Group:          Productivity/Text/Utilities
URL:            https://hluk.github.io/CopyQ
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  appstream-glib
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  kf6-extra-cmake-modules
%{?with_miniaudio:BuildRequires:  miniaudio-devel}
BuildRequires:  pkgconfig
BuildRequires:  cmake(KF6Config)
BuildRequires:  cmake(KF6GuiAddons)
BuildRequires:  cmake(KF6Notifications)
BuildRequires:  cmake(KF6StatusNotifierItem)
BuildRequires:  cmake(KF6WindowSystem)
BuildRequires:  cmake(Qca-qt6)
BuildRequires:  cmake(Qt6GuiPrivate)
BuildRequires:  cmake(Qt6Keychain)
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6Svg)
#uildRequires:  cmake(Qt6Test)
BuildRequires:  cmake(Qt6WaylandClient)
BuildRequires:  cmake(Qt6Widgets)
BuildRequires:  pkgconfig(x11)
Recommends:     %{name}-lang

%description
CopyQ is an advanced clipboard manager with powerful editing and scripting
features.

%lang_package

%package        bash-completion
Summary:        Bash completion for %{name}
Group:          System/Shells
Requires:       bash-completion
Supplements:    (%{name} and bash)
BuildArch:      noarch

%description    bash-completion
Bash command line completion support for %{name}.

%package     -n gnome-shell-extension-%{name}-clipboard
Summary:        GNOME Shell extension for %{name}
# gobject-introspection is needed for the typelib() rpm magic.
BuildRequires:  gobject-introspection
Requires:       gnome-shell
Requires:       %{name} = %{version}-%{release}
Supplements:    (%{name} and gnome-shell)
BuildArch:      noarch

%description -n gnome-shell-extension-%{name}-clipboard
Clipboard monitoring support using a custom GNOME extension.
This package contains an GNOME Shell extension for %{name}.

%prep
%autosetup

%build
%cmake_kf6 \
    -DWITH_QT6=ON \
    -DWITH_TESTS=OFF \
    -DPLUGIN_INSTALL_PREFIX=%{_kf6_plugindir}/%{name} \
    %{!?with_miniaudio:-DWITH_AUDIO=OFF} \
    %{?with_miniaudio:-DMINIAUDIO_INCLUDE_DIR=%{_includedir}/miniaudio}
    %{nil}
%kf6_build

%install
%kf6_install
desktop-file-edit --set-key=Categories --set-value="Qt;KDE;Utility;TextEditor" \
    %{buildroot}%{_kf6_applicationsdir}/com.github.hluk.%{name}.desktop

%find_lang %{name} --with-qt

%check
#%%ctest
#QT_QPA_PLATFORM=offscreen ./build/%%{name}-tests || :
desktop-file-validate %{buildroot}%{_kf6_applicationsdir}/com.github.hluk.%{name}.desktop
appstream-util validate-relax --nonet %{buildroot}%{_kf6_appstreamdir}/com.github.hluk.%{name}.metainfo.xml

%files
%doc AUTHORS CHANGES.md HACKING README.md
%doc %{_kf6_mandir}/man1/%{name}.1%{?ext_man}
%{_kf6_bindir}/%{name}
%{_kf6_plugindir}/%{name}
%{_kf6_appstreamdir}/com.github.hluk.%{name}.metainfo.xml
%{_kf6_applicationsdir}/com.github.hluk.%{name}.desktop
%{_kf6_iconsdir}/hicolor/*/apps/%{name}*.??g
%{_kf6_sharedir}/%{name}/themes
%license LICENSE

%files lang -f %{name}.lang
%dir %{_kf6_sharedir}/%{name}
%dir %{_kf6_sharedir}/%{name}/translations

%files bash-completion
%dir %{_kf6_sharedir}/bash-completion/
%dir %{_kf6_sharedir}/bash-completion/completions
%{_kf6_sharedir}/bash-completion/completions/%{name}

%files -n gnome-shell-extension-%{name}-clipboard
%dir %{_datadir}/gnome-shell
%dir %{_datadir}/gnome-shell/extensions
%{_datadir}/gnome-shell/extensions/%{name}-clipboard@hluk.github.com/

%changelog
openSUSE Build Service is sponsored by