%define	pkgname	Pod-PerldocJp

# Basic Information
Name:		perl-%{pkgname}
Version:	0.14
Release:	2%{?_dist_release}
License:	Artistic or GPL
Group:		Development/Tools
Source0:	http://search.cpan.org/CPAN/authors/id/I/IS/ISHIGAKI/%{pkgname}-%{version}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch

Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	yasumichi

Summary:	perldoc that also checks perldoc.jp
Summary(ja):	日本語対応の perldoc

# Dependency
Requires:       perl
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

BuildRequires:  perl
BuildRequires:	perl-Path-Extended
BuildRequires:	perl-Term-Encoding
BuildRequires:	perl-Test-Pod
BuildRequires:	perl-Test-Pod-Coverage
BuildRequires:	perl-Test-UseAllModules

%description
This is a drop-in-replacement for perldoc for Japanese people. Usage is the
same, except it can look for a translation at http://perldoc.jp with -J
option.

%description -l ja
perldocjp は、日本人のために perldoc を置き換えます。使い方は、-J オプション
を利用して http://perldoc.jp にある翻訳を探すことができる以外は、perldoc と
同様です。

%prep
%setup -q -n Pod-PerldocJp-0.14

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} pure_install DESTDIR=${RPM_BUILD_ROOT}

# remove unnecessary files.
find ${RPM_BUILD_ROOT} -type f -name perllocal.pod -exec %{__rm} -f {} ';'
find ${RPM_BUILD_ROOT} -type f -name .packlist -exec %{__rm} -f {} ';'
find ${RPM_BUILD_ROOT}%{_mandir} -type f -exec %{__rm} -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \;

# generate file list
find $RPM_BUILD_ROOT%{_prefix} -type f -print |
        sed "s@^$RPM_BUILD_ROOT@@g"  > %{name}.files

if [ "$(cat %{name}.files)X" = "X" ] ; then
	echo "ERROR: EMPTY FILE LIST"
	exit -1
fi

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%check
make test

%files -f %{name}.files
%defattr(-,root,root)
%doc Changes README
%dir %{perl_vendorlib}/Pod/PerldocJp

%changelog
* Wed Jul 04 2012 Yasumichi Akahoshi <yasumichi@vinelinux.org> 0.14-2
- apply wiki:Development/PerlModulePackaging
- exclude man pages

* Mon Oct 10 2011 Yasumichi Akahoshi <yasumichi@vinelinux.org> 0.14-1
- initial build for Vine Linux