%define perl_vendorlib    %(eval "`perl -V:installvendorlib`"; echo $installvendorlib)
%define _use_internal_dependency_generator 0

%define module	libxml-perl
Summary: A collection of Perl modules for working with XML.
Name: perl-%{module}
Version: 0.08
Release: 2%{?_dist_release}
License: distributable
Group: Development/Libraries
Source0: http://search.cpan.org/CPAN/authors/id/K/KM/KMACLEOD/%{module}-%{version}.tar.gz
URL: http://search.cpan.org/dist/libxml-perl/

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
BuildRequires: perl >= 5.8.2
BuildRequires: perl-XML-Parser >= 2.19
Requires: perl >= 5.8.2
Requires: perl-XML-Parser >= 2.19

Vendor: Project Vine
Distribution: Vine Linux

%description
libxml-perl is a collection of smaller Perl modules, scripts, and
documents for working with XML in Perl.  libxml-perl software works in
combination with XML::Parser, PerlSAX, XML::DOM, XML::Grove and
others.


%prep
%setup -q -n %{module}-%{version}

%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

[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress

find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;

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

%check
make test || /bin/true

%clean 
rm -rf $RPM_BUILD_ROOT

%files -f perl-libxml-perl-%{version}-filelist
%defattr(-,root,root)
%doc README ChangeLog Changes doc examples
%dir %{perl_vendorlib}/Data
%dir %{perl_vendorlib}/Data/Grove
%dir %{perl_vendorlib}/XML
%dir %{perl_vendorlib}/XML/Handler
%dir %{perl_vendorlib}/XML/Parser
%dir %{perl_vendorlib}/XML/PatAct

%changelog
* Wed Mar 30 2011 IWAI, Masaharu <iwai@alib.jp> 0.08-2vl6
- build with perl 5.12.3
- add Vendor and Distribution tags
- update URL value

* Sat May 31 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.0.8-1
- applied new versioning policy
- rebuilt with perl-5.10.0-2
- changed Group to Development/Libraries

* Wed Jul 19 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.0.8-0vl2
- rebuilt with perl-5.8.6
- changed Group to Development/Languages

* Sun Jan  2 2005 IWAI, Masaharu <iwai@alib.jp> 0.0.8-0vl1
- new upstream release

* Sat Dec 13 2003 Satoshi MACHINO <machino@vinelinux.org> 0.0.7-28vl4
- rebuilt on perl-5.8.2

* Thu Nov 06 2003 Satoshi MACHINO <machino@vinelinux.org> 0.0.7-28vl3
- rebuilt on perl-5.8.1

* Wed Apr 30 2003 IWAI Masaharu <iwai@alib.jp> 0.07-28vl2
- build with perl-5.8.0
- add some documents
- add some directories
- add perl-XML-Parser's version in {Build,}Requires

* Sun Mar 02 2003 Satoshi MACHINO <machino@vinelinux.org> 0.07-28vl1
- build for VineLinux

* Tue Aug  6 2002 Chip Turner <cturner@redhat.com>
- automated release bump and build

* Wed Mar 27 2002 Chip Turner <cturner@redhat.com>
- move to vendor_perl

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu Jul 18 2001 Crutcher Dunnavant <crutcher@redhat.com> 0.07-5
- imported from mandrake. tweaked man path.

* Sun Jun 17 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 0.07-4mdk
- Rebuild for the latest perl.
- Remove Distribution and Vendor tag.
- Don't run make test for now.

* Tue Mar 13 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 0.07-3mdk
- BuildArch: noarch
- add docs
- rename spec file
- clean up spec a bit
- run automated tests

* Sat Sep 16 2000 Stefan van der Eijk <s.vandereijk@chello.nl> 0.07-2mdk
- Call spec-helper before creating filelist

* Wed Aug 09 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 0.07-1mdk
- Macroize package
