%define perl_sitelib    %(eval "`perl -V:installsitelib`"; echo $installsitelib)

Summary: Report errors from perspective of caller of a "clan" of modules for Perl 
Name: perl-Carp-Clan
Version: 6.04
Release: 1%{?_dist_release}
License: distributable
Group: Development/Libraries
Source0: http://search.cpan.org/CPAN/authors/id/S/ST/STBEY/Carp-Clan-%{version}.tar.gz
URL: http://search.cpan.org/~stbey/Carp-Clan/

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
BuildRequires: perl >= 5
BuildRequires: perl-Test-Exception
Requires: perl >= 5
Conflicts: perl-Bit-Vector <= 6.3

Vendor: Project Vine
Distribution: Vine Linux

%description
This module reports errors from the perspective of the caller of a
"clan" of modules, similar to "Carp.pm" itself. But instead of giving
it a number of levels to skip on the calling stack, you give it a
pattern to characterize the package names of the "clan" of modules
which shall never be blamed for any error. :-)

So these modules stick together like a "clan" and any error which
occurs will be blamed on the "outsider" script or modules not belonging
to this "clan".

# Provide perl-specific find-{provides,requires}.
%define __find_provides /usr/lib/rpm/find-provides.perl
%define __find_requires /usr/lib/rpm/find-requires.perl

%prep
%setup -q -n Carp-Clan-%{version}

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

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} pure_install

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

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

%check
make test

%clean 
rm -rf %{buildroot}

%files -f %{name}-filelist
%defattr(-,root,root)
%doc Changes license/Artistic.txt license/GNU_GPL.txt README
%dir %{perl_vendorlib}/Carp
%{_mandir}/man3/Carp::Clan.3pm*

%changelog
* Mon Mar 28 2011 IWAI, Masaharu <iwai@alib.jp> 6.04-1
- new upstrem release
- add Vendor and Distribution tags
- update files in doc

* Sat Nov  8 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 6.00-1vl5
- new upstream release
- addede BuildRequires: perl-Test-Exception

* Sat Sep 20 2008 Shu KONNO <owa@bg.wakwak.com> 5.3-1vl5
- applied new versioning policy
- built with perl-5.10.0

* Sun Jan  2 2005 IWAI, Masaharu <iwai@alib.jp> 5.3-0vl1
- initial release

