aboutsummaryrefslogtreecommitdiffstats
path: root/net/py-pypcap/files/patch-setup.py
blob: aa9988d44b8193c52ba308d47d0725121de2afdd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- ./setup.py.orig 2005-10-16 19:07:03.000000000 -0400
+++ ./setup.py  2011-12-18 14:32:02.170660843 -0500
@@ -25,7 +25,10 @@
         d = {}
         if os.path.exists(os.path.join(cfg['include_dirs'][0], 'pcap-int.h')):
             d['HAVE_PCAP_INT_H'] = 1
-        buf = open(os.path.join(cfg['include_dirs'][0], 'pcap.h')).read()
+        if int(os.uname()[2].split('.')[0]) >= 8:
+            buf = open(os.path.join(cfg['include_dirs'][1], 'pcap.h')).read()
+        else:
+            buf = open(os.path.join(cfg['include_dirs'][0], 'pcap.h')).read()
         if buf.find('pcap_file(') != -1:
             d['HAVE_PCAP_FILE'] = 1
         if buf.find('pcap_compile_nopcap(') != -1:
@@ -46,6 +49,7 @@
                 incdirs = [ os.path.join(d, sd) ]
                 if os.path.exists(os.path.join(d, sd, 'pcap.h')):
                     cfg['include_dirs'] = [ os.path.join(d, sd) ]
+                    cfg['include_dirs'].append(os.path.join(d, 'include/pcap'))
                     for sd in ('lib', ''):
                         for lib in (('pcap', 'libpcap.a'),
                                     ('pcap', 'libpcap.dylib'),