%global forgeurl https://github.com/zeroxoneafour/polonium
%global commit 94ba0faac40d2fbccebdb34bb4f7d6c7d162396f

%forgemeta

Name:           polonium
Version:        0.6.0
Release:        %autorelease
Summary:        Tiling window manager for KWin

# MIT:
#  - main script 
#  - node_modules/esbuild/LICENSE.md
#  - node_modules/fast-copy/LICENSE
#  - node_modules/mnemonist/LICENSE.txt
#  - node_modules/obliterator/LICENSE.txt
# Apache-2.0:
#  - node_modules/typescript/LICENSE.txt
# -> only used during build process
License:        MIT
URL:            %{forgeurl}
Source:         %{forgesource}
Source:         vendor-94ba0faac40d2fbccebdb34bb4f7d6c7d162396f.tar.gz
Source:         bundle_node_modules.bash
# https://github.com/zeroxoneafour/polonium/pull/92
Patch:          0001-Remove-spurious-executable-permissions.patch

BuildArch:      noarch

BuildRequires:  make
BuildRequires:  npm
Requires:       kwin

%description
An (unofficial) successor to Bismuth built on KWin 5.27.

Features:
 - Actual tiling backend using binary trees and decent enough code where you
   can mod in your own
 - Edit tile sizes with the integrated KWin GUI
 - Move and tile windows with your mouse and keyboard
 - Set layouts independently of desktop
 
X11 has been briefly tested but is not officially supported. If you encounter
an issue running the script on X11, make sure it is reproducible in Wayland
before submitting a bug report.

%prep
%autosetup -p1 -a1 -n %{extractdir}

%build
%make_build build

%install
mkdir -p %{buildroot}%{_datadir}/kwin/scripts/%{name}
cp -ar pkg/* %{buildroot}%{_datadir}/kwin/scripts/%{name}/

%files
%license license.txt
%doc docs/ changelog.md contributing.md readme.md thankyou.md
%{_datadir}/kwin/scripts/%{name}

%changelog
%autochangelog