(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...) |
|||
Line 86: | Line 86: | ||
</pre>{{Rightnote|<pre>for | </pre>{{Rightnote|<pre>for fconf in %{fontconf}-<FAMILYX>.conf \ | ||
%{fontconf}-<FAMILYY>.conf \ | %{fontconf}-<FAMILYY>.conf \ | ||
%{fontconf}-<FAMILYZ>.conf ; do | %{fontconf}-<FAMILYZ>.conf ; do | ||
ln -s %{_fontconfig_templatedir}/$ | ln -s %{_fontconfig_templatedir}/$fconf \ | ||
%{buildroot}%{_fontconfig_confdir}/$ | %{buildroot}%{_fontconfig_confdir}/$fconf | ||
done</pre>|{{:Fonts spec template notes/fontconfig-passive-ruleset}}}}<pre> | done</pre>|{{:Fonts spec template notes/fontconfig-passive-ruleset}}}}<pre> | ||
Revision as of 10:15, 4 January 2009
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.
The template
%define fontname <FONTNAME>
%define fontconf <XX>-%{fontname}
#define archivename %{name}-%{version}
%define common_desc \ <FONT COLLECTION DESCRIPTION>
Name: %{fontname}-fonts
Version:
Release: 1%{?dist}
Summary:
Group: User Interface/X
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…) Group: User Interface/X Requires: fontpackages-filesystem %description common %common_desc This package consists of files used by other %{name} packages.
%package <FAMILY>
Summary:
Group: User Interface/X Requires: %{name}-common = %{version}-%{release}
Incidentally, this is a good way to check if the licensing information declared by upstream is correct and if some fontconfig substitution rules can be added to the package.
Examples of terrific font descriptions are found on the Greek Font Society web site. This is what other font packages should strive to emulate.
%description <FAMILY> %common_desc <FAMILY DESCRIPTION>
- an optional -n name subpackage name
- an optional -f pattern fontconfig pattern name. The corresponding files must be installed by the packager in %{_fontconfig_templatedir} and %{_fontconfig_confdir} in the %install section.
- a list of font names or font name patterns. The corresponding files must be installed by the packager in %{_fontdir} in the %install section.
%_font_pkg -n <FAMILY> -f %{fontconf}-<FAMILY>.conf <NAME>*.ttf
%prep %setup -q
%build
%install rm -fr %{buildroot} install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p *.ttf %{buildroot}%{_fontdir}
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \ %{buildroot}%{_fontconfig_confdir}
install -m 0644 -p %{SOURCEX} \ %{buildroot}%{_fontconfig_templatedir}/%{fontconf}-<FAMILYX>.conf
- install it in %{_fontconfig_templatedir},
- create symbolic link with the same name in %{_fontconfig_confdir}, that points to /dev/null.
for fconf in %{fontconf}-<FAMILYX>.conf \ %{fontconf}-<FAMILYY>.conf \ %{fontconf}-<FAMILYZ>.conf ; do ln -s %{_fontconfig_templatedir}/$fconf \ %{buildroot}%{_fontconfig_confdir}/$fconf done
%clean rm -fr %{buildroot} %files common %defattr(0644,root,root,0755)
%doc
%dir %{_fontdir}