User Tools

Site Tools


cnews:msfonts

msttcorefonts on RHEL6 / Centos 6 / SL6

Готовый rpm-пакет находится здесь

Источник http://oimon.wordpress.com/2011/09/05/msttcorefonts-on-rhel6-centos-6-sl6/

msttcorefonts is a way of obtaining the Microsoft TrueType fonts on Linux. However, version 6 release of Red Hat Enterprise Linux no longer includes a pre-requisite of msttcorefonts package, namely chkfontpath, which in turn, relies on the font server package xfs.

The latest version of msttcorefonts at sourceforge doesn’t cater for this, so in the meantime we can patch the spec file and build it ourselves.

1) Download the spec file from http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
2) Patch the spec file. Create a file called msttcorefonts.rhel6.patch, containing the following:

--- msttcorefonts-2.0-1.spec	2011-09-05 11:09:57.206756336 +0100
+++ msttcorefonts-2.0-1.1.spec	2011-09-05 11:23:56.925761649 +0100
@@ -19,8 +19,8 @@
 BuildPrereq: %{ttmkfdir}
 BuildPrereq: wget
 BuildPrereq: cabextract
-Prereq: /usr/sbin/chkfontpath
-Packager: Noa Resare <noa@resare.com>
+#Prereq: /usr/sbin/chkfontpath
+#Packager: Noa Resare <noa@resare.com>
 
 %description
 The TrueType core fonts for the web that was once available from
@@ -152,7 +152,7 @@
 %post
 if test $1 -eq 1
 then
-	/usr/sbin/chkfontpath --add %{fontdir}
+	ln -s /usr/share/fonts/msttcorefonts/ /etc/X11/fontpath.d/msttcorefonts
 fi
 # something has probably changed, update the font-config cache
 if test -x /usr/bin/fc-cache
@@ -163,7 +163,7 @@
 %preun
 if test $1 -eq 0
 then
-	/usr/sbin/chkfontpath --remove %{fontdir}
+	/bin/rm -f /etc/X11/fontpath.d/msttcorefonts
 fi
 
 %files

3) Patch the spec file by running the following command in the same directory as the .spec file and the .patch file{{:lcn:msttcorefonts-2.0-1.noarch.rpm|}}

patch < msttcorefonts.rhel6.patch
Visually inspect the resulting spec file to verify that it no longer requires chkfontpath.

4) Rebuild the rpm package using the new spec file
rpmbuild -bb msttcorefonts-2.0-1.spec

5) Finally, copy the resulting RPM to your local repository, or install locally with
yum localinstall msttcorefonts-2.0-1.noarch.rpm
cnews/msfonts.txt · Last modified: 10/06/2022 16:09 by 157.55.39.37