From 6bc29260fa5f144901e0ae3b23b57763f44660b7de4d85c76db00a13fe27c794 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 8 Oct 2012 13:48:43 +0000 Subject: [PATCH] - introduced new rpm macro: %files_fontsconf_availdir to be included in %files section of package which ships own fontconfig files; expands in /usr/share/%{name} /usr/share/%{name}/conf.avail - introduced new rpm macro: %files_fontsconf_file to be included in %files section of package which ships own fontconfig file; %files_fontsconf_file -l name.conf expands in /usr/share/%{name}/conf.avail/name.conf %config /etc/fonts/conf.d/name.conf when -l switch isn't supplied, only /usr/share/%{name}/conf.avail/name.conf is packaged OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/fontpackages?expand=0&rev=13 --- fontpackages.changes | 22 ++++++++++++++++++++++ rpm-macros.fonts-config | 25 ++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/fontpackages.changes b/fontpackages.changes index 5c6d6ed..f4988f6 100644 --- a/fontpackages.changes +++ b/fontpackages.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Mon Oct 8 12:39:33 UTC 2012 - pgajdos@suse.com + +- introduced new rpm macro: %files_fontsconf_availdir + to be included in %files section of package which ships own + fontconfig files; expands in + /usr/share/%{name} + /usr/share/%{name}/conf.avail +- introduced new rpm macro: %files_fontsconf_file + to be included in %files section of package which ships own + fontconfig file; + + %files_fontsconf_file -l name.conf + + expands in + /usr/share/%{name}/conf.avail/name.conf + %config /etc/fonts/conf.d/name.conf + + when -l switch isn't supplied, only + /usr/share/%{name}/conf.avail/name.conf + is packaged + ------------------------------------------------------------------- Tue Oct 2 15:34:14 UTC 2012 - pgajdos@suse.com diff --git a/rpm-macros.fonts-config b/rpm-macros.fonts-config index 6308675..0bad8aa 100644 --- a/rpm-macros.fonts-config +++ b/rpm-macros.fonts-config @@ -21,7 +21,7 @@ %nil # macro: install_fontsconf -# for given file (path/to/01-font.conf), it +# takes exactly one argument; for given file (path/to/01-font.conf), it # 1. creates %{_fontsconfavaildir} # 2. copies path/to/01-font.conf to %{_fontsconfavaildir} # uses %link_avail_to_system_fontsconf to @@ -39,6 +39,29 @@ %link_avail_to_system_fontsconf $conffile \ %nil +# macro: files_fontsconf_availdir +# packages /usr/share/%{name}/conf.avail directory, +# which is intended for fontconfig files shipped by the +# (font) package + +%files_fontsconf_availdir() \ +%dir %{_datadir}/%{name} \ +%dir %{_fontsconfavaildir} \ +%nil + +# macro: files_fontsconf_file +# takes exactly one argument; for given fontconfig file +# (01-fontconfig.conf) macro expands in correct %%files entry +# +# -l option also packages %%{_fontsconfddir}/01-fontconfig.conf link + +%files_fontsconf_file(l) \ +%{_fontsconfavaildir}/%1 \ +%{-l: \ +%config %{_fontsconfddir}/%1 \ +} \ +%nil + # macro: reconfigure_fonts_prereq # adds requires for fonts-config %reconfigure_fonts_prereq \