%define _use_internal_dependency_generator 0

%define name perl-XML-Dumper
%define module	XML-Dumper

Summary: Perl module for dumping Perl objects from/to XML
Name: %{name}
Version: 0.81
Release: 3%{?_dist_release}
License: GPL
Group: Development/Libraries
URL: http://search.cpan.org/~mikewong/XML-Dumper/

Source0: http://www.cpan.org/authors/id/E/EI/EISEN/%{module}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(XML::Parser) >= 2.34
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(XML::Parser)

%description
XML::Dumper dumps Perl data to XML format. XML::Dumper can also read
XML data that was previously dumped by the module and convert it back
to Perl.  Perl objects are blessed back to their original packaging;
if the modules are installed on the system where the perl objects are
reconstituted from xml, they will behave as expected. Intuitively, if
the perl objects are converted and reconstituted in the same
environment, all should be well.

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

%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor
make
find ./ -type f | xargs perl -pi -e "s|^#!(\s)?/usr/local/bin/perl|#!%{__perl}|g"

%clean 
rm -rf $RPM_BUILD_ROOT

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT{%{_prefix},%{_mandir}/man3}
make DESTDIR=$RPM_BUILD_ROOT install
#make PREFIX=$RPM_BUILD_ROOT%{_prefix} \
#     NSTALLSITEARCH=%{buildroot}%{perl_sitearch} install

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 ^%{_mandir}   |
        grep -v perllocal.pod | 
        grep -v "\.packlist" > XML-Dumper-%{version}-filelist
if [ "$(cat XML-Dumper-%{version}-filelist)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi
install -m 644 blib/man3/* %{buildroot}%{_mandir}/man3

%files -f XML-Dumper-%{version}-filelist
%defattr(-,root,root)
%doc README Changes MANIFEST
%{_mandir}/man3/*3pm*

%changelog
* Sun Nov 30 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.81-3
- rebuilt with perl 5.16.3

* Sat Apr 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.81-2
- rebuild with perl-5.12.3

* Fri Aug  1 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.81-1
- applied new versioning policy
- rebuilt with perl-5.10.0
- changed Group to Development/Libraries

* Wed Jul 19 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.81-0vl1
- new upstream release
- rebuilt with perl-5.8.6
- changed Group to Development/Languages

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

* Sat Dec 13 2003 Satoshi MACHINO <machino@vinelinux.org> 0.67-0vl2
- built on perl-5.8.2

* Thu Nov 06 2003 Satoshi MACHINO <machino@vinelinux.org> 0.67-0vl1
- new upstream version
- built on perl-5.8.1

* Sun Apr 20 2003 Satoshi MACHINO <machino@vinelinux.org> 0.4-25vl2
- build on perl-5.8.0

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

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

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

* Mon Jul 23 2001 Crutcher Dunnavant <crutcher@redhat.com> 2.30-5
- got it to work.

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

* Thu Jun 21 2001 Christian Belisle <cbelisle@mandrakesoft.com> 0.4-3mdk
- Fixed an error in changelog.

* Thu Jun 21 2001 Christian Belisle <cbelisle@mandrakesoft.com> 0.4-2mdk
- Clean up spec.
- Fixed distribution tag.
- Needed by eGrail.

* Mon Jun 18 2001 Till Kamppeter <till@mandrakesoft.com> 0.4-1mdk
- Newly introduced for Foomatic.

