Ralf S. Engelschall пре 22 година
родитељ
комит
f93e267150
2 измењених фајлова са 46 додато и 2 уклоњено
  1. 25 0
      perl-net/perl-net.patch
  2. 21 2
      perl-net/perl-net.spec

+ 25 - 0
perl-net/perl-net.patch

@@ -18,3 +18,28 @@
        $prop->{user} = eval{ get_uid( $1 ) };
        $self->fatal( $@ ) if $@;
      }else{
+Index: Net-Pcap-0.05/Makefile.PL
+--- Net-Pcap-0.05/Makefile.PL.orig	2004-02-28 23:41:40.000000000 +0100
++++ Net-Pcap-0.05/Makefile.PL	2004-02-28 23:45:17.000000000 +0100
+@@ -10,7 +10,8 @@
+ 	'NAME'         => 'Net::Pcap',
+ 	'DISTNAME'     => 'Net-Pcap',
+ 	'VERSION_FROM' => 'Pcap.pm',
+-	'LIBS'         => ['-lpcap'], 
++	'INC'          => '-I@l_prefix@/include', 
++	'LIBS'         => ['-L@l_prefix@/lib -lpcap'], 
+ 	dist => {
+ 		'COMPRESS' => "gzip -9f",
+ 		'SUFFIX'   => "gz"
+Index: Net-Pcap-0.05/Pcap.xs
+--- Net-Pcap-0.05/Pcap.xs.orig	2003-06-14 14:15:18.000000000 +0200
++++ Net-Pcap-0.05/Pcap.xs	2004-02-28 23:43:47.000000000 +0100
+@@ -18,7 +18,7 @@
+ #include "EXTERN.h"
+ #include "perl.h"
+ #include "XSUB.h"
+-#include <pcap.h>
++#include "pcap.h"
+ 
+ #ifdef __cplusplus
+ }

+ 21 - 2
perl-net/perl-net.spec

@@ -39,6 +39,7 @@
 %define       V_curl_easy             1.35
 %define       V_net_imap_simple       0.93
 %define       V_net_bgp               0.07
+%define       V_net_pcap              0.05
 
 #   package information
 Name:         perl-net
@@ -51,10 +52,11 @@ Class:        BASE
 Group:        Language
 License:      GPL/Artistic
 Version:      %{V_perl}
-Release:      20040218
+Release:      20040228
 
 #   package options
 %option       with_curl   no
+%option       with_pcap   no
 
 #   list of sources
 Source0:      http://www.cpan.org/modules/by-module/Net/Net-Daemon-%{V_net_daemon}.tar.gz
@@ -71,6 +73,7 @@ Source10:     http://www.cpan.org/modules/by-module/RPC/PlRPC-%{V_plrpc}.tar.gz
 Source11:     http://curl.haxx.se/libcurl/perl/Curl-easy-%{V_curl_easy}.tar.gz
 Source12:     http://www.cpan.org/modules/by-module/Net/Net-IMAP-Simple-%{V_net_imap_simple}.tar.gz
 Source13:     http://www.cpan.org/modules/by-module/Net/Net-BGP-%{V_net_bgp}.tar.gz
+Source14:     http://www.cpan.org/authors/id/K/KC/KCARNUT/Net-Pcap-%{V_net_pcap}.tar.gz
 Patch0:       perl-net.patch
 
 #   build information
@@ -82,6 +85,10 @@ PreReq:       OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %
 BuildPreReq:  curl
 PreReq:       curl
 %endif
+%if "%{with_pcap}" == "yes"
+BuildPreReq:  libpcap
+PreReq:       libpcap
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -115,6 +122,9 @@ AutoReqProv:  no
 %endif
     - Net::IMAP::Simple (%{V_net_imap_simple})
     - Net::BGP (%{V_net_bgp})
+%if "%{with_pcap}" == "yes"
+    - Net::Pcap (%{V_net_pcap})
+%endif
 
 %track
     prog perl-net:Curl-easy = {
@@ -177,6 +187,11 @@ AutoReqProv:  no
         url       = http://www.cpan.org/modules/by-module/RPC/
         regex     = PlRPC-(__VER__)\.tar\.gz
     }
+    prog perl-net:Net-Pcap = {
+        version   = %{V_net_pcap}
+        url       = http://www.cpan.org/authors/id/K/KC/KCARNUT/
+        regex     = Net-Pcap-(__VER__)\.tar\.gz
+    }
 
 %prep
     %setup -q -c
@@ -193,7 +208,8 @@ AutoReqProv:  no
     %setup -q -T -D -a 11
     %setup -q -T -D -a 12
     %setup -q -T -D -a 13
-    %patch -p0
+    %setup -q -T -D -a 14
+    sed <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
 
 %build
 
@@ -215,6 +231,9 @@ AutoReqProv:  no
 %endif
     %{l_prefix}/bin/perl-openpkg -d %{SOURCE12} configure build install
     %{l_prefix}/bin/perl-openpkg -d %{SOURCE13} configure build install
+%if "%{with_pcap}" == "yes"
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE14} configure build install
+%endif
     %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`