File kdotool.spec of Package kdotool
#
# spec file for package martin
#
# Copyright (c) 2025 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/
#
%global crate kdotool
Name: %{crate}
Version: 0.2.3~0
Release: 0
Summary: A xdotool clone that queries and controls windows for KDE Wayland
License: Apache-2.0
URL: https://github.com/jinliu/kdotool
Source0: %{name}-%{version}.tar.zst
Source1: vendor.tar.zst
BuildRequires: cargo-packaging
BuildRequires: dbus-1-devel
ExclusiveArch: %{rust_tier1_arches}
%description
kdotool is implementing on Wayland part of what xdotool is doing for X11.
Where ydotool is used to control the mouse and keyboard on Wayland, kdotool provides window query and control.
This program is limited to KDE as it uses KWin's scripting API to query/control windows.
%prep
# The number passed to -a (a stands for "after") should be equivalent to the Source tag number
# of the vendor tarball, 1 in this case (from Source1).
%autosetup -p1 -a1
# Remove exec bits to prevent an issue in fedora shebang checking. Uncomment only if required.
# find vendor -type f -name \*.rs -exec chmod -x '{}' \;
%build
%{cargo_build}
%install
# using cargo_install (only supports bindir)
%{cargo_install}
# manual process
# install -D -d -m 0755 %{buildroot}%{_bindir}
# install -m 0755 %{_builddir}/%{name}-%{version}/target/release/%{name} %{buildroot}%{_bindir}/%{name}
%check
%{cargo_test}
%files
%{_bindir}/%{name}
%changelog