%define _use_internal_dependency_generator 0

Summary: Perl extension for generating and using LALR parsers. 
Name: perl-Parse-Yapp
Version: 1.05
Release: 33%{?_dist_release}
License: distributable
Group: Development/Libraries
Source0: Parse-Yapp-%{version}.tar.gz
Url: http://www.cpan.org
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: perl >= 5.8.2
Requires: perl >= 5.8.2
BuildArch: noarch

Vendor: Project Vine
Distribution: Vine Linux

%description
Parse::Yapp (Yet Another Perl Parser compiler) is a collection of
modules that let you generate and use yacc like thread safe
(reentrant) parsers with perl object oriented interface.  The script
yapp is a front-end to the Parse::Yapp module and let you easily
create a Perl OO parser from an input grammar file.

%if %{?_dist_release} == "vl5" || %{?_dist_release} == "vl4"
# Provide perl-specific find-{provides,requires}.
%define __find_provides /usr/lib/rpm/find-provides.perl
%define __find_requires /usr/lib/rpm/find-requires.perl
%endif

%prep
%setup -q -n Parse-Yapp-%{version} 
## fix file permission
%__chmod 0644 README
find lib -type f | xargs chmod 0644

%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor
#PREFIX=$RPM_BUILD_ROOT%{_prefix}
make

%check
make test

%clean 
rm -rf $RPM_BUILD_ROOT

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
#make PREFIX=$RPM_BUILD_ROOT%{_prefix} install
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" > Parse-Yapp-%{version}-filelist
if [ "$(cat Parse-Yapp-%{version}-filelist)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%files -f Parse-Yapp-%{version}-filelist
%defattr(-,root,root)
%doc README Changes
#%dir /usr/lib/perl5/vendor_perl/%(perl -MConfig -e 'print $Config{version}')/Parse/Yapp
%dir %{perl_vendorlib}/Parse
%dir %{perl_vendorlib}/Parse/Yapp

%changelog
* Wed Mar 30 2011 IWAI, Masaharu <iwai@alib.jp> 1.05-33
- fix file permission
- add documents
- add directories in files

* Wed Mar 30 2011 IWAI, Masaharu <iwai@alib.jp> 1.05-32vl6
- build with perl 5.12.3
- defined __find_{provides,requires} with vl4 and vl5
- add Vendor and Distribution tags

* Sat Aug 16 2008 Shu KONNO <owa@bg.wakwak.com> 1.05-31vl5
- applied new versioning policy

* Sat Sep  9 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.05-30vl6
- installed files to vendor_perl
- changed Group to Development/Libraries

* Sun Jan  2 2005 IWAI, Masaharu <iwai@alib.jp> 1.05-30vl5
- build on perl-5.8.6-0vl1

* Sat Dec 13 2003 Satoshi MACHINO <machino@vinelinux.org> 1.05-30vl4
- built on perl-5.8.2

* Thu Nov 06 2003 Satoshi MACHINO <machino@vinelinux.org> 1.05-30vl3
- built on perl-5.8.1

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

* Sun Mar 02 2003 Satoshi MACHINO <machino@vinelinux.org> 1.05-30vl1
- Build for VineLinux

* Mon Jan 27 2003 Chip Turner <cturner@redhat.com>
- version bump and rebuild

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

* Tue Jun  4 2002 Chip Turner <cturner@redhat.com>
- properly claim directories owned by package so they are removed when package is removed

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

* Fri Dec 7 2001 root <root@redhat.com>
- Spec file was autogenerated. 
