chiark / gitweb /
debian, build: Big overhaul. 1.0.1
authorMark Wooding <mdw@distorted.org.uk>
Sun, 4 Oct 2009 13:39:35 +0000 (14:39 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 4 Oct 2009 13:39:35 +0000 (14:39 +0100)
.gitignore
.links
debian/.gitignore
debian/changelog
debian/control
debian/rules
setup.py

index 7a52dfe..2cbffee 100644 (file)
@@ -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 (file)
--- a/.links
+++ b/.links
@@ -1,3 +1,5 @@
 getdate.y
 getdate.h
 COPYING
+auto-version
+mdwsetup.py
index c6cfd45..307a50c 100644 (file)
@@ -4,6 +4,7 @@ substvars
 *.substvars
 *.debhelper
 python-getdate
-python2.3-getdate
-python2.4-getdate
+*.log
+compat
+pycompat
 
index 85c7400..f73d9c9 100644 (file)
@@ -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 <mdw@distorted.org.uk>  Sun, 04 Oct 2009 14:36:56 +0100
+
+getdate-python (1.0.0) experimental; urgency=low
 
   * Written!
 
index 9928972..728498a 100644 (file)
@@ -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 <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
 
index 05e0fc0..6ebce3c 100755 (executable)
@@ -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 --------------------------------------------------
index 51e897b..1a7280b 100644 (file)
--- 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])