File maple-mono-nf-cn-fonts.spec of Package maple-mono-nf-cn-font

#
# spec file for package maple-mono-nf-cn-fonts
#
# 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/
#


%define         _version                7.7

Name:           maple-mono-nf-cn-font
Version:        %{_version}
Release:        1
Summary:        Maple Mono NF CN - Open source monospace font with round corner, ligatures and Nerd-Font icons for IDE and terminal, fine-grained customization options.
License:        OFL-1.1
Group:          System/X11/Fonts
URL:            https://github.com/subframe7536/maple-font

# This will be downloaded by the _service file
Source0:        https://github.com/subframe7536/maple-font/releases/download/v%{_version}/MapleMono-NF-CN-unhinted.zip

BuildRequires:  fontconfig
BuildRequires:  unzip
BuildArch:      noarch

%description
This package contains the Maple Mono NF CN font, a monospaced font
with Nerd Fonts integration, suitable for programming and terminal use.

%prep
%setup -c -q

%build
# Nothing to build, fonts are just data

%install
# Create font directory
install -d -m 755 %{buildroot}%{_datadir}/fonts/truetype/%{name}

# Install font files
install -m 644 *.ttf %{buildroot}%{_datadir}/fonts/truetype/%{name}/

# Install license file
install -d -m 755 %{buildroot}%{_datadir}/licenses/%{name}
install -m 644 LICENSE.txt %{buildroot}%{_datadir}/licenses/%{name}/

%post
# Update font cache
if [ -x /usr/bin/fc-cache ]; then
  /usr/bin/fc-cache -f -v &> /dev/null || :
fi

%postun
# Update font cache
if [ -x /usr/bin/fc-cache ]; then
  /usr/bin/fc-cache -f -v &> /dev/null || :
fi

%files
%license LICENSE.txt
%dir %{_datadir}/fonts/truetype
%{_datadir}/fonts/truetype/%{name}

%changelog
openSUSE Build Service is sponsored by