-%define _name liberation-fonts
Summary: Fonts to replace commonly used Microsoft Windows Fonts
+Summary(pl.UTF-8): Fonty zastępujące popularne fonty z Microsoft Windows
Name: fonts-TTF-RedHat-liberation
-Version: 0.1
-Release: 1
-License: GPL v2 + exceptions
+Version: 2.00.0
+Release: 2
+Epoch: 1
+License: OFL
Group: Fonts
-Source0: %{_name}-%{version}.tar.gz
-# Source0-md5: a874631c4641e8496cd9be5c7da74b48
-URL: https://www.redhat.com/promo/fonts/
+Source0: https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-%{version}.tar.gz
+# Source0-md5: 5b5055ed755025891f908b7726fea482
+Source1: generate.pe
+Source2: 59-liberation-mono.conf
+Source3: 59-liberation-sans.conf
+Source4: 59-liberation-serif.conf
+URL: https://fedorahosted.org/liberation-fonts/
+BuildRequires: fontforge >= 20090923
Requires(post,postun): fontpostinst
Requires: %{_fontsdir}/TTF
+Obsoletes: liberation-fonts-ttf
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
The Liberation Fonts are intended to be replacements for the three
-most commonly used fonts on Microsoft systems: Times New Roman,
-Arial, and Courier New.
+most commonly used fonts on Microsoft systems.
+
+There are three sets: Sans (a substitute for Arial, Albany, Helvetica,
+Nimbus Sans L, and Bitstream Vera Sans), Serif (a substitute for Times
+New Roman, Thorndale, Nimbus Roman, and Bitstream Vera Serif) and Mono
+(a substitute for Courier New, Cumberland, Courier, Nimbus Mono L, and
+Bitstream Vera Sans Mono).
+
+%description -l pl.UTF-8
+Fonty Liberation mają być zamiennikami trzech najczęściej używanych
+fontów z systemów Microsoftu.
+
+Pakiet zawiera trzy zestawy: Sans (zamiennik dla Arial, Albany,
+Helvetica, Nimbus Sans L i Bitstream Vera Sans), Serif (zamiennik dla
+Times New Roman, Thorndale, Nimbus Roman i Bitstream Vera Serif) i
+Mono (zamiennik dla Courier New, Cumberland, Courier, Nimbus Mono L i
+Bitstream Vera Sans Mono).
%prep
-%setup -c -n %{_name}
+%setup -q -n liberation-fonts-%{version}
+install -p %{SOURCE1} .
+
+%build
+rm -f *.ttf
+./generate.pe src/*.sfd
+
+mv LiberationMono.ttf LiberationMono-Regular.ttf
+mv LiberationSerif.ttf LiberationSerif-Regular.ttf
+mv LiberationSans.ttf LiberationSans-Regular.ttf
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_ttffontsdir}
+install -d $RPM_BUILD_ROOT{%{_ttffontsdir},%{_sysconfdir}/fonts/{conf.d,conf.avail}}
+
+cp -p *.ttf $RPM_BUILD_ROOT%{_ttffontsdir}
+
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.avail/59-liberation-mono.conf
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.avail/59-liberation-sans.conf
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.avail/59-liberation-serif.conf
-install *.ttf $RPM_BUILD_ROOT%{_ttffontsdir}
+ln -s ../conf.avail/59-liberation-mono.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
+ln -s ../conf.avail/59-liberation-sans.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
+ln -s ../conf.avail/59-liberation-serif.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%{_ttffontsdir}/*
+%doc AUTHORS ChangeLog README TODO
+%{_ttffontsdir}/LiberationMono*.ttf
+%{_ttffontsdir}/LiberationSans*.ttf
+%{_ttffontsdir}/LiberationSerif*.ttf
+%{_sysconfdir}/fonts/conf.avail/59-liberation-*.conf
+%{_sysconfdir}/fonts/conf.d/59-liberation-*.conf