From Fedora Project Wiki

(New page: {{CompactHeader|fonts-sig}} {{Admon/warning|Complex formatting ahead|This page presents an heavily annotated template. Its official version is always available in plain text in the [[Fedo...)
 
(fix link)
 
(6 intermediate revisions by 4 users not shown)
Line 12: Line 12:


== The template ==
== The template ==
{{Admon/warning|The following template is totally outdated. you should copy a template from fontpackages for your package. the latest is available [https://pagure.io/fontpackages/blob/master/f/spec-templates here].}}


{{Rightnote|<pre>%define fontname <FONTNAME></pre>|{{:Fonts spec template notes/fontname}}}}
{{Rightnote|<pre>%global fontname <FONTNAME></pre>|{{:Fonts spec template notes/fontname}}}}
{{Rightnote|<pre>%define fontconf <XX>-%{fontname}</pre>|{{:Fonts spec template notes/fontconfig-prio}}}}<pre>
{{Rightnote|<pre>%global fontconf <XX>-%{fontname}</pre>|{{:Fonts spec template notes/fontconfig-prio}}}}<pre>


</pre>{{Rightnote|<pre>#define archivename %{name}-%{version}</pre>|Optional}}<pre>
</pre>{{Rightnote|<pre>#global archivename %{name}-%{version}</pre>|Optional}}<pre>




Line 28: Line 29:
</pre>{{Rightnote|<pre>Summary:        </pre>|{{:Fonts spec template notes/summary}}}}<pre>
</pre>{{Rightnote|<pre>Summary:        </pre>|{{:Fonts spec template notes/summary}}}}<pre>


Group:          User Interface/X
</pre>{{Rightnote|<pre>License:        </pre>|{{:Fonts spec template notes/licensing}}}}<pre>
</pre>{{Rightnote|<pre>License:        </pre>|{{:Fonts spec template notes/licensing}}}}<pre>
URL:             
URL:             
Line 44: Line 44:
%package common
%package common
Summary:  Common files for <NAME> (documentation…)
Summary:  Common files for <NAME> (documentation…)
Group:    User Interface/X
Requires: fontpackages-filesystem
Requires: fontpackages-filesystem


Line 52: Line 51:
This package consists of files used by other %{name} packages.
This package consists of files used by other %{name} packages.


</pre>{{Rightnote|<pre>%package <FAMILY></pre>|{{:Fonts spec template notes/multi}}}}<pre>
</pre>{{Rightnote|<pre>%package -n %{fontname}-<FAMILY>-fonts</pre>|{{:Fonts spec template notes/multi}}
</pre>{{Rightnote|<pre>Summary:        </pre>|{{:Fonts spec template notes/summary}}}}<pre>
Group:    User Interface/X
Requires: %{name}-common = %{version}-%{release}
 
 
</pre>{{Rightnote|<pre>%description <FAMILY>
%common_desc
 
<FAMILY DESCRIPTION></pre>|{{:Fonts spec template notes/description}}}}<pre>
 
</pre>{{Rightnote|<pre>%_font_pkg -n <FAMILY> -f %{fontconf}-<FAMILY>.conf <NAME>*.ttf</pre>|{{:Fonts spec template notes/font_pkg}}}}<pre>
 
 
%prep
%setup -q
 
 
</pre>{{Rightnote|<pre>%build</pre>|{{:Fonts spec template notes/build}}}}<pre>
 
 
%install
rm -fr %{buildroot}
 
install -m 0755 -d %{buildroot}%{_fontdir}
</pre>{{Rightnote|<pre>install -m 0644 -p *.ttf %{buildroot}%{_fontdir}</pre>|{{:Fonts spec template notes/font-install}}}}<pre>
 
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
                  %{buildroot}%{_fontconfig_confdir}
 
</pre>{{Rightnote|<pre>install -m 0644 -p %{SOURCEX} \
        %{buildroot}%{_fontconfig_templatedir}/%{fontconf}-<FAMILYX>.conf</pre>|{{:Fonts spec template notes/multi}}}}<pre>
 
 
</pre>{{Rightnote|<pre>for fontconf in %{fontconf}-<FAMILYX>.conf \
                %{fontconf}-<FAMILYY>.conf \
                %{fontconf}-<FAMILYZ>.conf ; do
  ln -s %{_fontconfig_templatedir}/$fontconf \
        %{buildroot}%{_fontconfig_confdir}/$fontconf
done</pre>|{{:Fonts spec template notes/fontconfig-passive-ruleset}}}}<pre>
 
 
%clean
rm -fr %{buildroot}
 
 
%files common
%defattr(0644,root,root,0755)
</pre>{{Rightnote|<pre>%doc</pre>|{{:Fonts spec template notes/doc}}}}<pre>
 
%dir %{_fontdir}
 
</pre>{{Rightnote|<pre>%changelog</pre>|{{:Fonts spec template notes/changelog}}}}
 
 
Notes:
<references/>
 
{{:Fonts_SIG_signature}} [[Category:Fonts packaging|Spec template, multi]] [[Category:Documentation|Spec template, fonts, multi]][[Category:Template|Spec template, fonts, multi]]

Latest revision as of 06:50, 18 September 2018

A page of the Fonts Special Interest Group

Warning.png
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.
Note.png
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

Warning.png
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.