%define name	perlftlib
%define ver	1.2
%define rel	0vl6
%define prefix  /usr
%define jcode_ver 2.13

%define perl_vendorarch %(perl -MConfig -e 'print $Config{vendorarch}')

Summary: 	Perlftlib is a tool to make fonts.dir.
Summary(ja): 	Perlftlib は、fonts.dir を作成するツールです。
Name: 		%name
Version: 	%ver
Release: 	%rel
License: 	GPL
Group: 		User Interface/X
BuildRequires:  freetype-devel perl

URL:            http://www.io.com/~kazushi/xtt/
Source: 	%{name}-%{ver}.tar.bz2
Source1: 	README.euc
Source2: 	jcode.pl-%{jcode_ver}
Patch0:         %{name}-%{version}-conf.patch.bz2
Patch1:         %{name}-%{version}-nojcode.patch.bz2
Patch2:         perlftlib-1.2-perl_pollute.patch.bz2

Requires:       perl
BuildRoot: 	%{_tmppath}/%{name}-%{version}-root


%description
Perlftlib is a tool to make fonts.dir from ttc file.

%description -l ja
Perlftlib は、ttc ファイルから fonts.dir を作成するツールです。
jcode.plも同梱しています。
/usr/share/doc/perlftlib-1.2/README.eucに、使用方法等を書いていますので
必ず読んで下さい。

%prep
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
(cd FreeType ; %{__perl} Makefile.PL INSTALLDIRS=vendor)
make OPTIMIZE="$RPM_OPT_FLAGS"

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

make PREFIX=$RPM_BUILD_ROOT%{_prefix} \
    PERLLIBDIR=$RPM_BUILD_ROOT%{perl_vendorarch} \
    MFLAGS='DESTDIR=%{buildroot}' install

mkdir -p $RPM_BUILD_ROOT/usr/X11R6/man/man3

#cp FreeTypeWrapper.pm $RPM_BUILD_ROOT%{perl_vendorarch}
cp -p FreeType/blib/man3/FreeType.3pm $RPM_BUILD_ROOT/usr/X11R6/man/man3/
cp -p %{_sourcedir}/README.euc .
cp -p %{_sourcedir}/jcode.pl-%{jcode_ver} $RPM_BUILD_ROOT%{perl_vendorarch}/jcode.pl

%clean 
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root,0755)
%doc README.euc
/usr/X11R6/bin/*
/usr/X11R6/man/man3/FreeType.3*
%{_mandir}/man3/FreeType.3*
%{perl_vendorarch}/FreeType*
%{perl_vendorarch}/auto/FreeType/*
%{perl_vendorarch}/jcode.pl

%changelog
* Sat Jul 15 2006 Ryoichi INAGAKI <ryo1@bc.wakwa.com> 1.2-0vl6
- rebuilt with perl 5.8.6
- installed perl modules to vendor_perl dir
- changed Group to User Interface/X

* Mon Nov 29 2004 IWAI, Masaharu <iwai@alib.jp> 1.2-0vl5
- build with perl 5.8.2
- using MFLAGS flag in %%install section

* Thu Mar 27 2003 Satoshi MACHINO <machino@vinelinux.org> 1.2-0vl4
- Fixed typo in description

* Thu Mar 27 2003 Satoshi MACHINO <machino@vinelinux.org> 1.2-0vl3
- New spec file
- imported patches from 1.2-16mdk

* Wed Apr 25 2001 net_hal <net_hal@cwa.bai.ne.jp>
- jcode.pl Ver up

* Wed Feb 14 2001 net_hal <net_hal@cwa.bai.ne.jp>
- first build
