From e9fc59fa285cd6986540aa2e8eb1e8dcf9b3dfe7 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 16 Jun 2013 00:12:54 +0100 Subject: [PATCH] Overhaul build system using new `cfd' machinery. Organization: Straylight/Edgeware From: Mark Wooding --- .gitignore | 3 +-- .links | 1 + MANIFEST.in | 19 ++++++++++++++++--- Makefile | 23 ++--------------------- setup.py | 9 ++------- 5 files changed, 22 insertions(+), 33 deletions(-) mode change 100644 => 100755 setup.py diff --git a/.gitignore b/.gitignore index 678cbf1..98bd1e8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,7 @@ deb-build build-stamp COPYING algorithms.h -RELEASE auto-version mdwsetup.py *.pyc -python-build-stamp-* +pysetup.mk diff --git a/.links b/.links index e25ac67..4e00440 100644 --- a/.links +++ b/.links @@ -1,3 +1,4 @@ COPYING auto-version mdwsetup.py +pysetup.mk diff --git a/MANIFEST.in b/MANIFEST.in index af5f781..813894a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,20 @@ -include COPYING README Makefile MANIFEST MANIFEST.in +### Manifest template for Catacomb/Python. + +## Generated build machinery. +include COPYING auto-version mdwsetup.py pysetup.mk + +## Basic build stuff. +include MANIFEST.in setup.py Makefile + +## C extension code. include *.c *.h include algorithms.py +exclude algorithms.h include pwsafe -include debian/rules debian/control debian/changelog debian/copyright + +## Python wrapping. recursive-include catacomb *.py -prune py + +## Debian. +include debian/rules debian/control debian/changelog debian/copyright + diff --git a/Makefile b/Makefile index 7a24b27..b9f9347 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,2 @@ -## Makefile - -PYTHON = python -prefix = /usr/local - -GEN = algorithms.h - -all: setup.py - $(PYTHON) setup.py build - -clean: setup.py - $(PYTHON) setup.py clean - rm -rf build $(GEN) - -dist: setup.py - $(PYTHON) setup.py sdist - -install: setup.py - $(PYTHON) setup.py install --prefix $(prefix) - -.PHONY: all clean dist install +### -*-makefile-*- +include pysetup.mk diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 927d1d2..5f4c373 --- a/setup.py +++ b/setup.py @@ -1,16 +1,11 @@ #! /usr/bin/python -import os as OS -import subprocess as SUB - import distutils.core as DC import mdwsetup as MS MS.pkg_config('catacomb', '2.1.1') MS.pkg_config('mLib', '2.0.4') -MS.generate('algorithms.h') - cat = DC.Extension('catacomb._base', ['catacomb.c', 'bytestring.c', 'buffer.c', 'rand.c', 'algorithms.c', 'pubkey.c', 'pgen.c', @@ -21,8 +16,7 @@ cat = DC.Extension('catacomb._base', library_dirs = MS.uniquify(MS.LIBDIRS), libraries = MS.uniquify(MS.LIBS)) -DC.setup(name = 'catacomb-python', - version = MS.auto_version(), +MS.setup(name = 'catacomb-python', description = 'Interface to Catacomb cryptographic library', url = 'http://www.distorted.org.uk/~mdw/Catacomb-2.1.0', author = 'Straylight/Edgeware', @@ -30,4 +24,5 @@ DC.setup(name = 'catacomb-python', license = 'GNU General Public License', packages = ['catacomb'], scripts = ['pwsafe'], + genfiles = [MS.Generate('algorithms.h')], ext_modules = [cat]) -- [mdw]