File dankmaterialshell.spec of Package dankmaterialshell

#
# spec file for package dankmaterialshell
#
# Copyright (c) 2025 kaiman
#
# 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:           dankmaterialshell
Version:        0.5.2
Release:        0
Summary:        A Quickshell-based desktop shell with Material 3 design principles
License:        MIT
URL:            https://github.com/AvengeMedia/DankMaterialShell
Source0:        %{name}-%{version}.tar.xz
Source1:        vendor.tar.xz
BuildRequires:  golang-packaging
BuildRequires:  zstd
Recommends:     matugen
Recommends:     cava
Recommends:     khal
Recommends:     cliphist
Recommends:     wl-clipboard
Recommends:     qt5ct
Recommends:     qt6ct
Recommends:     NetworkManager
Recommends:     brightnessctl
Recommends:     fira-code-fonts
Recommends:     inter-fonts
Recommends:     inter-variable-fonts
Recommends:     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 -p1
mkdir core/vendor
tar -xf %{SOURCE1} --strip-components 1 -C core/vendor
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
cd core
go build \
   -o build/dms \
   -mod=vendor \
   -ldflags="-s -w" \
   -buildmode=pie \
   ./cmd/dms

build/dms -c dmsconfig completion bash > "%{name}.bash"
build/dms -c dmsconfig completion fish > "%{name}.fish"
build/dms -c dmsconfig completion zsh > "_%{name}"

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

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

install -Dm644 quickshell/assets/systemd/dms.service \
    %{buildroot}%{_userunitdir}/dms.service
install -Dm644 core/%{name}.bash -t \
    %{buildroot}%{_datadir}/bash-completion/completions
install -Dm644 core/%{name}.fish -t \
    %{buildroot}%{_datadir}/fish/vendor_completions.d
install -Dm644 core/_%{name} -t \
    %{buildroot}%{_datadir}/zsh/site-functions
rm -rf %{buildroot}%{_datadir}/quickshell/dms/.git*
rm -f %{buildroot}%{_datadir}/quickshell/dms/.gitignore
rm -rf %{buildroot}%{_datadir}/quickshell/dms/.github
rm -f %{buildroot}%{_datadir}/quickshell/dms/*.spec
rm -rf %{buildroot}%{_sysconfdir}/xdg/quickshell/dms/golang.org
rm -rf %{buildroot}%{_sysconfdir}/xdg/quickshell/dms/gopkg.in
rm -rf %{buildroot}%{_sysconfdir}/xdg/quickshell/dms/github.com

%files
%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/
%{_userunitdir}/dms.service
%{_datadir}/bash-completion/completions
%{_datadir}/fish
%{_datadir}/zsh

%changelog
openSUSE Build Service is sponsored by