Blob Blame History Raw
%define upstreamname   baekmuk-bdf

%define fontdir      %{_datadir}/fonts/%{upstreamname}
%define catalogue    %{_sysconfdir}/X11/fontpath.d

Name:           %{upstreamname}-fonts
Version:        2.2
Release:        4%{?dist}
Summary:        Korean bitmap fonts

Group:          User Interface/X
License:        Baekmuk
URL:            http://kldp.net/frs/?group_id=57&release_id=865
Source:  http://kldp.net/frs/download.php/1428/%{upstreamname}-%{version}.tar.gz
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  xorg-x11-font-utils
Conflicts:      fonts-korean < 2.2-5

%description
This package provides the Korean Baekmuk bitmap fonts.


%prep
%setup -q -n %{upstreamname}-%{version}

%build
for file in bdf/*.bdf; do
    bdftopcf $file | gzip -9 > ${file%.bdf}.pcf.gz
done

%install
rm -rf $RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT%{fontdir}

# for bmp font
install -m 0644 bdf/*.pcf.gz $RPM_BUILD_ROOT%{fontdir}/
install -m 0444 bdf/fonts.alias $RPM_BUILD_ROOT%{fontdir}/

# for catalogue
install -d $RPM_BUILD_ROOT%{catalogue}
ln -sf ../../..%{fontdir} $RPM_BUILD_ROOT%{catalogue}/%{name}

mkfontdir $RPM_BUILD_ROOT%{fontdir} 

# convert Korean copyright file to utf8
iconv -f EUC-KR -t UTF-8 COPYRIGHT.ks > COPYRIGHT.ko

%clean
rm -rf $RPM_BUILD_ROOT

%post
if [ -x %{_bindir}/fc-cache ]; then
  %{_bindir}/fc-cache %{_datadir}/fonts
fi

%postun
if [ "$1" = "0" ]; then
  if [ -x %{_bindir}/fc-cache ]; then
    %{_bindir}/fc-cache %{_datadir}/fonts
  fi
fi

%files
%defattr(-,root,root,-)
%doc COPYRIGHT COPYRIGHT.ko README
%dir %{fontdir}
%{fontdir}/*.gz
%{fontdir}/ttfonts-ko.alias
%verify(not md5 size mtime) %{fontdir}/fonts.dir
%{catalogue}/%{name}

%changelog
* Tue Sep 25 2007 Jens Petersen <petersen@redhat.com> - 2.2-4
- fix name of fonts.alias file

* Mon Sep 24 2007 Jens Petersen <petersen@redhat.com> - 2.2-3
- conflict with fonts-korean < 2.2-5

* Mon Sep 24 2007 Jens Petersen <petersen@redhat.com> - 2.2-2
- convert Korean copyright file to utf8 (Mamoru Tasaka, #302451)

* Tue Sep 11 2007 Jens Petersen <petersen@redhat.com> - 2.2-1
- initial packaging separated from fonts-korean (#253155)