From 58773eaea49b81c7f02731d8896bbc39d70bebbc Mon Sep 17 00:00:00 2001 From: Nicolas Mailhot Date: Feb 14 2009 12:31:58 +0000 Subject: add documentation for font subpackages in non-font packages --- diff --git a/spec-templates/spectemplate-fonts-partial-multi.spec b/spec-templates/spectemplate-fonts-partial-multi.spec new file mode 100644 index 0000000..dcb388a --- /dev/null +++ b/spec-templates/spectemplate-fonts-partial-multi.spec @@ -0,0 +1,110 @@ +%define fontconf <①>-%{name} + +# … + +%define common_font_desc \ + + +Source1: %{name}--fontconfig.conf +# … +BuildRoot: + +BuildRequires: fontpackages-devel + +%description +%common_font_desc + + +%package fonts-common +Summary: Common files of +Group: User Interface/X +Requires: fontpackages-filesystem + +%description fonts-common +%common_font_desc + +This package consists of files used by other %{name} font packages. + + +# Repeat for every font family ③ +%package -fonts +Summary: +Group: User Interface/X +Requires: %{name}-fonts-common = %{version}-%{release} + +%description -n %{fontname}--fonts +%common_font_desc + + + +%_font_pkg -n -f %{fontconf}-.conf *.ttf + +%doc + +# … + +%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} + +# Repeat for every font family ③ +install -m 0644 -p %{SOURCEX} \ + %{buildroot}%{_fontconfig_templatedir}/%{fontconf}-.conf + +for fconf in %{fontconf}-.conf \ + %{fontconf}-.conf \ + %{fontconf}-.conf ; do + ln -s %{_fontconfig_templatedir}/$fconf \ + %{buildroot}%{_fontconfig_confdir}/$fconf +done + +# … + +%files common +%defattr(0644,root,root,0755) +%doc + +# … + +# Documentation +# (remove it from your final spec file, with the other comments) +# +# +# This is a partial template. It shows how one may create several font +# subpackages in a non-font package. Since the non-fonts part of those +# packages may vary a lot only spec extracts are documented there. Also: +# — packaging fonts in separate dedicated packages is usually lower +# maintenance than using this kind of subpackaging trick. +# — if your srpm contains only one font familiy ③, look at +# spectemplate-fonts-partial-simple.spec +# +# placeholders must be replaced by something appropriate for your font. +# +# +# ① +# Two-digit fontconfig priority number, see: +# /usr/share/fontconfig/templates/fontconfig-priorities.txt +# +# ② +# This will be reused in every font package description. +# Please do not forget to complete it with subpackage-specific information. +# +# ③ +# 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 or fontforge can be +# used to check the font family name and the font face/style declared by a +# font file. +# — For use in spec files, convert names to lowerscript and replace spaces +# with “-” diff --git a/spec-templates/spectemplate-fonts-partial-simple.spec b/spec-templates/spectemplate-fonts-partial-simple.spec new file mode 100644 index 0000000..8f00bd7 --- /dev/null +++ b/spec-templates/spectemplate-fonts-partial-simple.spec @@ -0,0 +1,77 @@ +%define fontconf <①>-%{name}-.conf + +# … + +Source1: %{name}--fontconfig.conf +BuildRoot: + +BuildRequires: fontpackages-devel + +# … + +%package -fonts +Summary: +Group: User Interface/X +BuildArch: noarch +Requires: fontpackages-filesystem + +%description -fonts + + + +%_font_pkg -n -f %{fontconf} *.ttf + +%doc + +# … + +%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 %{SOURCE1} \ + %{buildroot}%{_fontconfig_templatedir}/%{fontconf} +ln -s %{_fontconfig_templatedir}/%{fontconf} \ + %{buildroot}%{_fontconfig_confdir}/%{fontconf} + +# … + + +# Documentation +# (remove it from your final spec file, with the other comments) +# +# +# This is a partial template. It shows how one may create a single font +# subpackage in a non-font package. Since the non-fonts part of those +# packages may vary a lot only spec extracts are documented there. Also: +# — packaging fonts in separate dedicated packages is usually lower +# maintenance than using this kind of subpackaging trick. +# — if your srpm contains more than one font familiy ②, look at +# spectemplate-fonts-partial-multi.spec +# + +# +# ① +# Two-digit fontconfig priority number, see: +# /usr/share/fontconfig/templates/fontconfig-priorities.txt +# +# +# ② +# — 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 or fontforge can be +# used to check the font family name and the font face/style declared by a +# font file. +# — For use in spec files, convert names to lowerscript and replace spaces +# with “-”