Petr Gajdos 2013-10-04 13:46:58 +00:00 committed by Git OBS Bridge
parent a6ee90f51c
commit f2654d1bcc
4 changed files with 52 additions and 40 deletions

View File

@ -23,8 +23,6 @@ Summary: Commons for Font Packages
License: BSD-3-Clause License: BSD-3-Clause
Group: System/Base Group: System/Base
Source0: rpm-macros.fonts-config Source0: rpm-macros.fonts-config
Source1: reconfigure-fonts.sh
Source2: reconfigure-fonts-cjk.sh
Source100: COPYING Source100: COPYING
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch BuildArch: noarch
@ -48,14 +46,10 @@ cp %{SOURCE100} .
%install %install
mkdir -p %{buildroot}%{_sysconfdir}/rpm mkdir -p %{buildroot}%{_sysconfdir}/rpm
cp -a %{SOURCE0} %{buildroot}%{_sysconfdir}/rpm/macros.fonts-config cp -a %{SOURCE0} %{buildroot}%{_sysconfdir}/rpm/macros.fonts-config
mkdir -p %{buildroot}%{_datadir}/%{name}-devel
cp -a %{SOURCE1} %{SOURCE2} %{buildroot}%{_datadir}/%{name}-devel
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING %doc COPYING
%config %{_sysconfdir}/rpm/macros.fonts-config %config %{_sysconfdir}/rpm/macros.fonts-config
%dir %{_datadir}/%{name}-devel
%{_datadir}/%{name}-devel/*.sh
%changelog %changelog

View File

@ -1,11 +0,0 @@
adobecifontconfig=/usr/sbin/acroread-cidfont-config
ghostscriptcjkconfig=/usr/sbin/ghostscript-cjk-config
runflag=/var/run/fontpackages/reconfigure-fonts-cjk
if [ -e $runflag ]; then
if [ -x $adobecidfontconfig ]; then
$adobecidfontconfig
fi
if [ -x $ghostscriptcjkconfig ]; then
$ghostscriptcjkconfig
fi
fi

View File

@ -1,8 +0,0 @@
runflag=/var/run/fontpackages/reconfigure-fonts
fontsconfig=/usr/sbin/fonts-config
if [ -e $runflag ]; then
if [ -x $fontsconfig ]; then
$fontsconfig --quiet
fi
rm $runflag
fi

View File

@ -6,10 +6,8 @@
%_fontsconfddir %{_fontsconfdir}/conf.d %_fontsconfddir %{_fontsconfdir}/conf.d
%_fontsconfavaildir %{_datadir}/%{name}/conf.avail %_fontsconfavaildir %{_datadir}/%{name}/conf.avail
# private # private
%__fontsconfigrunflag /var/run/fontpackages/reconfigure-fonts %__fontsconfigrunflag /var/run/fontpackages/reconfigure-fonts
%__run_fonts_config /usr/share/fontpackages-devel/reconfigure-fonts.sh %__fontsupdatescript /var/adm/update-scripts/%{name}-%{version}-%{release}-reconfigure-fonts
%__run_cjk_init /usr/share/fontpackages-devel/reconfigure-fonts-cjk.sh
%__fontsupdatescript /var/adm/update-scripts/%{name}-%{version}-%{release}-reconfigure-fonts
# macro: link_avail_to_system_fontsconf name # macro: link_avail_to_system_fontsconf name
# (takes exactly one argument, name of configuration file) # (takes exactly one argument, name of configuration file)
@ -73,6 +71,29 @@
Requires(pre): perl aaa_base \ Requires(pre): perl aaa_base \
%nil %nil
# macro: reconfigure_fonts
# font setup for suse
%reconfigure_fonts \
if test -x /usr/sbin/fonts-config ; then \
LC_ALL=POSIX \
/usr/sbin/fonts-config --verbose \
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 # macro: reconfigure_fonts_post
# now alias to reconfigure_fonts, this can change in the future # now alias to reconfigure_fonts, this can change in the future
# options: # options:
@ -85,10 +106,23 @@ Requires(pre): perl aaa_base \
touch %{__fontsconfigrunflag}-cjk \ touch %{__fontsconfigrunflag}-cjk \
} \ } \
if [ -n "$ZYPP_IS_RUNNING" ]; then \ if [ -n "$ZYPP_IS_RUNNING" ]; then \
cp %{__run_fonts_config} %{__fontsupdatescript} \ 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} \ echo 'rm %{__fontsupdatescript}' >> %{__fontsupdatescript} \
%{-c: \ %{-c: \
cp %{__run_cjk_init} %{__fontsupdatescript}-cjk \ 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 \ echo 'rm %{__fontsupdatescript}-cjk' >> %{__fontsupdatescript}-cjk \
} \ } \
fi \ fi \
@ -100,14 +134,11 @@ Requires(pre): perl aaa_base \
# -c (the fonts are CJK fonts, also do setup which is only needed # -c (the fonts are CJK fonts, also do setup which is only needed
# for CJK) # for CJK)
%reconfigure_fonts_postun(c) \ %reconfigure_fonts_postun(c) \
mkdir -p `dirname %{__fontsconfigrunflag}` \
touch %{__fontsconfigrunflag} \
%{-c: \
touch %{__fontsconfigrunflag}-cjk \
} \
if [ $1 -eq 0 ]; then \ if [ $1 -eq 0 ]; then \
sh %{__run_fonts_config} \ %reconfigure_fonts \
%{-c: sh %{__run_cjk_init}} \ %{-c: \
%reconfigure_fonts_cjk \
} \
fi \ fi \
%nil %nil
@ -118,8 +149,14 @@ Requires(pre): perl aaa_base \
# for CJK) # for CJK)
%reconfigure_fonts_posttrans \ %reconfigure_fonts_posttrans \
if [ -z "$ZYPP_IS_RUNNING" ]; then \ if [ -z "$ZYPP_IS_RUNNING" ]; then \
sh %{__run_fonts_config} \ if [ -e %{__fontsconfigrunflag} ]; then \
sh %{__run_cjk_init} \ %reconfigure_fonts \
rm %{__fontsconfigrunflag} \
fi \
if [ -e %{__fontsconfigrunflag}-cjk ]; then \
%reconfigure_fonts_cjk \
rm %{__fontsconfigrunflag}-cjk \
fi \
fi \ fi \
%nil %nil