Ver código fonte

fix it the 'better' way...

Ralf S. Engelschall 24 anos atrás
pai
commit
2546324710
2 arquivos alterados com 17 adições e 3 exclusões
  1. 14 0
      libnet/libnet.patch
  2. 3 3
      libnet/libnet.spec

+ 14 - 0
libnet/libnet.patch

@@ -0,0 +1,14 @@
+--- src/libnet_resolve.c.orig	Tue Aug 20 16:56:01 2002
++++ src/libnet_resolve.c	Tue Aug 20 16:56:01 2002
+@@ -218,7 +218,11 @@
+    
+     if (use_name == LIBNET_RESOLVE)
+     {
++#if defined(__FreeBSD__) || defined(__linux__)
+         if (!(host_ent = gethostbyname2(host_name, AF_INET6)))
++#else
++        if (!(host_ent = gethostbyname(host_name)) || host_ent->h_addrtype != AF_INET6)
++#endif
+         {
+             snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+                     "libnet_name2addr6(): %s", strerror(errno));

+ 3 - 3
libnet/libnet.spec

@@ -37,11 +37,12 @@ Release:      20020820
 
 #   list of sources
 Source0:      http://www.packetfactory.net/libnet/dist/libnet-%{version}.tar.gz
+Patch0:       libnet.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206, gcc, make, bind
+BuildPreReq:  OpenPKG, openpkg >= 20020206, gcc, make
 PreReq:       OpenPKG, openpkg >= 20020206
 AutoReq:      no
 AutoReqProv:  no
@@ -57,12 +58,11 @@ AutoReqProv:  no
 
 %prep
     %setup -q -n Libnet-latest
+    %patch -p0
 
 %build
     CC="%{l_cc}" \
     CFLAGS="%{l_cflags -O}" \
-    LDFLAGS="-L%{l_prefix}/lib" \
-    LIBS="-lbind" \
     ./configure \
         --prefix=%{l_prefix}
     %{l_make} %{l_mflags -O}