From: Mark Wooding Date: Sun, 4 Oct 2009 13:39:35 +0000 (+0100) Subject: debian, build: Big overhaul. X-Git-Tag: 1.0.1^0 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/getdate-python/commitdiff_plain/e58b9b2f42717fd3da2a5f2000e81686e72f5ea6 debian, build: Big overhaul. --- diff --git a/.gitignore b/.gitignore index 7a52dfe..2cbffee 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,9 @@ MANIFEST build-stamp dist build - +auto-version +RELEASE +COPYING +mdwsetup.py +*.pyc +python-build-stamp-* diff --git a/.links b/.links index 2917822..cb7e154 100644 --- a/.links +++ b/.links @@ -1,3 +1,5 @@ getdate.y getdate.h COPYING +auto-version +mdwsetup.py diff --git a/debian/.gitignore b/debian/.gitignore index c6cfd45..307a50c 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -4,6 +4,7 @@ substvars *.substvars *.debhelper python-getdate -python2.3-getdate -python2.4-getdate +*.log +compat +pycompat diff --git a/debian/changelog b/debian/changelog index 85c7400..f73d9c9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,10 @@ -python-getdate (1.0.0) experimental; urgency=low +getdate-python (1.0.1) experimental; urgency=low + + * Fixing for newer Pythons, and a build system overhaul. + + -- Mark Wooding Sun, 04 Oct 2009 14:36:56 +0100 + +getdate-python (1.0.0) experimental; urgency=low * Written! diff --git a/debian/control b/debian/control index 9928972..728498a 100644 --- a/debian/control +++ b/debian/control @@ -1,12 +1,14 @@ -Source: python-getdate +Source: getdate-python Section: python Priority: extra -Build-Depends: python +XS-Python-Version: >= 2.4, << 2.7 +Build-Depends: debhelper, python-central, python-dev Maintainer: Mark Wooding -Standards-Version: 3.1.1 +Standards-Version: 3.8.0 Package: python-getdate Architecture: any +XB-Python-Version: ${python:Versions} Depends: ${shlibs:Depends}, ${python:Depends} Description: Python binding for date parser diff --git a/debian/rules b/debian/rules index 05e0fc0..6ebce3c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,44 +1,9 @@ #! /usr/bin/make -f -export DH_COMPAT = 4 +CDBS = /usr/share/cdbs/1 -build: build-stamp +DEB_PYTHON_SYSTEM = pycentral +include $(CDBS)/rules/debhelper.mk +include $(CDBS)/class/python-distutils.mk -build-stamp: - python setup.py build - touch build-stamp - -clean: - dh_clean - rm -rf build build-stamp - -install: build - dh_clean - python setup.py build - python setup.py install --root=debian/python-getdate - -binary-arch: install - dh_testdir -a - dh_testroot -a - dh_compress -a - dh_installdocs -a - dh_strip -a - dh_shlibdeps -a - dh_python -a - dh_gencontrol -a - dh_fixperms -a - dh_installdeb -a - dh_md5sums -a - dh_builddeb -a - -binary: binary-arch - -source: - rm -rf dist/*.tar.gz dist/=deb= - python$(DEFVERSION) setup.py sdist - mkdir dist/=deb= - cd dist/=deb=; tar xvfz ../*.tar.gz - d=`pwd`; cd ..; dpkg-source -i -i'/\.svn/' -b $$d/dist/=deb=/* - rm -rf dist/=deb= - -.PHONY: binary binary-arch binary-indep clean install source build +###----- That's all, folks -------------------------------------------------- diff --git a/setup.py b/setup.py index 51e897b..1a7280b 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,22 @@ #! /usr/bin/python -from distutils.core import setup, Extension -import os as OS +import subprocess as SUB -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 +import distutils.core as DC +import mdwsetup as MS -if needs_update_p('getdate.c', ['getdate.y']): - OS.system('bison -o getdate.c getdate.y') +if MS.needs_update_p('getdate.c', ['getdate.y']): + rc = SUB.call(['bison', '-o', 'getdate.c', 'getdate.y']) + if rc: + raise MS.SubprocessFailure, ('bison', rc) -setup(name = 'getdate-python', - 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'])]) +getdate = DC.Extension('getdate', + ['module.c', 'getdate.c']) + +DC.setup(name = 'getdate-python', + version = MS.auto_version(), + description = 'Date/time parser', + author = 'Mark Wooding', + author_email = 'mdw@distorted.org.uk', + license = 'GNU General Public License', + ext_modules = [getdate])