%define name perl-Data-ShowTable
%define real_name Data-ShowTable
%define version 3.3
%define release 7%{?_dist_release}

Summary: Perl 5 module to print arrays of data
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Group: Development/Libraries
URL: http://www.cpan.org
Source0: ftp://ftp.cpan.org/pub/CPAN/modules/by-module/Data/%{real_name}-%{version}.tar.bz2
Patch0: %{real_name}-3.3.patch.bz2
BuildRequires:	perl
BuildArch: noarch
Buildroot: %{_tmppath}/%{name}-%{version}-root

%description
ShowTable.pm, version 3.3, is a Perl 5 module which defines subroutines to
print arrays of data in a nicely formatted listing, using one of four possible
formats: simple table, boxed table, list style, and HTML-formatting (for
World-Wide-Web output). See the documentation on ShowTable.pm for details on
the formatting.

%prep
%setup -q -n %{real_name}-%{version}
%patch0 -p1

find . -type f | xargs perl -pi -e "s|/usr/bin/perl5|/usr/bin/perl|g"

%build
CFLAGS="%{optflags}" perl Makefile.PL INSTALLDIRS=vendor
make 

%check
make test

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
make install DESTDIR=$RPM_BUILD_ROOT

[ -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" > Data-ShowTable-%{version}-filelist
if [ "$(cat Data-ShowTable-%{version}-filelist)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}


%files -f Data-ShowTable-%{version}-filelist
%defattr(-,root,root)

%changelog
* Sat Aug 16 2008 Shu KONNO <owa@bg.wakwak.com> 3.3-7vl5
- applied new versioning policy

* Sat Jul 21 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.3-6vl6
- changed Group to Development/Libraries

* Sat Jul 15 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.3-6vl5
- changed Group to Development/Languages

* Mon Jan 10 2005 Satoshi MACHINO <machino@vinelinux.org> 3.3-6vl4
- rebuilt with perl-5.8.6

* Sat Feb 23 2002 Satoshi MACHINO <machino@vinelinux.org> 3.3-6vl3
- changed ftp site of source

* Fri Feb 01 2002 Satoshi MACHINO <machino@vinelinux.org> 3.3-6vl2
- modified spec file

* Sun Jan 27 2002 Satoshi MACHINO <machino@vinelinux.org> 3.3-6vl1
- build on VineLinux
- fixed spec file

* Thu Nov 08 2001 Fran��is Pons <fpons@mandrakesoft.com> 3.3-6mdk
- added url tag.

* Tue Oct 16 2001 Stefan van der Eijk <stefan@eijk.nu> 3.3-5mdk
- BuildRequires: perl-devel

* Sun Jun 17 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 3.3-4mdk
- Rebuild against latest perl.

* Thu Aug 03 2000 Fran��is Pons <fpons@mandrakesoft.com> 3.3-3mdk
- macroszifications.
- noarch.

* Mon Apr  3 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 3.3-2mdk
- fixed group
- rebuild with new perl
- fixed location
- patched the source in order to build, the tests in order to test
- fixed install process for correct man1 install

* Sun Dec 05 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- First spec file