1 | %global fontname adobe-source-code-pro
|
---|
2 | %global fontconf 61-%{fontname}.conf
|
---|
3 |
|
---|
4 | %global version_roman 2.030
|
---|
5 | %global version_italic 1.050
|
---|
6 |
|
---|
7 | # OS/2 rpm macros don't define this (yet), do it manually:
|
---|
8 | # Fontconfig directory for active configuration snippets
|
---|
9 | %global _fontconfig_confdir %{_sysconfdir}/fonts/conf.d
|
---|
10 |
|
---|
11 | # Fontconfig configuration template directory
|
---|
12 | # Templates are activated by symlinking in _fontconfig_confdir
|
---|
13 | %global _fontconfig_templatedir %{_datadir}/fontconfig/conf.avail
|
---|
14 |
|
---|
15 | # Font installation directory root
|
---|
16 | %global _fontbasedir %{_datadir}/fonts
|
---|
17 |
|
---|
18 | # Actual font installation directory
|
---|
19 | %global _fontdir %{_fontbasedir}/%{?fontname:%{fontname}}%{?!fontname:%{name}}
|
---|
20 |
|
---|
21 | Name: %{fontname}-fonts
|
---|
22 | Version: %{version_roman}.%{version_italic}
|
---|
23 | Release: 1%{?dist}
|
---|
24 | Summary: A set of mono-spaced OpenType fonts designed for coding environments
|
---|
25 |
|
---|
26 | Group: User Interface/X
|
---|
27 | License: OFL
|
---|
28 | URL: https://github.com/adobe-fonts/source-code-pro
|
---|
29 | Vendor: bww bitwise works GmbH
|
---|
30 | Source0: https://github.com/adobe-fonts/source-code-pro/archive/%{version_roman}R-ro%2f%{version_italic}R-it.tar.gz#/SourceCodePro-%{version_roman}R-ro-%{version_italic}R-it.tar.gz
|
---|
31 | Source1: %{name}-fontconfig.conf
|
---|
32 | #Source2: %{fontname}.metainfo.xml
|
---|
33 |
|
---|
34 | BuildArch: noarch
|
---|
35 | #BuildRequires: fontpackages-devel
|
---|
36 | #Requires: fontpackages-filesystem
|
---|
37 |
|
---|
38 | %description
|
---|
39 | This font was designed by Paul D. Hunt as a companion to Source Sans. It has
|
---|
40 | the same weight range as the corresponding Source Sans design. It supports
|
---|
41 | a wide range of languages using the Latin script, and includes all the
|
---|
42 | characters in the Adobe Latin 4 glyph set.
|
---|
43 |
|
---|
44 |
|
---|
45 | %prep
|
---|
46 | %setup -qn source-code-pro-%{version_roman}R-ro-%{version_italic}R-it
|
---|
47 | sed -i 's/\r//' LICENSE.txt
|
---|
48 | chmod 644 LICENSE.txt
|
---|
49 |
|
---|
50 | %build
|
---|
51 |
|
---|
52 | %install
|
---|
53 | install -m 0755 -d %{buildroot}%{_fontdir}
|
---|
54 | install -m 0644 -p OTF/*.otf %{buildroot}%{_fontdir}
|
---|
55 |
|
---|
56 | install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
|
---|
57 | %{buildroot}%{_fontconfig_confdir}
|
---|
58 |
|
---|
59 |
|
---|
60 | install -m 0644 -p %{SOURCE1} %{buildroot}%{_fontconfig_templatedir}/%{fontconf}
|
---|
61 | ln -s %{_fontconfig_templatedir}/%{fontconf} %{buildroot}%{_fontconfig_confdir}/%{fontconf}
|
---|
62 |
|
---|
63 | # Add AppStream metadata
|
---|
64 | #install -Dm 0644 -p %{SOURCE2} \
|
---|
65 | # %{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml
|
---|
66 |
|
---|
67 | %post
|
---|
68 | if [ -x %{_bindir}/fc-cache ]; then
|
---|
69 | %{_bindir}/fc-cache %{_fontdir} || :
|
---|
70 | fi
|
---|
71 |
|
---|
72 | %postun
|
---|
73 | if [ $1 -eq 0 -a -x %{_bindir}/fc-cache ] ; then
|
---|
74 | %{_bindir}/fc-cache %{_fontdir} || :
|
---|
75 | fi
|
---|
76 |
|
---|
77 | %files
|
---|
78 | %doc README.md
|
---|
79 | %license LICENSE.txt
|
---|
80 | %dir %{_fontdir}
|
---|
81 | %{_fontdir}/*.otf
|
---|
82 | %{_fontconfig_templatedir}/%{fontconf}
|
---|
83 | %config(noreplace) %{_fontconfig_confdir}/%{fontconf}
|
---|
84 | #%{_datadir}/appdata/%{fontname}.metainfo.xml
|
---|
85 |
|
---|
86 |
|
---|
87 | %changelog
|
---|
88 | * Wed Mar 07 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.030.1.050-1
|
---|
89 | - initial rpm version
|
---|