Can't get pylibpcap extension to build under 2.4


G

Grant Edwards

I've been using the pylibpcap extension module for several
years, but I can't get it to build under 2.4:

$ python setup.py build
/usr/lib/python2.4/distutils/dist.py:222: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running build
running build_ext
building '_pcapmodule' extension
Traceback (most recent call last):
File "setup.py", line 187, in ?
cmdclass = {'clean': pcapclean,
File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/distutils/command/build.py", line 112, in run
self.run_command(cmd_name)
File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/distutils/command/build_ext.py", line 279, in run
self.build_extensions()
File "/usr/lib/python2.4/distutils/command/build_ext.py", line 405, in build_extensions
self.build_extension(ext)
File "/usr/lib/python2.4/distutils/command/build_ext.py", line 442, in build_extension
sources = self.swig_sources(sources, ext)
TypeError: swig_sources() takes exactly 2 arguments (3 given)

After googling around I tried this:


--- setup.py-old 2005-10-05 18:34:20.486133727 -0500
+++ setup.py 2005-10-05 18:34:44.281584035 -0500
@@ -68,21 +68,21 @@

def before_swig_sources(self, sources):
new_sources = [ ]
for source in sources:
if source == 'mk-constants.py':
self.make_file( (source,), 'constants.c', execfile, (source,) )
else:
new_sources.append(source)
return new_sources

- def swig_sources(self, sources):
+ def swig_sources(self, sources, extension=None):

"""Walk the list of source files in 'sources', looking for SWIG
interface (.i) files. Run SWIG on all that are found, and
return a modified 'sources' list with SWIG source files replaced
by the generated C (or C++) files.
"""

sources = self.before_swig_sources(sources)

new_sources = []


I've never used SWIG, so I don't have any idea what's going on,
but it got a little bit further:

$ python setup.py build
/usr/lib/python2.4/distutils/dist.py:222: UserWarning: 'licence' distribution option is deprecated; use 'license' warnings.warn(msg)
running build
running build_ext
building '_pcapmodule' extension
generating constants.c from mk-constants.py
swig -python -shadow -ISWIG -o pcap.c pcap.i
pcap.i:23: Error: Unable to find 'doc.i'
error: command 'swig' failed with exit status 1

And the files I end up with are:

-rw-r--r-- 1 grante grante 5336 Oct 5 18:36 constants.c
-rw-r--r-- 1 grante grante 395 Apr 23 2002 COPYING
-rw-r--r-- 1 grante grante 1100 Apr 28 2004 error.c
drwxr-xr-x 2 grante grante 4096 Jul 3 18:32 examples/
-rw-r--r-- 1 grante grante 958 Apr 28 2004 exception.c
-rw-r--r-- 1 grante grante 118 Jul 3 18:17 MANIFEST.in
-rw-r--r-- 1 grante grante 2068 Jun 7 2004 mk-constants.py
-rw-r--r-- 1 grante grante 54542 Jul 3 18:11 pcap.c
-rw-r--r-- 1 grante grante 4671 Jul 10 2004 pcap.i
-rw-r--r-- 1 grante grante 14929 Jul 9 2004 pcap_interface.c
-rw-r--r-- 1 grante grante 6011 Jul 3 18:11 pcap.py
-rw-r--r-- 1 grante grante 346 Jul 3 18:32 PKG-INFO
-rw-r--r-- 1 grante grante 2379 Dec 3 2004 pypcap.h
-rw-r--r-- 1 grante grante 1744 Jul 3 18:29 README
-rw-r--r-- 1 grante grante 100 Jun 14 2002 setup.cfg
-rwxr-xr-x 1 grante grante 6374 Oct 5 18:34 setup.py*
-rwxr-xr-x 1 grante grante 6358 Oct 5 18:34 setup.py-old*


Anybody have a clue to spare?
 
Ad

Advertisements

G

Grant Edwards

I've been using the pylibpcap extension module for several
years, but I can't get it to build under 2.4:

It turns out the .tar.gz file being distributed is missing the
file doc.i and the entire build-tools subdirectory. If you
grab the missing stuff from CVS it builds and installs after
you hack setup.py as shown in the previous post.

Don't know if it _works_ yet...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top