This page is outdated! See discussion at http://forums.fedoraforum.org/showthread.php?p=1601697

New msttcore-fonts-2.1-1.spec to download at install time. Since msttcore-fonts-2.1-1.noarch.rpm does not have the fonts in it, it is distributable: mscorefonts2

Microsoft's TrueType Core Fonts on Fedora and CentOS6/rpmforge

Abstract:

sudo yum install rpm-build cabextract wget rpmdevtools
rpmdev-setuptree
cd ~/rpmbuild/SPECS
wget --output-document=msttcore-fonts-2.0-5.spec "http://moin.kordewiner.com/helpdesk/fedora/mscorefonts?action=AttachFile&do=get&target=msttcore-fonts-2.0-5.spec"
rpmbuild -ba msttcore-fonts-2.0-5.spec
sudo yum localinstall --nogpgcheck ../RPMS/noarch/msttcore-fonts-2.0-5.noarch.rpm

Noa Resare <noa@resare.com> 2.0-1

http://corefonts.sourceforge.net

msttcorefonts-2.0-1.spec

Andrew Bartlett <abartlet@samba.org> 2.0-2

https://lists.fedoraproject.org/pipermail/devel/2008-February/124034.html

msttcorefonts-2.0-2.spec

Zied FAKHFAKH <fzied@dottn.com> 2.0-3

http://www.dottn.com/files/msttcorefonts-2.0-3.spec

msttcorefonts-2.0-3.spec

Muayyad Saleh Alsadi <alsadi gmail com> 2.0-3

Neuen Dateianhang "msttcore-fonts-2.0-3.spec" hochladen

Dennis Johnson 2.0-4

http://fenris02.fedorapeople.org/msttcore-fonts-2.0-4.spec

msttcore-fonts-2.0-4.spec

Hnr Kordewiner <hnr@kordewiner.com> 2.0-5

%define fontname msttcore

%define fontdir %{_datadir}/fonts/%{fontname} 

Summary: TrueType core fonts for the web
Name: %{fontname}-fonts
Obsoletes: msttcorefonts
Provides: msttcorefonts
Version: 2.0
Release: 5
License: Spec file is GPL, binary rpm is gratis but non-distributable
Group: User Interface/X
BuildArch: noarch
BuildRoot: /var/tmp/%{name}-root
BuildRequires: wget, cabextract
Packager: Hnr Kordewiner <hnr@kordewiner.com>
Requires: ttmkfdir, fontpackages-filesystem
URL: http://corefonts.sourceforge.net/

%description
The TrueType core fonts for the web that was once available from
http://www.microsoft.com/typography/fontpack/. The src rpm is cleverly
constructed so that the actual fonts are downloaded from Sourceforge's site
at build time. Therefore this package technically does not 'redistribute'
the fonts, it just makes it easy to install them on a linux system.

%prep
mkdir -p %{name}/downloads
cd %{name}/downloads

# this is the sourceforge mirrorlist as of 2006-04-30. If someone spots changes
# over at sourcforge, feel free to email me and I'll update the list
mirrors="easynews+heanet+superb-west+internap+switch+ufpr+surfnet+umn+kent+mesh+superb-east+jaist"
mirror_count=12

andale32_md5="cbdc2fdd7d2ed0832795e86a8b9ee19a  andale32.exe"
arial32_md5="9637df0e91703179f0723ec095a36cb5  arial32.exe"
arialb32_md5="c9089ae0c3b3d0d8c4b0a95979bb9ff0  arialb32.exe"
comic32_md5="2b30de40bb5e803a0452c7715fc835d1  comic32.exe"
courie32_md5="4e412c772294403ab62fb2d247d85c60  courie32.exe"
georgi32_md5="4d90016026e2da447593b41a8d8fa8bd  georgi32.exe"
impact32_md5="7907c7dd6684e9bade91cff82683d9d7  impact32.exe"
times32_md5="ed39c8ef91b9fb80f76f702568291bd5  times32.exe"
trebuc32_md5="0d7ea16cac6261f8513a061fbfcdb2b5  trebuc32.exe"
webdin32_md5="230a1d13a365b22815f502eb24d9149b  webdin32.exe"
verdan32_md5="12d2a75f8156e10607be1eaa8e8ef120  verdan32.exe"
wd97vwr32_md5="efa72d3ed0120a07326ce02f051e9b42  wd97vwr32.exe"

download_files="andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe georgi32.exe impact32.exe times32.exe trebuc32.exe webdin32.exe verdan32.exe wd97vwr32.exe"


failures=0

function set_mirror {
        local r m
        r=`expr $RANDOM % $mirror_count + 1`
        m=`echo $mirrors |cut -d+ -f$r`
        mirror="http://${m}.dl.sourceforge.net/sourceforge/corefonts/";

}

function check_file {
        matches=
        if [ ! -r $1 ]
        then
                echo "$1 does not exist"
                return
        fi
        local variable_name=`basename $1 .exe`_md5
        local stored_checksum
        eval stored_checksum=\$$variable_name
        local computed_checksum=`md5sum $1`
        if [ "$stored_checksum" = "$computed_checksum" ]
        then
                matches=yes
        else
                rm $1
                matches=
        fi
}

function download {
        wget --timeout=5 -O "$2" $1$2
}

set_mirror
for f in $download_files
do
        check_file $f
        while [ ! $matches ]
        do
                download $mirror $f
                check_file $f
                if [ ! $matches ]
                then
                        echo "failed to download $mirror$f"
                        failures=`expr $failures + 1`
                        if [ $failures -gt 5 ]
                        then
                                echo "failed to download too many times."
                                exit
                        fi
                        set_mirror
                fi
        done
done


%build

font_files="andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe georgi32.exe impact32.exe times32.exe trebuc32.exe webdin32.exe verdan32.exe"

cd %{name}

rm -rf cab-contents fonts

mkdir cab-contents
mkdir fonts

for i in $font_files
do
        if [ -f downloads/$i ]
        then
                cabextract --lowercase --directory=cab-contents downloads/$i
        fi
        cp cab-contents/*.ttf fonts
        rm -f cab-contents/*
done

cabextract --lowercase --directory=cab-contents downloads/wd97vwr32.exe
cabextract --lowercase --directory=cab-contents cab-contents/viewer1.cab
cp cab-contents/*.ttf fonts


%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
cd %{name}/fonts
mkdir -p $RPM_BUILD_ROOT/%{fontdir}

cp *.ttf $RPM_BUILD_ROOT/%{fontdir}

ttmkfdir $RPM_BUILD_ROOT/%{fontdir}

mkdir -p $RPM_BUILD_ROOT/etc/fonts/conf.d

cat <<EOF > $RPM_BUILD_ROOT/etc/fonts/conf.d/09-msttcorefonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <dir>/usr/share/fonts/msttcore</dir>
</fontconfig>
EOF

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%post
if [ -x %{_bindir}/fc-cache ]; then
   %{_bindir}/fc-cache -f %{fontdir} || :
fi

%postun
if [ "$1" = "0" ]; then
   if [ -x %{_bindir}/fc-cache ]; then
      %{_bindir}/fc-cache -f %{fontdir} || :
   fi
fi

%files
%attr(-,root,root) %{fontdir}
#% dir %{fontdir}
%config(noreplace) %{_sysconfdir}/fonts/conf.d/09-msttcorefonts.conf

%changelog
* Sat Dec 11 2010  Hnr Kordewiner <hnr@kordewiner.com> 2.0-5
- 2.0-4 is Dennis Johnson at http://fenris02.fedorapeople.org/msttcore-fonts-2.0-4.spec
- move 09-msttcorefonts.conf to this spec file
- drop more %{ttmkfdir}

* Wed Jun 25 2008  Muayyad Saleh Alsadi <alsadi gmail com> 2.0-3
- drop %{ttmkfdir} completely 

* Mon Feb 18 2008 Andrew Bartlett <abartlet samba org> 2.0-2
- Make work with Fedora 9 fonts system

* Sun May 07 2006 Noa Resare <noa resare com> 2.0-1
- checksums downloads
- random mirror
- use redistributable word 97 viewer as source for tahoma.ttf

* Mon Mar 31 2003 Daniel Resare <noa resare com> 1.3-4
- updated microsoft link
- updated sourceforge mirrors

* Mon Nov 25 2002 Daniel Resare <noa resare com> 1.3-3
- the install dir is now deleted when the package is uninstalled
- executable permission removed from the fonts
- executes fc-cache after install if it is available

* Thu Nov 07 2002 Daniel Resare <noa resare com> 1.3-2
- Microsoft released a new service-pack. New url for Tahoma font.

* Thu Oct 24 2002 Daniel Resare <noa resare com> 1.3-1
- removed python hack
- removed python hack info from description
- made tahoma inclusion depend on define
- added some info on the ttmkfdir define

* Tue Aug 27 2002 Daniel Resare <noa resare com> 1.2-3
- fixed spec error when tahoma is not included 

* Tue Aug 27 2002 Daniel Resare <noa resare com> 1.2-2
- removed tahoma due to unclear licensing
- parametrized ttmkfdir path (for mandrake users)
- changed description text to reflect the new microsoft policy

* Thu Aug 15 2002 Daniel Resare <noa resare com> 1.2-1
- changed distserver because microsoft no longer provides them

* Tue Apr 09 2002 Daniel Resare <noa resare com> 1.1-3
- fixed post/preun script to actually do what they were supposed to do

* Tue Mar 12 2002 Daniel Resare <noa resare com> 1.1-2
- removed cabextact from this package
- added tahoma font from ie5.5 update

* Fri Aug 25 2001 Daniel Resare <noa metamatrix se>
- initial version

msttcore-fonts-2.0-5.spec

Bugs:

Dependencies need to be checked:

[...] please include ttmkfdir as a build dependency

BuildRequires: wget, cabextract, ttmkfdir

[Note from Viliam Pucik <viliam.pucik@gmail.com>]

List of SF mirrors is outdated and broken: easynews superb-west internap surfnet umn superb-east 
Get mirrors and mirror_count from http://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors

helpdesk/fedora/mscorefonts (zuletzt geändert am 2012-09-12 18:06:59 durch heiner)