diff --git a/.gitignore b/.gitignore index 2fd6fc7b..091b9057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ /build /dist -/pycdio.pyc -/pycdio_wrap.c -/pyiso9660_wrap.c +/*.pyc diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..77332636 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +R. Bernstein (rocky@gnu.org) diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..11975e13 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +# Compatibility for us old-timers. +PHONY=check test dist +all: check +dist: + python ./setup.py sdist bdist +check: + nosetests +test: check +.PHONY: $(PHONY) diff --git a/NEWS b/NEWS new file mode 100644 index 00000000..fac1f85b --- /dev/null +++ b/NEWS @@ -0,0 +1,44 @@ +0.14 +- Convert to use setuptools + +0.13 +2007-10-27 + +- Small bugfix + +0.12 +2006-12-10 + +- Add get_msg() + +- Add pathname_isofy() in iso9660.py + +- Correct bugs in SWIG pathname_isofy() and close_tray() + +- Correct bug in get_devices when there was only one device. + +0.11 +2006-03-27 + +- Add ISO 9660 library + * add example programs to extract a file from an ISO fileystem + * add regression tsets + +- Changes to make building outside of source tree (e.g. "make + distcheck") work + +- Include SWIG-derived files. In theory you don't need SWIG installed + any more (although you do need a C compiler and libcdio installed). + +- Remove bug in is_device() + +- Fixes for Solaris and cygwin builds (compilation/linking flags) + +- Minor SWIG changes to be more precise. + +0.10 +2006-01-30 + +Initial Python wrapper + +$Id: NEWS,v 1.8 2007/10/21 22:28:58 rocky Exp $ diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..35f04581 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,12 @@ +[nosetests] +# Location of test programs. "where" can be given several times. +# If "where is a directory, then that's the working directory. +where=./test + +# Show individual tests run +verbosity=2 + +cover-package=nose +# debug=nose.loader +pdb=1 +detailed-errors=1 diff --git a/setup.py b/setup.py index 704b87f9..740ed7e4 100755 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ distutils setup (setup.py) for pycdio from setuptools import setup from distutils.core import Extension +from subprocess import * version = '0.14vc' @@ -13,11 +14,34 @@ import os README = os.path.join(os.path.dirname(__file__), 'README.txt') long_description = open(README).read() + '\n\n' +# Find link args for libcdio and libiso9660 using pkg-config and add +# collect them into a list for setup's ext_modules. +libraries=[] +link_args=[] +for i, lib_name in enumerate(('libcdio', 'libiso9660',)): + p = Popen(['pkg-config', '--libs', lib_name], stdout=PIPE) + if p.returncode is None: + link_args.append([p.communicate()[0]]) + libraries.append(None) # Above includes libcdio + else: + print ("Didn't the normal return code running pkg-config," + + "got:\n\t%s" % p.returncode) + short_libname = lib_name[3:] # Strip off "lib" from name + print "Will try to add %s anyway." % short_libname + link_args.append(None) + libraries.append(short_libname) # Strip off "lib" frame name +else: + libcdio_link_args = None + libcdio_library = ['cdio'] + +# FIXME: incorporate into above loop. E.g. using modules=[] var. pycdio_module = Extension('_pycdio', - libraries=['cdio'], + libraries=libraries[0], + extra_link_args=link_args[0], sources=['swig/pycdio.i']) pyiso9660_module = Extension('_pyiso9660', - libraries=['iso9660'], + libraries=libraries[1], + extra_link_args=link_args[1], sources=['swig/pyiso9660.i']) setup (name = 'pycdio', author = 'Rocky Bernstein', diff --git a/swig/.gitignore b/swig/.gitignore index 4764e0d0..635f2720 100644 --- a/swig/.gitignore +++ b/swig/.gitignore @@ -1,2 +1,4 @@ +/pycdio.py /pycdio_wrap.c +/pyiso9660.py /pyiso9660_wrap.c diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 00000000..a74b07ae --- /dev/null +++ b/test/.gitignore @@ -0,0 +1 @@ +/*.pyc