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 7a52dfebb4927923946139fc152a472846c142b7..2cbffee39a57a06b5b2fe44212f1e192acf31fb8 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 2917822576a9bfbe47bebf95f55e6852cb24e12f..cb7e154631162608dd452a9bd108eae8a942098a 100644 (file)
--- a/.links
+++ b/.links
@@ -1,3 +1,5 @@
 getdate.y
 getdate.h
 COPYING
+auto-version
+mdwsetup.py
index c6cfd4554ab8012df6edf13624cfa62bcfa2cc99..307a50c2599565fde8b55615a00d8b8b8f4671d8 100644 (file)
@@ -4,6 +4,7 @@ substvars
 *.substvars
 *.debhelper
 python-getdate
-python2.3-getdate
-python2.4-getdate
+*.log
+compat
+pycompat
 
index 85c74006334af3b639c27109e29865a1bf77ecf6..f73d9c9345f6af18e998ab18f7fd5d82d15b4ccb 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 99289729c0b4b53e38b39e3035761f2ee8217be8..728498ab7301471d8da6850bb526b53733a64a7f 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 05e0fc05578a12dfe6559520eb9da614ea93da45..6ebce3c90c180e385161cabc01ad6741350360b4 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 51e897b7bb622cf247778d87e550ff753b51d575..1a7280b8d1b29cfabb91ec76bba29cf7ff7ad93f 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])