File ttf-fonts-hack-nerd.spec of Package ttf-fonts-nerd

#
# spec file for package .nerd-font-hack
#
# Copyright (c) 2024 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 BASE_FONT hack
%define FONT_VERSION 3.3.0
%define PRETTY_NAME Hack

Name: 		ttf-fonts-%{BASE_FONT}-nerd
Version: 	%{FONT_VERSION}
Release: 	1%{?dist}
Summary: 	Nerd Fonts patched %{PRETTY_NAME} font
License: 	MIT
Group:		System/X11/Fonts       
URL: 		https://github.com/ryanoasis/nerd-fonts       
Source0: 	%{BASE_FONT}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires: 	xz
Requires:   fontconfig
BuildArch: 	noarch

%description
Nerd Fonts patched %{PRETTY_NAME} font.

Nerd Fonts is a project that patches developer targeted fonts with a high number of glyphs (icons). 
Specifically to add a high number of extra glyphs from popular 'iconic fonts' such as Font Awesome, Devicons, Octicons, and others.

%prep
%setup -c -q

%build

%install
# install license
install -dm755 %{buildroot}%{_datadir}/doc/packages/%{name}
install -Dm644 *.md %{buildroot}%{_datadir}/doc/packages/%{name}/
# install fonts
install -dm755 %{buildroot}%{_datadir}/fonts/truetype
install -Dm644 *.ttf %{buildroot}%{_datadir}/fonts/truetype/

%files
%defattr(-,root,root)
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/*
%dir %{_datadir}/doc/packages/%{name}/
%{_datadir}/doc/packages/%{name}/*


%post
if [ -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%postun
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%changelog

openSUSE Build Service is sponsored by