Accepting request 202983 from M17N:fonts

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/202983
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fontpackages?expand=0&rev=6
This commit is contained in:
Tomáš Chvátal
2013-10-11 14:39:41 +00:00
committed by Git OBS Bridge
3 changed files with 72 additions and 18 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Sep 30 08:44:46 UTC 2013 - pgajdos@suse.com
- run fonts-config only once when installing or upgrading more
fonts in one transaction
-------------------------------------------------------------------
Wed Jan 2 09:25:45 UTC 2013 - pgajdos@suse.com

View File

@@ -17,7 +17,7 @@
Name: fontpackages
Version: 0.1
Version: 0.2
Release: 0
Summary: Commons for Font Packages
License: BSD-3-Clause

View File

@@ -5,13 +5,16 @@
%_fontsconfdir %{_sysconfdir}/fonts
%_fontsconfddir %{_fontsconfdir}/conf.d
%_fontsconfavaildir %{_datadir}/%{name}/conf.avail
# private
%__fontsconfigrunflag /var/run/fontpackages/reconfigure-fonts
%__fontsupdatescript /var/adm/update-scripts/%{name}-%{version}-%{release}-reconfigure-fonts
# 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 \
if [ "x%1" == "x%%1" ]; then \
echo "Missing argument in call to %%link_avail_to_system_fontsconf: name of configuration file." \
false \
fi \
@@ -29,7 +32,7 @@
# 4. link %{_fontsavaildir}/01-fonts.conf %{_fontsconfddir}
%install_fontsconf() \
if test "x%1" == "x%%1"; then \
if [ "x%1" == "x%%1" ]; then \
echo "Missing argument in call to %%install_fontsconf: path and name of configuration file." \
false \
fi \
@@ -68,33 +71,60 @@
Requires(pre): perl aaa_base \
%nil
# macro: reconfigure_fonts
# font setup for suse
# options:
# -c (the fonts are CJK fonts, also do setup which is only needed
# for CJK)
%reconfigure_fonts(c) \
%reconfigure_fonts \
if test -x /usr/sbin/fonts-config ; then \
LC_ALL=POSIX \
/usr/sbin/fonts-config --verbose \
fi \
%{-c: \
if test -x /usr/sbin/acroread-cidfont-config ; then \
/usr/sbin/acroread-cidfont-config \
fi \
if test -x /usr/sbin/ghostscript-cjk-config ; then \
/usr/sbin/ghostscript-cjk-config \
fi} \
%nil
# macro: reconfigure_fonts
# cjk font setup for suse
%reconfigure_fonts_cjk \
if test -x /usr/sbin/acroread-cidfont-config ; then \
/usr/sbin/acroread-cidfont-config \
fi \
if test -x /usr/sbin/ghostscript-cjk-config ; then \
/usr/sbin/ghostscript-cjk-config \
fi \
%nil
# macro: reconfigure_fonts_post
# now alias to reconfigure_fonts, this can change in the future
# options:
# -c (the fonts are CJK fonts, also do setup which is only needed
# for CJK)
%reconfigure_fonts_post(c) \
if [ $1 -ne 2 ]; then \
%reconfigure_fonts c \
mkdir -p `dirname %{__fontsconfigrunflag}` \
touch %{__fontsconfigrunflag} \
%{-c: \
touch %{__fontsconfigrunflag}-cjk \
} \
if [ -n "$ZYPP_IS_RUNNING" ]; then \
echo 'if [ -e %{__fontsconfigrunflag} ]; then' > %{__fontsupdatescript} \
echo ' if [ -x /usr/sbin/fonts-config ]; then' >> %{__fontsupdatescript} \
echo ' /usr/sbin/fonts-config --quiet' >> %{__fontsupdatescript} \
echo ' fi' >> %{__fontsupdatescript} \
echo ' rm %{__fontsconfigrunflag}' >> %{__fontsupdatescript} \
echo 'fi' >> %{__fontsupdatescript} \
echo 'rm %{__fontsupdatescript}' >> %{__fontsupdatescript} \
%{-c: \
echo 'if [ -e %{__fontsconfigrunflag}-cjk ]; then' > %{__fontsupdatescript}-cjk \
echo ' if [ -x $adobecidfontconfig ]; then' >> %{__fontsupdatescript}-cjk \
echo ' /usr/sbin/acroread-cidfont-config' >> %{__fontsupdatescript}-cjk \
echo ' fi' >> %{__fontsupdatescript}-cjk \
echo ' if [ -x $ghostscriptcjkconfig ]; then' >> %{__fontsupdatescript}-cjk \
echo ' /usr/sbin/ghostscript-cjk-config' >> %{__fontsupdatescript}-cjk \
echo ' fi' >> %{__fontsupdatescript}-cjk \
echo ' rm %{__fontsconfigrunflag}-cjk' >> %{__fontsupdatescript} \
echo 'fi' >> %{__fontsupdatescript}-cjk \
echo 'rm %{__fontsupdatescript}-cjk' >> %{__fontsupdatescript}-cjk \
} \
fi \
%nil
@@ -104,7 +134,12 @@ Requires(pre): perl aaa_base \
# -c (the fonts are CJK fonts, also do setup which is only needed
# for CJK)
%reconfigure_fonts_postun(c) \
%reconfigure_fonts c \
if [ $1 -eq 0 ]; then \
%reconfigure_fonts \
%{-c: \
%reconfigure_fonts_cjk \
} \
fi \
%nil
# macro: reconfigure_fonts_post
@@ -112,7 +147,17 @@ Requires(pre): perl aaa_base \
# options:
# -c (the fonts are CJK fonts, also do setup which is only needed
# for CJK)
%reconfigure_fonts_posttrans(c) \
%reconfigure_fonts_posttrans \
if [ -z "$ZYPP_IS_RUNNING" ]; then \
if [ -e %{__fontsconfigrunflag} ]; then \
%reconfigure_fonts \
rm %{__fontsconfigrunflag} \
fi \
if [ -e %{__fontsconfigrunflag}-cjk ]; then \
%reconfigure_fonts_cjk \
rm %{__fontsconfigrunflag}-cjk \
fi \
fi \
%nil
# macro: reconfigure_fonts_scriptles
@@ -129,5 +174,8 @@ Requires(pre): perl aaa_base \
%postun %{-n:-n %{-n*}} \
%reconfigure_fonts_postun c \
\
%posttrans %{-n:-n %{-n*}} \
%reconfigure_fonts_posttrans \
\
%nil