| 1 | %global fontname source-sans-pro
|
|---|
| 2 | %global fontconf 63-%{fontname}.conf
|
|---|
| 3 |
|
|---|
| 4 | %global roman_version 2.020
|
|---|
| 5 | %global italic_version 1.075
|
|---|
| 6 | %global github_tag %{roman_version}R-ro/%{italic_version}R-it
|
|---|
| 7 | %global source_dir %{fontname}-%{roman_version}R-ro-%{italic_version}R-it
|
|---|
| 8 |
|
|---|
| 9 | # OS/2 rpm macros don't define this (yet), do it manually:
|
|---|
| 10 | # Fontconfig directory for active configuration snippets
|
|---|
| 11 | %global _fontconfig_confdir %{_sysconfdir}/fonts/conf.d
|
|---|
| 12 |
|
|---|
| 13 | # Fontconfig configuration template directory
|
|---|
| 14 | # Templates are activated by symlinking in _fontconfig_confdir
|
|---|
| 15 | %global _fontconfig_templatedir %{_datadir}/fontconfig/conf.avail
|
|---|
| 16 |
|
|---|
| 17 | # Font installation directory root
|
|---|
| 18 | %global _fontbasedir %{_datadir}/fonts
|
|---|
| 19 |
|
|---|
| 20 | # Actual font installation directory
|
|---|
| 21 | %global _fontdir %{_fontbasedir}/%{?fontname:%{fontname}}%{?!fontname:%{name}}
|
|---|
| 22 |
|
|---|
| 23 | Name: adobe-source-sans-pro-fonts
|
|---|
| 24 | Version: %{roman_version}
|
|---|
| 25 | Release: 1%{?dist}
|
|---|
| 26 | Summary: A set of OpenType fonts designed for user interfaces
|
|---|
| 27 |
|
|---|
| 28 | License: OFL
|
|---|
| 29 | URL: https://github.com/adobe-fonts/source-sans-pro
|
|---|
| 30 | Vendor: bww bitwise works GmbH
|
|---|
| 31 | #unable to build from source: source format is unbuildable with free software
|
|---|
| 32 | Source0: https://github.com/adobe-fonts/source-sans-pro/archive/%{github_tag}/%{name}-%{version}.tar.gz
|
|---|
| 33 | Source1: %{name}-fontconfig.conf
|
|---|
| 34 | #Source2: %{fontname}.metainfo.xml
|
|---|
| 35 |
|
|---|
| 36 | #BuildRequires: fontpackages-devel
|
|---|
| 37 | #Requires: fontpackages-filesystem
|
|---|
| 38 | BuildArch: noarch
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 | %description
|
|---|
| 42 | Source Sans is a set of OpenType fonts that have been designed to work well in
|
|---|
| 43 | user interface (UI) environments, as well as in text setting for screen and
|
|---|
| 44 | print.
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | %prep
|
|---|
| 48 | %autosetup -n %{source_dir}
|
|---|
| 49 |
|
|---|
| 50 | # Fix permissions
|
|---|
| 51 | chmod 0644 LICENSE.txt README.md
|
|---|
| 52 |
|
|---|
| 53 | # Fix wrong EOLs
|
|---|
| 54 | sed -i.orig "s/\r//" LICENSE.txt && \
|
|---|
| 55 | touch -r LICENSE.txt.orig LICENSE.txt && \
|
|---|
| 56 | rm LICENSE.txt.orig
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 | %build
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 | %install
|
|---|
| 63 | install -m 0755 -d %{buildroot}%{_fontdir}
|
|---|
| 64 | install -m 0644 -p OTF/*.otf %{buildroot}%{_fontdir}
|
|---|
| 65 |
|
|---|
| 66 | install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
|
|---|
| 67 | %{buildroot}%{_fontconfig_confdir}
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | install -m 0644 -p %{SOURCE1} %{buildroot}%{_fontconfig_templatedir}/%{fontconf}
|
|---|
| 71 | ln -s %{_fontconfig_templatedir}/%{fontconf} %{buildroot}%{_fontconfig_confdir}/%{fontconf}
|
|---|
| 72 |
|
|---|
| 73 | # Add AppStream metadata
|
|---|
| 74 | #install -Dm 0644 -p %{SOURCE2} \
|
|---|
| 75 | # %{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | %post
|
|---|
| 79 | if [ -x %{_bindir}/fc-cache ]; then
|
|---|
| 80 | %{_bindir}/fc-cache %{_fontdir} || :
|
|---|
| 81 | fi
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 | %postun
|
|---|
| 85 | if [ $1 -eq 0 -a -x %{_bindir}/fc-cache ] ; then
|
|---|
| 86 | %{_bindir}/fc-cache %{_fontdir} || :
|
|---|
| 87 | fi
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 | %files
|
|---|
| 91 | %doc README.md
|
|---|
| 92 | %license LICENSE.txt
|
|---|
| 93 | %dir %{_fontdir}
|
|---|
| 94 | %{_fontdir}/*.otf
|
|---|
| 95 | %{_fontconfig_templatedir}/%{fontconf}
|
|---|
| 96 | %config(noreplace) %{_fontconfig_confdir}/%{fontconf}
|
|---|
| 97 | #%{_datadir}/appdata/%{fontname}.metainfo.xml
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 | %changelog
|
|---|
| 101 | * Wed Mar 07 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.020-1
|
|---|
| 102 | - initial rpm version
|
|---|