[xorg-x11-fonts] - Rely on a script provided in xorg-x11-font-utils for mkfontscale and friends (#634039)
Peter Hutterer
whot at fedoraproject.org
Sun Nov 21 23:14:21 UTC 2010
commit 341c8911628813d709c6ac3df86898c2ca2605c3
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Mon Nov 22 09:14:09 2010 +1000
- Rely on a script provided in xorg-x11-font-utils for mkfontscale and
friends (#634039)
xorg-x11-fonts.spec | 67 +++++++++++++--------------------------------------
1 files changed, 17 insertions(+), 50 deletions(-)
---
diff --git a/xorg-x11-fonts.spec b/xorg-x11-fonts.spec
index 4cfb0f4..a29309d 100644
--- a/xorg-x11-fonts.spec
+++ b/xorg-x11-fonts.spec
@@ -26,7 +26,7 @@
Summary: X.Org X11 fonts
Name: xorg-x11-fonts
Version: 7.5
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT and Lucida and Public Domain
Group: User Interface/X
URL: http://www.x.org
@@ -76,7 +76,7 @@ Source44: ftp://ftp.x.org/pub/individual/font/font-xfree86-type1-1.0.3.tar.bz2
BuildRequires: pkgconfig
BuildRequires: xorg-x11-util-macros
-BuildRequires: xorg-x11-font-utils >= 7.2-11
+BuildRequires: xorg-x11-font-utils >= 7.5-3
# FIXME: fontconfig is needed only because the upstream Makefiles invoke
# fc-cache at build time. This is totally useless, because we do not ship
# any of the resulting cache files, we generate them at install time from the
@@ -347,22 +347,6 @@ for f in misc:unscaled:pri=10 75dpi:unscaled:pri=20 100dpi:unscaled:pri=30 Type1
ln -fs %{_x11fontdir}/${f%%%%:*} $RPM_BUILD_ROOT%{_catalogue}/xorg-x11-fonts-$f
done
-# Generate the encodings.dir files in the encodings directories during
-# install time to work around bugs in upstream Makefiles. This is more
-# consistent with how we generate fonts.dir files anyway. Fixes bugs:
-# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=173875
-# https://bugs.freedesktop.org/show_bug.cgi?id=6028
-{
- ENCODINGSDIR=$RPM_BUILD_ROOT%{_datadir}/X11/fonts/encodings
- [ -d "${ENCODINGSDIR}" ] || mkdir -p "${ENCODINGSDIR}"
- pushd "${ENCODINGSDIR}"
- mkfontscale -n -e "${ENCODINGSDIR}" -e "${ENCODINGSDIR}/large"
- sed -i "s@$RPM_BUILD_ROOT@@" encodings.dir
- sed -i "s@$RPM_BUILD_ROOT@@" large/encodings.dir
- popd
-}
-
-
# Create fake %ghost files for file manifests.
{
# Make ghost fonts.alias, fonts.dir, encodings.dir files
@@ -391,73 +375,52 @@ done
}
#--------------------------------------------------------------------------
-# FIXME: We should write a script, or couple of scripts for generic font
-# installation - with options if necessary, to reduce the amount of code
-# duplication in these font installation scripts, then add the generic
-# font installation script to xorg-x11-font-utils or whatever.
+# xorg-x11-fonts-update-dirs is provided by xorg-x11-font-utils to
+# deduplicate stuff run in %post
%post misc
{
- FONTDIR=%{_x11fontdir}/misc
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
+# Only run fc-cache in the Type1 dir, gzipped pcf's take forever
+ xorg-x11-fonts-update-dirs --skip-fontscale %{_x11fontdir}/misc
}
%postun misc
{
# Rebuild fonts.dir when uninstalling package. (exclude the local, CID dirs)
if [ "$1" = "0" -a -d %{_x11fontdir}/misc ]; then
- mkfontdir %{_x11fontdir}/misc
- # Only run fc-cache in the Type1 dir, gzipped pcf's take forever
- fc-cache %{_x11fontdir}/misc
+ xorg-x11-fonts-update-dirs --skip-fontscale %{_x11fontdir}/misc
fi
}
%post Type1
{
- FONTDIR=%{_type1_fontdir}/Type1
- mkfontscale $FONTDIR
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
+ xorg-x11-fonts-update-dirs %{_x11fontdir}/Type1
}
%postun Type1
{
FONTDIR=%{_type1_fontdir}/Type1
if [ "$1" = "0" -a -d $FONTDIR ]; then
- mkfontscale $FONTDIR
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
+ xorg-x11-fonts-update-dirs $FONTDIR
fi
}
%if %{with_ethiopic_fonts}
%post ethiopic
{
- FONTDIR=%{_ttf_fontdir}/TTF
- ttmkfdir -d $FONTDIR -o $FONTDIR/fonts.scale
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
-
- FONTDIR=%{_otf_fontdir}/OTF
- mkfontscale $FONTDIR
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
+ xorg-x11-fonts-update-dirs --skip_fontscale --need_ttmkfdir %{_ttf_fontdir}/TTF
+ xorg-x11-fonts-update-dirs %{_ttf_fontdir}/OTF
}
%postun ethiopic
{
FONTDIR=%{_ttf_fontdir}/TTF
if [ "$1" = "0" -a -d $FONTDIR ]; then
- ttmkfdir -d $FONTDIR -o $FONTDIR/fonts.scale
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
+ xorg-x11-fonts-update-dirs --skip_fontscale --need_ttmkfdir $FONTDIR
fi
FONTDIR=%{_otf_fontdir}/OTF
if [ "$1" = "0" -a -d $FONTDIR ]; then
- mkfontscale $FONTDIR
- mkfontdir $FONTDIR
- fc-cache $FONTDIR
+ xorg-x11-fonts-update-dirs $FONTDIR
fi
}
%endif
@@ -1091,6 +1054,10 @@ rm -rf $RPM_BUILD_ROOT
%ghost %verify(not md5 size mtime) %{_x11fontdir}/cyrillic/fonts.cache-*
%changelog
+* Fri Nov 19 2010 Peter Hutterer <peter.hutterer at redhat.com> 7.5-3
+- Rely on a script provided in xorg-x11-font-utils for mkfontscale and
+ friends (#634039)
+
* Fri Nov 12 2010 Peter Hutterer <peter.hutterer at redhat.com> 7.5-2
- This time with tarballs
More information about the fonts-bugs
mailing list