From Fedora Project Wiki

A page of the Fonts Special Interest Group

Complex formatting ahead
This page presents an heavily annotated template. Its official version is always available in plain text in the fontpackages package.

Foreword

This template can be used with complex multi-font releases (several font families in one upstream archive):

  • if you intend to package a single font family, use this simpler template;
  • if upstream releases separate fonts in separate archives, do not try to stuff them in a single spec/package, just package them separately.
What is a font family?
  • A font family corresponds to one entry in GUI font lists. For example, DejaVu Sans, DejaVu Serif and DejaVu Sans Mono are three different font families.
  • A font family is subdivided in faces or styles. DejaVu Sans Normal, DejaVu Sans Bold, DejaVu Sans Condensed Italic are three faces of the DejaVu Sans font family.
  • A font-metadata aware tool such as gnome-font-viewer[1] or fontforge[2] can be used to check the font family name and the font face/style declared by a font file.

The template

The following template is totally outdated. you should copy a template from fontpackages for your package. the latest is available here.
Replace <FONTNAME> with something appropriate such as foundryname-fontname. For Fedora purposes a “foundry” is an entity that publishes a set of fonts with consistent QA rules[3]. If fontname already includes the font or fonts affix, drop it.
%global fontname <FONTNAME>
fontconf is the optional fontconfig ruleset for the fonts being packaged. For more information on choosing the right fontconfig priorities, see this page.
%global fontconf <XX>-%{fontname}

Optional
#global archivename %{name}-%{version}


It is possible to define a description block that will be reused in every sub-package description. Please do not forget to complete it with subpackage-specific information later.
%define common_desc \
<FONT COLLECTION DESCRIPTION>


Name:           %{fontname}-fonts
Do not trust font metadata versionning[4], unless you've checked upstream does update versions on file changes. When in doubt use the timestamp of the most recent font file as version, for example 20081231.
Version:        
     
Release:        1%{?dist}
Font summaries need to be short and to the point. Usual informations are font style and Unicode coverage. Only repeat the font name(s) if you don't have anything else to write.
Summary:        

Make sure you've read and understand our legal page.
License:        
URL:            
Source0:        
Source1:        %{name}-fontconfig.conf
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildArch:     noarch
BuildRequires: fontpackages-devel

%description
%common_desc


%package common
Summary:  Common files for <NAME> (documentation…)
Requires: fontpackages-filesystem

%description common
%common_desc

This package consists of files used by other %{name} packages.

{{Rightnote|
%package -n %{fontname}-<FAMILY>-fonts
|In this template, you must repeat blocks of instructions for every packaged font family.
  1. Simple, but sadly not available in each and every Fedora release.
  2. Type <CTRL> + <SHIFT> + <F> to open the font metadata window in fontforge.
  3. Thus Sourceforge is not a foundry
  4. The metadata embedded in TTF or OTF files.