1
0
forked from pool/iosevka-fonts
iosevka-fonts/iosevka-fonts.spec

154 lines
5.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# spec file for package iosevka-fonts
#
# Copyright (c) 2020 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%global gh_v 4.0.0
%global gh_r beta.3
%global gh_f %{gh_v}-%{gh_r}
Name: iosevka-fonts
Version: %{gh_v}_%{gh_r}
Release: 2
License: OFL-1.1
Summary: Slender typeface for code, from code
Url: https://typeof.net/Iosevka/
Group: System/X11/Fonts
Source1: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-%{gh_f}.zip
Source2: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-fixed-%{gh_f}.zip
Source3: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-term-%{gh_f}.zip
Source4: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-slab-%{gh_f}.zip
Source5: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-fixed-slab-%{gh_f}.zip
Source6: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-term-slab-%{gh_f}.zip
Source7: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-curly-%{gh_f}.zip
Source8: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-fixed-curly-%{gh_f}.zip
Source9: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-term-curly-%{gh_f}.zip
Source10: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-curly-slab-%{gh_f}.zip
Source11: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-fixed-curly-slab-%{gh_f}.zip
Source12: https://github.com/be5invis/Iosevka/releases/download/v%{gh_f}/ttf-iosevka-term-curly-slab-%{gh_f}.zip
Source20: https://raw.githubusercontent.com/be5invis/Iosevka/master/LICENSE.md
Source21: https://raw.githubusercontent.com/be5invis/Iosevka/master/README.md
BuildRequires: unzip
BuildRequires: fontpackages-devel
BuildArch: noarch
%reconfigure_fonts_prereq
%description
Iosevka is an open-source, sans-serif + slab-serif, monospace + quasiproportional
typeface family, designed for writing code, using in terminals, and preparing
technical documents.
%prep
for s in %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{S:7} %{S:8} %{S:9} %{S:10} %{S:11} %{S:12};
do
unzip $s '*.ttf';
done
cp %{S:20} %{S:21} .
%build
declare -A family=( \
[iosevka]=Iosevka \
[iosevka-fixed]=IosevkaFixed \
[iosevka-term]=IosevkaTerm \
[iosevka-slab]=IosevkaSlab \
[iosevka-fixed-slab]=IosevkaFixedSlab \
[iosevka-term-slab]=IosevkaTermSlab \
[iosevka-curly]=IosevkaCurly \
[iosevka-fixed-curly]=IosevkaFixedCurly \
[iosevka-term-curly]=IosevkaTermCurly \
[iosevka-curly-slab]=IosevkaCurlySlab \
[iosevka-fixed-curly-slab]=IosevkaFixedCurlySlab \
[iosevka-term-curly-slab]=IosevkaTermCurlySlab \
)
declare -A variant=( \
[bold]=Bold \
[bolditalic]=BoldItalic \
[boldoblique]=BoldOblique \
[extralight]=Extralight \
[extralightitalic]=ExtralightItalic \
[extralightoblique]=ExtralightOblique \
[heavy]=Heavy \
[heavyitalic]=HeavyItalic \
[heavyoblique]=HeavyOblique \
[italic]=Italic \
[light]=Light \
[lightitalic]=LightItalic \
[lightoblique]=LightOblique \
[medium]=Medium \
[mediumitalic]=MediumItalic \
[mediumoblique]=MediumOblique \
[oblique]=Oblique \
[regular]=Regular \
[thin]=Thin \
[thinitalic]=ThinItalic \
[thinoblique]=ThinOblique \
[extended]=Extended \
[extendedbold]=ExtendedBold \
[extendedbolditalic]=ExtendedBoldItalic \
[extendedboldoblique]=ExtendedBoldOblique \
[extendedextrabold]=ExtendedExtrabold \
[extendedextrabolditalic]=ExtendedExtraboldItalic \
[extendedextraboldoblique]=ExtendedExtraboldOblique \
[extendedextralight]=ExtendedExtralight \
[extendedextralightitalic]=ExtendedExtralightItalic \
[extendedextralightoblique]=ExtendedExtralightOblique \
[extendedheavy]=ExtendedHeavy \
[extendedheavyitalic]=ExtendedHeavyItalic \
[extendedheavyoblique]=ExtendedHeavyOblique \
[extendeditalic]=ExtendedItalic \
[extendedlight]=ExtendedLight \
[extendedlightitalic]=ExtendedLightItalic \
[extendedlightoblique]=ExtendedLightOblique \
[extendedmedium]=ExtendedMedium \
[extendedmediumitalic]=ExtendedMediumItalic \
[extendedmediumoblique]=ExtendedMediumOblique \
[extendedoblique]=ExtendedOblique \
[extendedsemibold]=ExtendedSemibold \
[extendedsemibolditalic]=ExtendedSemiboldItalic \
[extendedsemiboldoblique]=ExtendedSemiboldOblique \
[extendedthin]=ExtendedThin \
[extendedthinitalic]=ExtendedThinItalic \
[extendedthinoblique]=ExtendedThinOblique \
[extrabold]=Extrabold \
[extrabolditalic]=ExtraboldItalic \
[extraboldoblique]=ExtraboldOblique \
[semibold]=Semibold \
[semibolditalic]=SemiboldItalic \
[semiboldoblique]=SemiboldOblique \
)
for f in ${!family[@]};
do
for v in ${!variant[@]};
do
mv $f-$v.ttf ${family[$f]}-${variant[$v]}.ttf
done
done
%install
install -d %{buildroot}%{_ttfontsdir}
install -m0644 *.ttf %{buildroot}%{_ttfontsdir}
%reconfigure_fonts_scriptlets
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc README.md
%license LICENSE.md
%{_ttfontsdir}