-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 <mdw@distorted.org.uk>
-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
#! /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 --------------------------------------------------
#! /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])