forked from terrapkg/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nerd-fonts.spec
90 lines (77 loc) · 2.86 KB
/
nerd-fonts.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%global flist 3270 Agave AnonymousPro Arimo AurulentSansMono BigBlueTerminal BitstreamVeraSansMono CascadiaCode CodeNewRoman Cousine DaddyTimeMono DejaVuSansMono DroidSansMono FantasqueSansMono FiraCode FiraMono Go-Mono Gohu Hack Hasklig HeavyData Hermit IBMPlexMono Inconsolata InconsolataGo InconsolataLGC Iosevka JetBrainsMono Lekton LiberationMono Lilex MPlus Meslo Monofur Monoid Mononoki NerdFontsSymbolsOnly Noto OpenDyslexic Overpass ProFont ProggyClean RobotoMono ShareTechMono SourceCodePro SpaceMono Terminus Tinos Ubuntu UbuntuMono VictorMono iA-Writer
%global desc %{expand:
Nerd Fonts is a project that patches developer targeted fonts with a high
number of glyphs (icons).}
Name: nerd-fonts
Version: 3.1.1
Release: 1%{?dist}
URL: https://nerdfonts.com/
Source0: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v%version/readme.md
Source1: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v%version/LICENSE
License: OFL-1.1
Summary: All packaged Nerd fonts
BuildArch: noarch
Recommends: %{lua:
local x = ""
local ver = rpm.expand("%version-%release")
for font in (rpm.expand("%flist")):gmatch("[^ ]+") do
x = x .. font:lower().."-nerd-fonts = "..ver.." "
end
print(x)
}
BuildRequires: unzip
%{lua:
local url = rpm.expand(": https://github.com/ryanoasis/nerd-fonts/releases/download/v%{version}/");
local n = 2;
for font in (rpm.expand("%flist")):gmatch("[^ ]+") do
print("Source"..n..url..font..".zip\n")
n = n + 1
end
}
%description
%{desc} Specifically to add a high number of extra glyphs from popular
'iconic fonts' such as Font Awesome, Devicons, Octicons, and others.
%{lua:
local desc = rpm.expand("%desc")
for font in (rpm.expand("%flist")):gmatch("[^ ]+") do
print("%package -n "..font:lower().."-nerd-fonts\n")
print("Summary:\tPatched Nerd fonts: "..font)
print("\n%description -n "..font:lower().."-nerd-fonts\n")
print(desc..". The package contains the patched version of "..font..".\n")
end
}
%global debug_package %nil
%prep
cp %SOURCE0 .
cp %SOURCE1 .
%build
%install
mkdir -p %buildroot/usr/share/fonts/nerd-fonts/
%{lua:
local dest = rpm.expand("%buildroot/usr/share/fonts/nerd-fonts/");
local n = 2;
for font in (rpm.expand("%flist")):gmatch("[^ ]+") do
local src = rpm.expand("%SOURCE"..n)
print("unzip "..src.." -d "..dest..font.." &\n")
n = n + 1
end
}
wait
find %buildroot/usr/share/fonts/nerd-fonts/ -name "* Windows Compatible.*" -delete &
find %buildroot/usr/share/fonts/nerd-fonts/ -name "*.txt" -delete &
find %buildroot/usr/share/fonts/nerd-fonts/ -name "readme.md" -delete &
wait
%files
%doc readme.md
%license LICENSE
%{lua:
for font in (rpm.expand("%flist")):gmatch("[^ ]+") do
print("%files -n "..font:lower().."-nerd-fonts\n")
print("%doc readme.md\n")
print("%license LICENSE\n")
print("/usr/share/fonts/nerd-fonts/"..font.."\n")
end
}
%changelog
* Wed Jan 4 2023 windowsboy111 <[email protected]> - 2.2.2-1
- Initial package