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

# font manipulation macro
%define __mkfontscale	umask 133;%{_bindir}/mkfontscale
%define __mkfontdir	umask 133;%{_bindir}/mkfontdir
%define __fccache	umask 133;which fc-cache &> /dev/null && fc-cache

Summary: Fonts for the Ghostscript PostScript(TM) interpreter
Summary(ja): Ghostscript ポストスクリプト(TM) インタプリタ用のフォント
Name: ghostscript-fonts
Version: 5.50
Release: 3%{?_dist_release}
License: GPL
Group: Applications/Publishing
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://www.gnu.org/software/ghostscript/
Source: ftp://ftp.cs.wisc.edu/pub/ghost/gnu/gs550/gnu-gs-fonts-other-%{version}.tar.gz
Requires: ghostscript
Requires: fontconfig
Requires(post): xorg-x11-font-utils
Requires(post): fontconfig
Requires(postun): fontconfig
BuildArch: noarch

%description
Ghostscript-fonts contains a set of fonts that Ghostscript, a
PostScript interpreter, uses to render text. These fonts are in
addition to the fonts shared by Ghostscript and the X Window System.

You'll need to install ghostscript-fonts if you're installing
ghostscript.

%description -l ja
ghostscript-fonts には Ghostscripts ポストスクリプトインタプリタ
でテキストをレンダリングするために必要なフォント一式が含まれてい
ます。このフォントは Ghostscript と X ウィンドウシステムの両方で
利用されます。

ghostscript をインストールする場合は ghostscript-fonts もインス
トールする必要があります。

%prep
%setup -q -c ghostscript-fonts-%{version}

%build

%install
%__rm -rf $RPM_BUILD_ROOT
%__mkdir_p $RPM_BUILD_ROOT%{fontdir}
%__cp -p fonts/* $RPM_BUILD_ROOT%{fontdir}

# Install catalogue symlink
%__mkdir_p $RPM_BUILD_ROOT%{catalogue}
%__ln_s -f %{fontdir} $RPM_BUILD_ROOT%{catalogue}/default-ghostscript

%post
%{__mkfontscale} %{fontdir} ||:
%{__mkfontdir} %{fontdir} ||:
%{__fccache} %{_datadir}/fonts ||:

%postun
if [ "$1" = "0" ]; then
   %{__fccache} %{_datadir}/fonts ||:
fi

%clean
%__rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_datadir}/fonts/default/ghostscript
%{catalogue}/default-ghostscript

%changelog
* Mon Jan 20 2014 Munehiro Yamamoto <munepi@vinelinux.org> 5.50-3
- rebuild

* Sat Apr 16 2011 Munehiro Yamamoto <munepi@vinelinux.org> 5.50-2
- added %%{catalogue}/default-ghostscript
- fixed BuildRoot:, URL: tags

* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 5.50-1vl5
- applied new versioning policy, spec in utf-8

* Wed Sep 20 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 5.50-1vl2
- rebuild to add gpg sign
- add Japanese summary and description.

* Mon Feb 18 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 5.50-1vl1
- just rebuild with Vine Linux

* Mon Feb 14 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 5.50

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 3)

* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.

* Wed Jan 13 1999 Preston Brown <pbrown@redhat.com>
- renamed package to be consistent with new ghostscript.

* Fri Nov 13 1998 Preston Brown <pbrown@redhat.com>
- removed the std fonts...now shared between X11 and gs with URW fonts pkg.

* Thu Jul  2 1998 Jeff Johnson <jbj@redhat.com>
- update to 4.03.

* Mon May 04 1998 Erik Troan <ewt@redhat.com>
- set the owner and group of all of the files to 0.0

* Tue Sep 23 1997 Erik Troan <ewt@redhat.com>
- made a noarch package