From c1fc1d6efd649dcd0c611b9f9da3d50c532b016e460f22179c2d77c5532e249d Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Tue, 2 Oct 2012 15:35:01 +0000 Subject: [PATCH] - 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 \