Blame spec-templates/spectemplate-fonts-partial-simple.spec

Packit 46375d
%global fontconf <①>-%{name}-<FAMILY>.conf
Packit 46375d
Packit 46375d
# …
Packit 46375d
Packit 46375d
Source1:        %{name}-<FAMILY>-fontconfig.conf
Packit 46375d
# …
Packit 46375d
Packit 46375d
BuildRequires:  fontpackages-devel
Packit 46375d
Packit 46375d
# …
Packit 46375d
Packit 46375d
%package <FAMILY>-fonts
Packit 46375d
Summary:        
Packit 46375d
Group:          User Interface/X
Packit 46375d
BuildArch:      noarch
Packit 46375d
Requires:       fontpackages-filesystem
Packit 46375d
Packit 46375d
%description <FAMILY>-fonts
Packit 46375d
Packit 46375d
<FAMILY DESCRIPTION>
Packit 46375d
Packit 46375d
%_font_pkg -n <FAMILY> -f %{fontconf} <NAME>*.ttf
Packit 46375d
Packit 46375d
%doc <FONT DOCUMENTATION>
Packit 46375d
Packit 46375d
# …
Packit 46375d
Packit 46375d
%install
Packit 46375d
rm -fr %{buildroot}
Packit 46375d
Packit 46375d
# …
Packit 46375d
Packit 46375d
install -m 0755 -d %{buildroot}%{_fontdir}
Packit 46375d
install -m 0644 -p *.ttf %{buildroot}%{_fontdir}
Packit 46375d
Packit 46375d
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
Packit 46375d
                   %{buildroot}%{_fontconfig_confdir}
Packit 46375d
Packit 46375d
install -m 0644 -p %{SOURCE1} \
Packit 46375d
        %{buildroot}%{_fontconfig_templatedir}/%{fontconf}
Packit 46375d
ln -s %{_fontconfig_templatedir}/%{fontconf} \
Packit 46375d
      %{buildroot}%{_fontconfig_confdir}/%{fontconf}
Packit 46375d
Packit 46375d
# …
Packit 46375d
Packit 46375d
Packit 46375d
# Documentation
Packit 46375d
# (remove it from your final spec file, with the other comments)
Packit 46375d
#
Packit 46375d
#
Packit 46375d
# This is a partial template. It shows how one may create a single font
Packit 46375d
# subpackage in a non-font package. Since the non-fonts part of those
Packit 46375d
# packages may vary a lot only spec extracts are documented there. Also:
Packit 46375d
# — packaging fonts in separate dedicated packages is usually lower
Packit 46375d
#   maintenance than using this kind of subpackaging trick.
Packit 46375d
# — if your srpm contains more than one font familiy ②, look at
Packit 46375d
#   spectemplate-fonts-partial-multi.spec
Packit 46375d
#
Packit 46375d
Packit 46375d
#
Packit 46375d
# ①
Packit 46375d
# Two-digit fontconfig priority number, see:
Packit 46375d
# /usr/share/fontconfig/templates/fontconfig-priorities.txt
Packit 46375d
#
Packit 46375d
#
Packit 46375d
# ②
Packit 46375d
# — A font family corresponds to one entry in GUI font lists. For example,
Packit 46375d
#   DejaVu Sans, DejaVu Serif and DejaVu Sans Mono are three different font
Packit 46375d
#   families.
Packit 46375d
# — A font family is subdivided in faces or styles. DejaVu Sans Normal, DejaVu
Packit 46375d
#   Sans Bold, DejaVu Sans Condensed Italic are three faces of the DejaVu Sans
Packit 46375d
#   font family.
Packit 46375d
# — A font-metadata aware tool such as gnome-font-viewer or fontforge can be
Packit 46375d
#   used to check the font family name and the font face/style declared by a
Packit 46375d
#   font file.
Packit 46375d
# — For use in spec files, convert names to lowerscript and replace spaces
Packit 46375d
#   with “-”