From 9b3d6e78acbec877a8bf619d2abf98f3608e25863de7bcbfd655cbe756e3fe2f Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Tue, 2 Oct 2012 11:44:47 +0000 Subject: [PATCH 1/3] - modified %_fontsconfavaildir to from /etc/fonts/conf.avail to /usr/share/%{name}/conf.avail as fontconfig 2.10 ship its avail conf in /usr/share/fontconfig/conf.avail - added %link_avail_to_system_fontsconf, which creates symlink pointing from /etc/fonts/conf.d to ../../../usr/share/%{name}/conf.avail OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/fontpackages?expand=0&rev=11 --- fontpackages.changes | 9 +++++++++ fontpackages.spec | 5 ++--- rpm-macros.fonts-config | 19 +++++++++++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/fontpackages.changes b/fontpackages.changes index 509434d..4da0501 100644 --- a/fontpackages.changes +++ b/fontpackages.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Oct 2 11:33:46 UTC 2012 - pgajdos@suse.com + +- modified %_fontsconfavaildir to from + /etc/fonts/conf.avail to /usr/share/%{name}/conf.avail as + fontconfig 2.10 ship its avail conf in /usr/share/fontconfig/conf.avail +- added %link_avail_to_system_fontsconf, which creates symlink pointing + from /etc/fonts/conf.d to ../../../usr/share/%{name}/conf.avail + ------------------------------------------------------------------- Tue Jul 3 13:02:24 UTC 2012 - pgajdos@suse.com diff --git a/fontpackages.spec b/fontpackages.spec index de01c97..3510b7a 100644 --- a/fontpackages.spec +++ b/fontpackages.spec @@ -1,5 +1,5 @@ # -# spec file for package fontpackage +# spec file for package fontpackages # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,8 +19,8 @@ Name: fontpackages Version: 0.1 Release: 0 -License: BSD-3-Clause Summary: Commons for Font Packages +License: BSD-3-Clause Group: System/Base Source0: rpm-macros.fonts-config Source100: COPYING @@ -53,4 +53,3 @@ cp -a %{SOURCE0} %{buildroot}%{_sysconfdir}/rpm/macros.fonts-config %config %{_sysconfdir}/rpm/macros.fonts-config %changelog - diff --git a/rpm-macros.fonts-config b/rpm-macros.fonts-config index 8bccf56..d4f5933 100644 --- a/rpm-macros.fonts-config +++ b/rpm-macros.fonts-config @@ -4,9 +4,24 @@ %_miscfontsdir %{_fontsdir}/misc %_fontsconfdir %{_sysconfdir}/fonts %_fontsconfddir %{_fontsconfdir}/conf.d -%_fontsconfavaildir %{_fontsconfdir}/conf.avail +%_fontsconfavaildir %{_datadir}/%{name}/conf.avail -# package build macros +# macro: link_avail_to_system_fontsconf name +# (takes exactly one argument, name of configuration file) +# creates symlink pointing from /etc/fonts/conf.d/name to +# ../../../usr/share/%{name}/conf.avail/name +%link_avail_to_system_fontsconf() \ + if test "x%1" == "x%%1"; then \ + echo "Missing argument in call to %%link_avail_to_system_fontsconf: name of configuration file." \ + false \ + fi \ + echo "Linking available configuration in %{_fontsconfavaildir}/%1 to %{_fontsconfddir}/%1" \ + mkdir -p "%{buildroot}%{_fontsconfddir}" \ + ln -s "../../..%{_fontsconfavaildir}/%1" "%{buildroot}%{_fontsconfddir}" \ + %nil + +# macro: reconfigure_fonts_prereq +# adds requires for fonts-config %reconfigure_fonts_prereq \ Requires(pre): perl aaa_base \ %nil From c1fc1d6efd649dcd0c611b9f9da3d50c532b016e460f22179c2d77c5532e249d Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Tue, 2 Oct 2012 15:35:01 +0000 Subject: [PATCH 2/3] - introduced new rpm macro: %install_fontsconf 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 3. create %{_fontsconfddir} 4. link %{_fontsavaildir}/01-fonts.conf %{_fontsconfddir} OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/fontpackages?expand=0&rev=12 --- fontpackages.changes | 11 +++++++++++ rpm-macros.fonts-config | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/fontpackages.changes b/fontpackages.changes index 4da0501..5c6d6ed 100644 --- a/fontpackages.changes +++ b/fontpackages.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Oct 2 15:34:14 UTC 2012 - pgajdos@suse.com + +- introduced new rpm macro: %install_fontsconf + 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 + 3. create %{_fontsconfddir} + 4. link %{_fontsavaildir}/01-fonts.conf %{_fontsconfddir} + ------------------------------------------------------------------- Tue Oct 2 11:33:46 UTC 2012 - pgajdos@suse.com diff --git a/rpm-macros.fonts-config b/rpm-macros.fonts-config index d4f5933..6308675 100644 --- a/rpm-macros.fonts-config +++ b/rpm-macros.fonts-config @@ -20,6 +20,25 @@ ln -s "../../..%{_fontsconfavaildir}/%1" "%{buildroot}%{_fontsconfddir}" \ %nil +# macro: install_fontsconf +# 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 +# 3. create %{_fontsconfddir} +# 4. link %{_fontsavaildir}/01-fonts.conf %{_fontsconfddir} + +%install_fontsconf() \ + if test "x%1" == "x%%1"; then \ + echo "Missing argument in call to %%install_fontsconf: path and name of configuration file." \ + false \ + fi \ + mkdir -p "%{buildroot}%{_fontsconfavaildir}" \ + install -m 644 -p "%1" "%{buildroot}%{_fontsconfavaildir}" \ + conffile=`basename %1` \ + %link_avail_to_system_fontsconf $conffile \ + %nil + # macro: reconfigure_fonts_prereq # adds requires for fonts-config %reconfigure_fonts_prereq \ From 6bc29260fa5f144901e0ae3b23b57763f44660b7de4d85c76db00a13fe27c794 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 8 Oct 2012 13:48:43 +0000 Subject: [PATCH 3/3] - 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 \