File dankmaterialshell.spec of Package dankmaterialshell

#
# spec file for package dankmaterialshell
#
# Copyright (c) 2025 mantarimay
#
# 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/
#


%define uname DankMaterialShell
%define bname danklinux
Name:           dankmaterialshell
Version:        0.3.0
Release:        0
Summary:        A Quickshell-based desktop shell with Material 3 design principles
License:        MIT
URL:            https://github.com/AvengeMedia/DankMaterialShell
Source0:        https://github.com/AvengeMedia/%{bname}/archive/v%{version}/%{bname}-%{version}.tar.gz
Source1:        vendor.tar.zst 
Source2:        %{url}/archive/v%{version}/%{uname}-%{version}.tar.gz
BuildRequires:  golang-packaging
BuildRequires:  zstd
Recommends:     matugen
Recommends:     cava
Recommends:     khal
Recommends:     cliphist
Recommends:     wl-clipboard
Recommends:     qt5ct
Recommends:     qt6ct
Recommends:     NetworkManager
Recommends:     brightnessctl
Requires:       fira-code-fonts
Requires:       inter-fonts
Requires:       inter-variable-fonts
Requires:       material-symbols-variable
Requires:       quickshell
Requires:       python3
Requires:       dgop

%description
A modern Wayland desktop shell built with Quickshell and optimized for
the niri and Hyprland compositors.

%prep
%autosetup -n %{bname}-%{version} -p1 -a1

mkdir -p dmsconfig
tar -xf %{SOURCE2} --strip-components 1 -C dmsconfig
find . -type f \( -name "*.sh" \) -exec sed -i '1s|^#! */usr/bin/env bash|#!/bin/bash|' {} \;
find . -type f \( -name "*.py" \) -exec sed -i '1s|^#! */usr/bin/env python3|#!/usr/bin/python3|' {} \;

%build
go build \
   -o build/dms \
   -mod=vendor \
   -buildmode=pie \
   ./cmd/dms

build/dms completion bash > "dms.bash"
build/dms completion fish > "dms.fish"
build/dms completion zsh > "_dms"

%install
install -Dm0755 build/dms -t %{buildroot}%{_bindir}

install -dm755 "%{buildroot}%{_sysconfdir}/xdg/quickshell/dms"
cp -r dmsconfig/* "%{buildroot}%{_sysconfdir}/xdg/quickshell/dms/"

install -Dm644 dms.bash -t \
    %{buildroot}%{_datadir}/bash-completion/completions
install -Dm644 dms.fish -t \
    %{buildroot}%{_datadir}/fish/vendor_completions.d
install -Dm644 _dms -t \
    %{buildroot}%{_datadir}/zsh/site-functions

%files
%license dmsconfig/LICENSE LICENSE
%doc dmsconfig/README.md README.md
%{_bindir}/dms
%dir %{_sysconfdir}/xdg/quickshell
%dir %{_sysconfdir}/xdg/quickshell/dms/
%config %{_sysconfdir}/xdg/quickshell/dms/
%{_datadir}/bash-completion/completions
%{_datadir}/fish
%{_datadir}/zsh

%changelog
openSUSE Build Service is sponsored by