%define realname 	Net-RawIP
%define pkg_name 	perl-%{realname}
%define pkg_ver 	0.1
%define pkg_rel 	1
#%define pkg_ser		1
#%define date    %(echo `LC_ALL="C" date +"%a %b %d %Y"`)

Summary: 	Net-RawIP module for perl (Networking_Devices_IPC/Net)
Name: 		%{pkg_name}
Version: 	%{pkg_ver}
Release: 	%{pkg_rel}
#Serial:		%{pkg_ser}
Copyright: 	GPL
URL: 		http://www.cpan.org
Group: 		Development/Languages/Perl
Source: 	%{realname}-%{version}.tar.gz
#Patch:
Packager: 	William Stearns <wstearns@pobox.com>, and <kad@blackcatlinux.com>
Vendor: 	CPAN
Distribution: 	Redhat Linux
BuildRoot:      %{_tmppath}/%{name}-%{version}-broot
Prefix: 	%{_prefix}
Requires: 	perl >= 5.004

%description
Net-RawIP module for perl

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

%build
CFLAGS=" $RPM_OPT_FLAGS -I/usr/include/pcap" perl Makefile.PL
make

%clean 
if [ "$RPM_BUILD_ROOT" = "/var/tmp/perl-Net-RawIP-0.1-broot" ]; then
	rm -rf $RPM_BUILD_ROOT
else
	echo Invalid Build root \'"$RPM_BUILD_ROOT"\'
	exit 1
fi

%install
if [ "$RPM_BUILD_ROOT" = "/var/tmp/perl-Net-RawIP-0.1-broot" ]; then
	rm -rf $RPM_BUILD_ROOT
	eval `perl '-V:installarchlib'`
	mkdir -p $RPM_BUILD_ROOT/$installarchlib
	make PREFIX=$RPM_BUILD_ROOT/usr install
	#find $RPM_BUILD_ROOT/usr -type f -print | sed "s@^$RPM_BUILD_ROOT@@g" | grep -v perllocal.pod > Net-RawIP-0.06-filelist
else
	echo Invalid Build root \'"$RPM_BUILD_ROOT"\'
	exit 1
fi

#%files -f Net-RawIP-0.06-filelist
%files
%defattr(-,root,root)

%attr(755,root,root)		%dir	/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Net/RawIP
%attr(755,root,root)			/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Net/RawIP/RawIP.so
%attr(644,root,root)			/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Net/RawIP/RawIP.bs
%attr(644,root,root)			/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Net/RawIP/autosplit.ix
%attr(644,root,root)			/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Net/RawIP/.packlist
%attr(644,root,root)			/usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/RawIP.pm
%attr(755,root,root)		%dir	/usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/RawIP
%attr(644,root,root)			/usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/RawIP/libpcap.pod
%attr(644,root,root)			/usr/share/man/man3/Net::RawIP.3pm.gz
%attr(644,root,root)			/usr/share/man/man3/Net::RawIP::libpcap.3pm.gz



%changelog
* Sat Dec  6 2003 William Stearns <wstearns@pobox.com>
- updated source to 0.1

* Mon Aug  6 2001 William Stearns <wstearns@pobox.com>
- spec file cleanups, explit file list
- repackaged for rh7x

* Mon Apr 24 2000 BCL Team <blackcat-list@blackcatlinux.com>
- Original package