%define perl_vendorlib  %(eval "`perl -V:installvendorlib`"; echo $installvendorlib)
%define	srcver	0_5
%define	version	0.5

Summary: Simple interface for User Agent string parsing for Perl
Name: perl-HTML-ParseBrowser
Version: %{version}
Release: 1%{?_dist_release}
License: GPL/Artistic
Group: Development/Libraries
Source0: http://www.cpan.org/authors/id/D/DO/DODGER/HTML-ParseBrowser-%{srcver}.tar.gz
URL: http://search.cpan.org/~dodger/HTML-ParseBrowser/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: perl >= 5.8.2
Requires: perl >= 5.8.2
BuildArch: noarch

%description
The HTML::ParseBrowser is an Object-Oriented interface for parsing a User Agent
string. It provides simple autoloaded methods for retrieving both the actual
values stored in the interpreted (and, so far, correct) information that these
wildly varying and nonstandardised strings attempt to convey.

%prep
%setup -q -n HTML/ParseBrowser

%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS="vendor"
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
make DESTDIR=$RPM_BUILD_ROOT install

find $RPM_BUILD_ROOT%{_prefix} -type f -print | 
	sed "s@^$RPM_BUILD_ROOT@@g" | 
	grep -v ^%{_mandir} | 
	grep -v ParseBrowser.pod | 
	grep -v perllocal.pod | 
	grep -v "\.packlist" > %{name}.files
if [ "$(cat %{name}.files)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%check
make test

%clean 
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.files
%defattr(-,root,root)
%doc Changes README test.pl
%{_mandir}/*/*
%dir %{perl_vendorlib}/HTML

%changelog
* Sat Apr 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.5-1
- rebuild with perl-5.12.3

* Mon Oct  1 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.5-0vl3
- changed Group to Development/Libraries
- added %check

* Fri Sep  9 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.5-0vl2
- rebuild with perl 5.8.2
- s/Copyright/License/
- updated URL

* Mon Apr 29 2002 IWAI Masaharu <iwaim@cc.mbn.or.jp> 0.5-0vl1
- first build for Vine Linux
