X-Git-Url: https://git.distorted.org.uk/~mdw/getdate-python/blobdiff_plain/162b088e0939d7191cdd0343bc500ce115a659f1..6f110c11249f7545511839cc9c1ee3891feb2c7e:/setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..41c302d --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +#! /usr/bin/python + +from distutils.core import setup, Extension +import os as OS + +def needs_update_p(target, deps): + if not OS.path.exists(target): return True + ts = OS.stat(target) + for d in deps: + s = OS.stat(d) + if ts.st_mtime < s.st_mtime: return True + return False + +if needs_update_p('getdate.c', ['getdate.y']): + OS.system('bison -o getdate.c getdate.y') + +setup(name = 'getdate', + version = '1.0.0', + description = 'Date/time parser', + author = 'Mark Wooding', + author_email = 'mdw@distorted.org.uk', + license = 'GNU General Public License', + ext_modules = [Extension('getdate', ['module.c', 'getdate.c'])])