Author: Steve Langasek <steve.langasek@ubuntu.com>
Origin: Ubuntu, https://bugs.launchpad.net/ubuntu/+source/arpon/+bug/747889/+attachment/1966748/+files/arpon-747889.diff
Bug-Debian: http://bugs.debian.org/620459, http://bugs.debian.org/634578
Bug-Ubuntu: https://launchpad.net/bugs/747889
Forwarded: to author email
Last-Update: <2011-04-02>

Index: arpon-2.0/cmake_modules/FindPthread.cmake
===================================================================
--- arpon-2.0.orig/cmake_modules/FindPthread.cmake	2010-05-28 16:37:07.000000000 -0400
+++ arpon-2.0/cmake_modules/FindPthread.cmake	2014-01-14 14:36:27.000000000 -0500
@@ -16,7 +16,7 @@
 
 find_library(PTHREAD_LIBRARY NAMES ${libpthread} PATH ${CMAKE_LIBRARY_PATH})
 
-if(PTHREAD_INCLUDE_DIR AND PTHREAD_LIB_DIR AND PTHREAD_LIBRARY )
+if(PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY )
   message(STATUS "Found Libphtread.")
 
   if(NOT ${INCLUDE_DIR} MATCHES ${PTHREAD_INCLUDE_DIR})
@@ -24,7 +24,7 @@
     set(INCLUDE_DIR "${INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR}")
   endif(NOT ${INCLUDE_DIR} MATCHES ${PTHREAD_INCLUDE_DIR})
 
-  if(NOT ${LIB_DIR} MATCHES ${PTHREAD_LIB_DIR})
+  if(PTHREAD_LIB_DIR AND NOT ${LIB_DIR} MATCHES ${PTHREAD_LIB_DIR})
     link_directories(${PTHREAD_LIB_DIR})
     set(LIB_DIR "${LIB_DIR} ${PTHREAD_LIB_DIR}")
   endif(NOT ${LIB_DIR} MATCHES ${PTHREAD_LIB_DIR})
Index: arpon-2.0/cmake_modules/FindPCAP.cmake
===================================================================
--- arpon-2.0.orig/cmake_modules/FindPCAP.cmake	2010-05-28 16:37:07.000000000 -0400
+++ arpon-2.0/cmake_modules/FindPCAP.cmake	2014-01-14 14:36:27.000000000 -0500
@@ -16,7 +16,7 @@
 
 find_library(PCAP_LIBRARY NAMES ${libpcap} PATH ${CMAKE_LIBRARY_PATH})
 
-if(PCAP_INCLUDE_DIR AND PCAP_LIB_DIR AND PCAP_LIBRARY )
+if(PCAP_INCLUDE_DIR AND PCAP_LIBRARY )
   message(STATUS "Found Libpcap.")
 
   if(NOT ${INCLUDE_DIR} MATCHES ${PCAP_INCLUDE_DIR})
@@ -24,7 +24,7 @@
     set(INCLUDE_DIR "${INCLUDE_DIR} ${PCAP_INCLUDE_DIR}")
   endif(NOT ${INCLUDE_DIR} MATCHES ${PCAP_INCLUDE_DIR})
 
-  if(NOT ${LIB_DIR} MATCHES ${PCAP_LIB_DIR})
+  if(PCAP_LIB_DIR AND NOT ${LIB_DIR} MATCHES ${PCAP_LIB_DIR})
     link_directories(${PCAP_LIB_DIR})
     set(LIB_DIR "${LIB_DIR} ${PCAP_LIB_DIR}")
   endif(NOT ${LIB_DIR} MATCHES ${PCAP_LIB_DIR})
Index: arpon-2.0/cmake_modules/FindNET.cmake
===================================================================
--- arpon-2.0.orig/cmake_modules/FindNET.cmake	2010-05-28 16:37:07.000000000 -0400
+++ arpon-2.0/cmake_modules/FindNET.cmake	2014-01-14 14:43:00.310262563 -0500
@@ -16,7 +16,7 @@
 
 find_library(LIBNET_LIBRARY NAMES ${libnet} PATH ${CMAKE_LIBRARY_PATH})
 
-if(LIBNET_INCLUDE_DIR AND LIBNET_LIB_DIR AND LIBNET_LIBRARY )
+if(LIBNET_INCLUDE_DIR AND LIBNET_LIBRARY )
   message(STATUS "Found Libnet.")
 
   if(NOT ${INCLUDE_DIR} MATCHES ${LIBNET_INCLUDE_DIR})
@@ -24,7 +24,7 @@
     include_directories(${LIBNET_INCLUDE_DIR})
   endif(NOT ${INCLUDE_DIR} MATCHES ${LIBNET_INCLUDE_DIR})
 
-  if(NOT ${LIB_DIR} MATCHES ${LIBNET_LIB_DIR})
+  if(LIBNET_LIB_DIR AND NOT ${LIB_DIR} MATCHES ${LIBNET_LIB_DIR})
     link_directories(${LIBNET_LIB_DIR})
     set(LIB_DIR "${LIB_DIR} ${LIBNET_LIB_DIR}")
   endif(NOT ${LIB_DIR} MATCHES ${LIBNET_LIB_DIR})
