%global fontname sil-nuosu
%global fontconf 66-%{fontname}.conf
%global archivename ttf-sil-nuosusil-2.1.1.tar.gz
%global _fontbasedir %{_datadir}/fonts
%global _fontdir %{_fontbasedir}/%{fontname}
%global _fontconfig_confdir %{_sysconfdir}/fonts/conf.d
%global _fontconfig_templatedir %{_sysconfdir}/fonts/conf.avail
Name: %{fontname}-fonts
Version: 2.1.1
Release: 4%{?dist}
Summary: The Nuosu SIL Font
Group: User Interface/X
License: OFL
URL: http://scripts.sil.org/SILYi_home
Source0: %{archivename}
Source1: %{name}-fontconfig.conf
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
Requires: fontconfig
%description
The Nuosu SIL Font is a single Unicode font for the standardized Yi script
used by a large ethnic group in southwestern China.
Until this version, the font was called SIL Yi.
%prep
%setup -q -c %{name}
sed -i 's/\r//' OFL.txt doc/FONTLOG.txt
%build
%install
rm -rf $RPM_BUILD_ROOT
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p *.ttf %{buildroot}%{_fontdir}
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
%{buildroot}%{_fontconfig_confdir}
install -m 0644 -p %{SOURCE1} \
%{buildroot}%{_fontconfig_templatedir}/%{fontconf}
#ln -s %{_fontconfig_templatedir}/%{fontconf} \
# %{buildroot}%{_fontconfig_confdir}/%{fontconf}
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ -x %{_bindir}/fc-cache ]; then
%{_bindir}/fc-cache %{_fontdir} || :
fi
%postun
if [ $1 -eq 0 -a -x %{_bindir}/fc-cache ]; then
%{_bindir}/fc-cache %{_fontdir} || :
fi
%files
%defattr(0644,root,root,0755)
%doc OFL.txt doc/FONTLOG.txt
%dir %{_fontdir}
%{_fontdir}/*.ttf
%{_fontconfig_templatedir}/%{fontconf}
%changelog
* Mon Feb 14 2011 Peng Wu <pwu@redhat.com> - 2.1.1-4
- Backport to el5.
* Sat Feb 12 2011 Peng Wu <pwu@redhat.com> - 2.1.1-3
- Add document.
* Sun Jan 30 2011 Peng Wu <pwu@redhat.com> - 2.1.1-2
- Clean the spec file and add fontconfig file
* Wed Jan 26 2011 Peng Wu <pwu@redhat.com> - 2.1.1-1
- Initial package