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
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
Thanks for the instructions. They worked great. Received a message that the rpm was not signed so I just rpm -ivh the file and it installed perfectly. Thanks again.
Thanks! Worked perfectly!
Thanks! Was perfect! Warked pefectly!!!!
Excellent. Appreciate it!
Doesnt build with rpm 4.8 in scientific 6.2.
had to use this http://forums.fedoraforum.org/showthread.php?t=273302
I think an ‘if’ is not closed unless this output is expected.
patching file msttcorefonts-2.0-1.spec
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 163 with fuzz 1.
Using CentOS release 6.3 (Final)
Thanks. Worked first go and saved me a lot of time.
Wonder where I went wrong. I had to manually “uncab” the font files and install them manually
thanks a lot
I’m on CentOs and I get:
“cabextract is needed by msttcorefonts-2.0-1.noarch…” after issuing:
rpmbuild -bb msttcorefonts-2.0-1.spec
so install it from the rpmforge repo.
`yum install cabextract`
Thank you much. Works great on CentOS release 6.4 (Final).
it’swork on RHEL 6.4. Thanks so muc
Thank you for this. Worked fine on CentOS 6.6.
Pingback: i-Parapheur : installation – Pascal MIETLICKI