%define version 0.3
%define release 2%{?_dist_release}
%define hanamin_date 20081115
%define ttfjp_version 6.0

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

Summary: HanaMin+SazanamiMincho True Type Font
Summary(ja): ハナミン+さざなみ明朝 合成 TrueType フォント
Name: TrueType-hanaminplus
Version: %{version}
Release: %{release}

License: BSD Like
Group: User Interface/X

# HanMinPlus
Source0: HanaMin-Plus-%{hanamin_date}.tar.bz2

Source10: 59-hanaminplus.conf

Source20: cidfmap.ja.hanaminplus

Distribution: Vine Linux
Vendor: Project Vine

BuildArch: noarch
Buildroot: %{_tmppath}/%{name}-%{version}-root
Requires(post): mktcapdir >= 0.5.4
Requires(post): fontconfig, xorg-x11-font-utils
Provides: TrueTypeFonts_jp = %{ttfjp_version}
Obsoletes: TrueTypeFonts_jp < 4.1
Obsoletes: TrueType-kochi <= 4.4.1

Obsoletes: TrueType-sazanami < 3.0

%description
HanaMin+SazanamiMincho font - Free Japanese True Type Font
- HanaMin Plus

%description -l ja
このパッケージには以下のフリーの日本語 True Type フォントが含まれています。
- HanaMin Plus

%prep
rm -rf ${RPM_BUILD_ROOT}

%setup -n %{name} -c -a 0
mv HanaMin-Plus/*.ttf .

%install

mkdir -p $RPM_BUILD_ROOT/%{fontdir}
install -m664 *.ttf $RPM_BUILD_ROOT/%{fontdir}
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/fonts/conf.{avail,d}
install -m664 %{SOURCE10} $RPM_BUILD_ROOT/%{_sysconfdir}/fonts/conf.avail/
for i in $RPM_BUILD_ROOT/%{_sysconfdir}/fonts/conf.avail/*.conf
do
  ln -sf ../conf.avail/$(basename $i) $RPM_BUILD_ROOT/%{_sysconfdir}/fonts/conf.d/
done

# install ghostscript8 cidfmap 
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
install -m644 %{SOURCE20} $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d

%post
%__font_install_post %{fontdir}

%postun
%__font_install_postun %{fontdir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc HanaMin-Plus/*
%{fontdir}/*
%{_sysconfdir}/fonts/conf.avail/*.conf
%config(missingok,noreplace) %{_sysconfdir}/fonts/conf.d/*.conf
%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.*

%changelog
* Fri Apr 29 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.3-2
- rebuild with rpm-4.8.1

* Wed Apr 22 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.3-1
- use %%__font_install_{post,postun} macros

* Tue Mar 31 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2-3
- remove Requires/Requires(post): TrueType-base

* Fri Mar 20 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2-2
- remove Requires: TrueType-sazanami

* Mon Nov 24 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2-1
- update to HanaMinPlus 20081115

* Sat Nov 08 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.1-1
- initial build
  - HanaMin Plus (hanazono-20081012 + sazanami-20040629)
