File swhkd.spec of Package swhkd

#
# spec file for package swhkd
#
# Copyright (c) 2022 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/
#


Name:           swhkd
Version:        1.2.0
Release:        0
Summary:        Sxhkd clone for Wayland (works on TTY and X11 too)
License:        (Apache-2.0 OR MIT) AND (MIT OR Unlicense) AND BSD-3-Clause AND MIT AND BSD-2-Clause
Group:          System/GUI/Other
URL:            https://github.com/waycrate/swhkd
Source0:        %{name}-%{version}.tar.xz
Source1:        vendor.tar.xz
Source2:        cargo_config
BuildRequires:  cargo-packaging
Requires:       polkit

%description
A display protocol-independent hotkey daemon made in Rust. It uses an easy-to-use configuration system inspired by sxhkd so you can easily add or remove hotkeys.

It also attempts to be a drop-in replacement for sxhkd, meaning, your sxhkd config file is also compatible with swhkd.

Because swhkd can be used anywhere, the same swhkd config can be used across Xorg or Wayland desktops, and you can even use swhkd in a tty.

%prep
%autosetup -a1
mkdir .cargo
cp %{SOURCE2} .cargo/config

%build
%{cargo_build}

%install
%{cargo_install}
install -Dm644 %{_builddir}/%{name}-%{version}/com.github.swhkd.pkexec.policy -t %{buildroot}%{_datadir}/polkit-1/actions

%check
%{cargo_test}

%files
%license LICENSE
%doc     README.md
%{_bindir}/swhks
%{_bindir}/swhkd
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%{_datadir}/polkit-1/actions/com.github.swhkd.pkexec.policy

%changelog
openSUSE Build Service is sponsored by