Name:           perl-Net-Pcap
Version:        0.16
Release:        1%{?_dist_release}
Summary:        Interface to pcap(3) LBL packet capture library

Group:          Development/Libraries
License:        GPL+ or Artistic
URL:            http://search.cpan.org/dist/Net-Pcap/
Source0:        http://search.cpan.org/CPAN/authors/id/S/SA/SAPER/Net-Pcap-%{version}.tar.gz
# https://rt.cpan.org/Ticket/Display.html?id=55163
Patch0:         net-pcap-0.16-eg-pcapdump.patch
# see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628522
Patch1:         perl-Net-Pcap-ccflags.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  perl(ExtUtils::MakeMaker), perl(Test::More)
BuildRequires:  libpcap-devel
Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       shaolin

%{?perl_default_filter}

%description
perl-Net-Pcap provides Perl bindings to the LBL pcap(3) library.

%prep
%setup -q -n Net-Pcap-%{version}
%patch0 -p1
%patch1 -p1

for f in README Changes ; do
  iconv -f iso-8859-1 -t utf-8 $f >$f.conv && mv -f $f.conv $f
done

chmod 0644 eg/*

sed -i -e '1s~#!perl~#!%{__perl}~' t/*.t

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}


%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
chmod -R u+w %{buildroot}/*


%check
make test


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc Changes README
%doc eg/ t/
%{_bindir}/*
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Net
%{_mandir}/man?/*


%changelog
* Thu Mar 01 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.16-1
- initial build for Vine Linux

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Jun 18 2011 Iain Arnell <iarnell@gmail.com> 0.16-12
- rename patch and clarify that it's EU:MM related, not EU::CB

* Fri Jun 17 2011 Iain Arnell <iarnell@gmail.com> 0.16-11
- patch to workaround ExtUtils::CBuilder behavior change
  see http://rt.perl.org/rt3/Public/Bug/Display.html?id=89478

* Fri Jun 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.16-10
- Perl mass rebuild

* Tue Jun 14 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.16-9
- Perl mass rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Dec 21 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.16-7
- 661697 rebuild for fixing problems with vendorach/lib

* Tue May 04 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.16-6
- Mass rebuild with perl-5.12.0

* Wed Mar 03 2010 Iain Arnell <iarnell@gmail.com> 0.16-5
- include patch from Jose Pedro Oliveira to fix eg/pcapdump (BZ#569915)

* Tue Mar 02 2010 Iain Arnell <iarnell@gmail.com> 0.16-4
- include examples as documentation
- use perl_default_filter and DESTDIR
- silence rpmlint

* Mon Dec  7 2009 Stepan Kasal <skasal@redhat.com> - 0.16-3
- rebuild against perl 5.10.1

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Apr 01 2009 Sindre Pedersen Bjørdal <sindrepb@fedoraproject.org> - 0.16-1
- New upstream release

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Mar 06 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.14-4
- rebuild for new perl

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.14-3
- Autorebuild for GCC 4.3

* Tue May 08 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.14-2
- Add missing BR
- Chance License to GPL or Artistic
- Update %%files
- Include t/ in %%doc
* Thu May 03 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.14-1
- Initial build
