swap-cwm (1.2.1-4.1) debian-dir only changes

Summary

 debian/README.source                       |   52 ++
 debian/cant                                |   20 +
 debian/cdbs/1/class/python-distutils.mk    |  297 +++++++++++++++
 debian/cdbs/1/rules/buildinfo.mk           |   40 ++
 debian/cdbs/1/rules/copyright-check.mk     |  113 +++++
 debian/cdbs/1/rules/package-relations.mk   |   76 ++++
 debian/cdbs/1/rules/upstream-tarball.mk    |  137 +++++++
 debian/changelog                           |   50 ++
 debian/compat                              |    1 
 debian/control                             |   35 +
 debian/control.in                          |   35 +
 debian/copyright                           |  141 +++++++
 debian/copyright_hints                     |  547 +++++++++++++++++++++++++++++
 debian/cwm                                 |   20 +
 debian/delta                               |   23 +
 debian/gbp.conf                            |    5 
 debian/patches/1001_cwm_fix_spelling.patch |  256 +++++++++++++
 debian/patches/README                      |    3 
 debian/patches/series                      |    1 
 debian/pycompat                            |    1 
 debian/rules                               |  116 ++++++
 debian/watch                               |    5 
 22 files changed, 1974 insertions(+)

    
download this patch

Patch contents

--- swap-cwm-1.2.1.orig/debian/cwm
+++ swap-cwm-1.2.1/debian/cwm
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Cwm wrapper for use with help2man
+
+basename="$(basename "$0")"
+basedir="$(dirname "$0")"
+
+export PYTHONPATH="$basedir/.."
+
+case "$1" in
+    --version)
+	python "$basedir/../swap/$basename.py" --revision 2>&1 | sed "s/.*$basename= \$Revision: //; s/ \$ llyn.*//"
+	;;
+    --description)
+	echo "Closed World Machine, an RDF/N3 semantic web data processor"
+	;;
+    *)
+	python "$basedir/../swap/$basename.py" "$@"
+	;;
+esac
--- swap-cwm-1.2.1.orig/debian/control
+++ swap-cwm-1.2.1/debian/control
@@ -0,0 +1,35 @@
+Source: swap-cwm
+Section: python
+Priority: optional
+Maintainer: Jonas Smedegaard <dr@jones.dk>
+Build-Depends: devscripts (>= 2.10.7), quilt, patchutils (>= 0.2.25), debhelper (>= 6), cdbs (>= 0.4.63), python (>= 2.5.3-1~), python-support (>= 1.0.0), dh-buildinfo, help2man
+Standards-Version: 3.8.0
+Homepage: http://www.w3.org/2000/10/swap/
+Vcs-Git: git://git.debian.org:/git/collab-maint/swap-cwm.git
+Vcs-Browser: http://git.debian.org/?p=collab-maint/swap-cwm.git
+
+Package: python-swap
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ${cdbs:Depends}
+Provides: ${python:Provides}
+Suggests: ${cdbs:Suggests}
+Description: Semantic Web Area for Play
+ SWAP is a Python library of RDF/XML and RDF/N3 semantic web routines,
+ primarily used by Cwm.
+ .
+ SWAP is an acronym for both "Semantic Web Area for Play" and "Semantic
+ Web Application Platform".
+
+Package: swap-cwm
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ${cdbs:Depends}
+Suggests: ${cdbs:Suggests}
+Description: RDF/XML and RDF/N3 semantic web data processor
+ Cwm (pronounced coom) is a general-purpose data processor for the
+ semantic web, somewhat like sed, awk, etc. for text files or XSLT for
+ XML. It is a forward chaining reasoner which can be used for querying,
+ checking, transforming and filtering information. Its core language is
+ RDF, extended to include rules, and it uses RDF/XML or RDF/N3
+ (Notation3) serializations as required.
+ .
+ Also included is the RDF tools cant and delta.
--- swap-cwm-1.2.1.orig/debian/rules
+++ swap-cwm-1.2.1/debian/rules
@@ -0,0 +1,116 @@
+#!/usr/bin/make -f
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2009 Jonas Smedegaard <dr@jones.dk>
+# Description: Main Debian packaging script for Cwm
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+DEB_PYTHON_SYSTEM = pysupport
+ifneq (,$(DEB_MAINTAINER_MODE))
+  # Enable stuff not policy compliant (eg. unsuitable for build daemons)
+  DEB_COPYRIGHT_CHECK_STRICT = yes
+  DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes
+endif
+include debian/cdbs/1/rules/upstream-tarball.mk
+include debian/cdbs/1/rules/copyright-check.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+include /usr/share/cdbs/1/rules/debhelper.mk
+include debian/cdbs/1/class/python-distutils.mk
+include debian/cdbs/1/rules/buildinfo.mk
+
+libpkg = python-swap
+pkg = swap-cwm
+cmds = cant cwm delta
+manpages = $(cmds:%=debian/%.1)
+
+DEB_UPSTREAM_URL = http://www.w3.org/2000/10/swap
+DEB_UPSTREAM_PACKAGE = cwm
+DEB_UPSTREAM_TARBALL_MD5 = e89a71e4f48ee5f9c89d4ba2e88f5a73
+
+DEB_INSTALL_CHANGELOGS_ALL = doc/changes.html
+DEB_INSTALL_DOCS_$(libpkg) += *.html
+DEB_INSTALL_MANPAGES_$(pkg) = $(manpages)
+
+DEB_CLEAN_EXCLUDE = README~ setup.py~
+
+pyversions = 2.3-
+
+# Install directly into Python library package
+DEB_PYTHON_DESTDIR = $(CURDIR)/debian/$(cdbs_curpkg)
+
+DEB_PYTHON_INSTALL_ARGS_ALL += --install-layout=deb
+
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+build/$(libpkg):: debian/stamp-python-check
+debian/stamp-python-check: python-module-stamp/$(libpkg)
+	$(MAKE) -C test post-install P="python$(cdbs_python_compile_version)"
+	touch $@
+
+clean::
+	rm -rf test/,diffs test/,temp
+	rm -f test/pyc-check debian/stamp-python-check
+endif
+
+# Move scripts from library to cwm package and fix hashbang
+# - Strip hardcoded python version
+# - Use default system Python
+# (binary-fixup rule is too late for dh_pycentral dependency resolving)
+common-binary-indep:: debian/$(pkg)/usr/bin
+debian/$(pkg)/usr/bin: install/$(libpkg)
+	mkdir -p debian/$(pkg)/usr
+	mv debian/$(libpkg)/usr/bin debian/$(pkg)/usr/
+	egrep -r -l -Z '^#! ?/(usr/)?(local/)?bin/(env )?python[[:print:]]*$$' debian/$(pkg)/usr/bin \
+		| xargs -r -0 perl -pi -e 's,^#! ?/(usr/)?(local/)?bin/(env )?python[[:print:]]*$$,#!/usr/bin/python$(cdbs_python_compile_version),'
+
+# Fix filename of scripts
+# - strip extension
+binary-post-install/$(pkg)::
+	mv debian/$(cdbs_curpkg)/usr/bin/cant.py debian/$(cdbs_curpkg)/usr/bin/cant
+
+# Strip hashbang from Python modules
+binary-fixup/$(libpkg)::
+	egrep -r -l -Z '^#! ?/(usr/)?(local/)?bin/(env )?python[[:print:]]*$$' debian/$(cdbs_curpkg)/usr/share/py* \
+		| xargs -r -0 perl -ni -e 'print unless m,^#! ?/(usr/)?(local/)?bin/(env )?python[[:print:]]*$$,'
+
+# generate manpage based on --help of script itself
+# (using wrappers to emulate --version and provide --description)
+common-post-build-indep:: $(manpages)
+$(manpages): %.1 : %
+	chmod +x $<
+	help2man --name="$$($< --description)" --no-info --output=$@ $<
+	perl -i -0 -p \
+		-e 's/^\.PP\noptions:\n\.PP$$/.SH OPTIONS/m; # fix marking options as a headline' \
+		-e 's/^(\\fB\\-\\-.*?)=\\fR([^ ]*)/$$1\\fR=\\fI$$2\\fR/mg; # fix option value hilite' \
+		-e 's/^(\w)$$/.B $$1/mg; # fix mode flags hilite' \
+		-e 's/^\\fB\\-\\-(.*?)\\fR([^ ]*) +/.TP\n.B \\--$$1$$2\n/mg; # improve option listing' \
+		-e 's/^(\.TP\n\.B.*\n[^\.].*\n)\.IP(\n\(.*)\n\.PP$$/$$1.RS$$2/mg; # keep option lines together' \
+		$@
+
+clean::
+	rm -f $(manpages)
+
+# Needed for our packaging
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), help2man
+
+# tools needs library
+CDBS_DEPENDS_$(pkg) := $(libpkg)
+
+# Needed (sometimes) at runtime
+CDBS_SUGESTS_$(libpkg) := python-crypto, python-rdflib, $(pkg)
+CDBS_SUGESTS_$(pkg) := python-crypto, python-rdflib, otter
+
+# Resolve, cleanup and apply CDBS-declared dependencies
+include debian/cdbs/1/rules/package-relations.mk
--- swap-cwm-1.2.1.orig/debian/copyright
+++ swap-cwm-1.2.1/debian/copyright
@@ -0,0 +1,141 @@
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=442
+Upstream-Name: Cwm
+Upstream-Maintainer: Tim Berners-Lee <timbl@w3.org>
+	http://lists.w3.org/Archives/Public/public-cwm-bugs/
+Upstream-Source: http://www.w3.org/2000/10/swap
+	http://dev.w3.org/cvsweb/2000/10/swap/
+
+Files: *
+Copyright: Copyright (c) 2000-2004 World Wide Web Consortium,
+	(Massachusetts Institute of Technology, European Research
+	Consortium for Informatics and Mathematics, Keio University)
+License: W3C-Software-20021231
+
+Files: swap/sax2rdf.py
+Copyright: Copyright (c) 2002, Daniel Krech, http://eikeon.com/
+License: ModifiedBSD
+
+Files: swap/isodate.py
+Copyright: Copyright 2002 Mark Nottingham, <mailto:mnot@pobox.com>
+License: other-Permissive
+ THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
+ COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
+ AND ACKNOWLEDGEMENT OF AUTHORSHIP REMAIN.
+
+Files: swap/xmlC14n.py
+Copyright: 2001, Zolera Systems Inc.
+	2001, MIT.
+License: PSF-2.0+ | W3C-Software-19980720
+ Distributed under the terms of:
+   Python 2.0 License or later.
+   http://www.python.org/2.0.1/license.html
+ or
+   W3C Software License
+   http://www.w3.org/Consortium/Legal/copyright-software-19980720
+
+Files: debian/*
+Copyright: © 2003-2009, Jonas Smedegaard <dr@jones.dk>
+License: GPL-2+
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License (GPL) version 2 can be found at
+ /usr/share/common-licenses/GPL-2.
+
+Files: debian/*
+Copyright: © 2003-2009, Jonas Smedegaard <dr@jones.dk>
+License: GPL-2+
+
+Files: debian/cdbs/1/class/python-distutils.mk
+Copyright: 2003,2006-2008, Jonas Smedegaard <dr@jones.dk>
+	2003, Colin Walters <walters@debian.org>
+	2006, Marc Dequènes (Duck) <Duck@DuckCorp.org>
+License: GPL-2+
+
+License: W3C-Software-20021231
+ W3C® SOFTWARE NOTICE AND LICENSE
+ http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ .
+ This work (and included software, documentation 
+ such as READMEs, or other related items) is being 
+ provided by the copyright holders under the following 
+ license. By obtaining, using and/or copying this 
+ work, you (the licensee) agree that you have read, 
+ understood, and will comply with the following terms and conditions.
+ .
+ Permission to copy, modify, and distribute this 
+ software and its documentation, with or without 
+ modification, for any purpose and without fee or 
+ royalty is hereby granted, provided that you 
+ include the following on ALL copies of the software 
+ and documentation or portions thereof, including 
+ modifications:
+ .
+    1. The full text of this NOTICE in a location 
+ viewable to users of the redistributed or derivative work.
+    2. Any pre-existing intellectual property 
+ disclaimers, notices, or terms and conditions. 
+ If none exist, the W3C Software Short Notice 
+ should be included (hypertext is preferred, text 
+ is permitted) within the body of any redistributed 
+ or derivative code.
+    3. Notice of any changes or modifications to the 
+ files, including the date changes were made. (We 
+ recommend you provide URIs to the location from 
+ which the code is derived.)
+ .
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," 
+ AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR 
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+ LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS 
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE 
+ SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD 
+ PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+ .
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, 
+ INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING 
+ OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+ .
+ The name and trademarks of copyright holders may 
+ NOT be used in advertising or publicity pertaining 
+ to the software without specific, written prior 
+ permission. Title to copyright in this software 
+ and any associated documentation will at all times
+  remain with copyright holders.
+
+License: ModifiedBSD
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ .
+   * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+   * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ .
+   * Neither the name of Daniel Krech nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: GPL-2+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License (GPL) version 2 can be found at
+ /usr/share/common-licenses/GPL-2.
--- swap-cwm-1.2.1.orig/debian/copyright_hints
+++ swap-cwm-1.2.1/debian/copyright_hints
@@ -0,0 +1,547 @@
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=XXX
+Upstream-Name: Untrusted draft - double-check copyrights yourself!
+
+Files: PKG-INFO
+	RDFSink.html
+	README
+	README~
+	cant.py
+	check.html
+	check.py
+	cwm.html
+	cwm_crypto.html
+	cwm_list.html
+	cwm_math.html
+	cwm_maths.html
+	cwm_os.html
+	cwm_sparql.html
+	cwm_string.html
+	cwm_time.html
+	cwm_times.html
+	debian/README.source
+	debian/cant
+	debian/compat
+	debian/control
+	debian/control.in
+	debian/cwm
+	debian/delta
+	debian/gbp.conf
+	debian/patches/1001_cwm_fix_spelling.patch
+	debian/patches/README
+	debian/patches/series
+	debian/pycompat
+	debian/watch
+	delta
+	diag.html
+	doc/changes.html
+	formula.html
+	grammar/Makefile
+	grammar/README.txt
+	grammar/bnf-rules.n3
+	grammar/bnf.n3
+	grammar/bnf2html.n3
+	grammar/n3-ql.n3
+	grammar/n3-rdf.n3
+	grammar/n3-rules.n3
+	grammar/n3-yacc.c
+	grammar/n3.n3
+	grammar/predictiveParser.py
+	grammar/sparql.n3
+	llyn.html
+	myStore.html
+	notation3.html
+	pretty.html
+	query.html
+	rdflib2rdf.html
+	reify.html
+	sax2rdf.html
+	setup.py
+	setup.py~
+	sparql2cwm.html
+	swap/OrderedSequence.py
+	swap/RDFSink.py
+	swap/__init__.py
+	swap/cant.py
+	swap/check.py
+	swap/cwm_crypto.py
+	swap/cwm_list.py
+	swap/cwm_math.py
+	swap/cwm_maths.py
+	swap/cwm_os.py
+	swap/cwm_set.py
+	swap/cwm_sparql.py
+	swap/cwm_string.py
+	swap/cwm_time.py
+	swap/cwm_times.py
+	swap/cwm_trigo.py
+	swap/cwm_xml.py
+	swap/dbork/SqlDB.py
+	swap/dbork/TableRenderer.py
+	swap/dbork/__init__.py
+	swap/delta.py
+	swap/diag.py
+	swap/formula.py
+	swap/importList.py
+	swap/isXML.py
+	swap/local_decimal.py
+	swap/mixin.py
+	swap/myStore.py
+	swap/my_profiler.py
+	swap/n3p/__init__.py
+	swap/n3p/n3p.py
+	swap/n3p_tm.py
+	swap/notation3.py
+	swap/pretty.py
+	swap/pychinko/__init__.py
+	swap/pychinko/builtins.py
+	swap/pychinko/conclusion.py
+	swap/pychinko/config.py
+	swap/pychinko/exception.py
+	swap/pychinko/helpers.py
+	swap/pychinko/interpreter.py
+	swap/pychinko/nodes.py
+	swap/pychinko/prooftrace.py
+	swap/pychinko/rete.py
+	swap/pychinko/terms.py
+	swap/pycwmko.py
+	swap/query.py
+	swap/rdflib2rdf.py
+	swap/rdflib_user.py
+	swap/rdfxml.py
+	swap/reify.py
+	swap/set_importer.py
+	swap/sparql/Makefile
+	swap/sparql/__init__.py
+	swap/sparql/sparqlClient.py
+	swap/sparql/sparql_parser.py
+	swap/sparql/sparql_tokens.py
+	swap/sparql/webserver.py
+	swap/sparql2cwm.py
+	swap/term.py
+	swap/toXML.py
+	swap/triple_maker.py
+	swap/update.py
+	swap/uripath.py
+	swap/webAccess.py
+	swap/why.py
+	term.html
+	test/Makefile
+	test/animal.rdf
+	test/anon-prop.n3
+	test/anonymous_loop.n3
+	test/contexts.n3
+	test/cwm/detailed.tests
+	test/cwm/fam-rules.n3
+	test/cwm/fam-thinkwith.ref
+	test/cwm/fam.n3
+	test/daml-ex.n3
+	test/daml-ont.n3
+	test/daml-ont.rdf
+	test/daml-pref.n3
+	test/datatypes/dec-div.n3
+	test/delta/detailed.tests
+	test/delta/t3/from.n3
+	test/delta/t3/to-diff.n3
+	test/delta/t3/to-same.n3
+	test/dt/dtlit1.n3
+	test/equiv-syntax.n3
+	test/i18n/n3string.n3
+	test/includes/bnode-conclude-ref.n3
+	test/includes/bnodeConclude.n3
+	test/includes/builtins.n3
+	test/includes/concat.n3
+	test/includes/conclusion.n3
+	test/includes/conjunction.n3
+	test/includes/detailed.tests
+	test/includes/foo.n3
+	test/includes/genBnodeInNestedFormula.n3
+	test/includes/list-in-ref.n3
+	test/includes/list-in.n3
+	test/includes/n3ExprFor.n3
+	test/includes/quant-implies.n3
+	test/includes/quantifiers.n3
+	test/includes/quantifiers_limited.n3
+	test/includes/t1.n3
+	test/includes/t10.n3
+	test/includes/t10a.n3
+	test/includes/t11.n3
+	test/includes/t2.n3
+	test/includes/t3.n3
+	test/includes/t4.n3
+	test/includes/t6.n3
+	test/includes/t8.n3
+	test/includes/t9br.n3
+	test/includes/uri-object-invalid.n3
+	test/includes/uri-startswith.n3
+	test/includes/xsd.n3
+	test/includes/xsd.ref
+	test/invalid-ex.n3
+	test/list/append.n3
+	test/list/bnode_in_list_in_list.n3
+	test/list/builtin_generated_match.n3
+	test/list/construct.n3
+	test/list/detailed.tests
+	test/list/double.n3
+	test/list/itemType.rdf
+	test/list/last.n3
+	test/list/list-bug1.n3
+	test/list/list-bug2.n3
+	test/list/r1.n3
+	test/list/unify1.n3
+	test/list/unify4.n3
+	test/lists-simple.n3
+	test/lists.n3
+	test/log-filter.n3
+	test/math/detailed.tests
+	test/math/long.n3
+	test/math/math-test.n3
+	test/math/quotient_string.n3
+	test/math/trigo-test.n3
+	test/math/trigo.ref.n3
+	test/n3parser.tests
+	test/nodeID/classes.n3
+	test/nodeID/classes.ref.rdf
+	test/nodeID/ex1.rdf
+	test/norm/av.n3
+	test/norm/detailed.tests
+	test/norm/fix.rdf
+	test/ntriples/detailed.tests
+	test/ntriples/t1.n3
+	test/ntriples/t1.ref.ntriples
+	test/on-add/smush.n3
+	test/os/argv.n3
+	test/os/environ.n3
+	test/owl-ex.rdf
+	test/paw/detailed.tests
+	test/ql/detailed.tests
+	test/ql/kb1.n3
+	test/ql/t00-ref.n3
+	test/ql/t00.n3
+	test/ql/t01-ref.n3
+	test/ql/t01.n3
+	test/query/filter-bnodes.n3
+	test/query/trivial-filter.n3
+	test/rdfcore-tests.n3
+	test/reason/danc.n3
+	test/reason/detailed.tests
+	test/reason/f9.n3
+	test/reason/poor-urop.n3
+	test/reason/rename-loop.n3
+	test/reason/single_gen.n3
+	test/reason/socrates.n3
+	test/reason/t1.n3
+	test/reason/t2.n3
+	test/reason/t3.n3
+	test/reason/t4.n3
+	test/reason/t5.n3
+	test/reason/t6.n3
+	test/reason/t8.n3
+	test/reason/t9.n3
+	test/reason/timbl.n3
+	test/ref/animal-1.rdf
+	test/ref/animal-ntriples.n3
+	test/ref/animal.n3
+	test/ref/anon-prop-1.n3
+	test/ref/anonymous_loop.ref
+	test/ref/append-out.n3
+	test/ref/argv-1.n3
+	test/ref/argv-2.n3
+	test/ref/base64.n3
+	test/ref/bi-concat.n3
+	test/ref/bi-quant-imp.n3
+	test/ref/bi-quant.n3
+	test/ref/bi-t1.n3
+	test/ref/bi-t10.n3
+	test/ref/bi-t11.n3
+	test/ref/bi-t2.n3
+	test/ref/bi-t3.n3
+	test/ref/bi-t4.n3
+	test/ref/bi-t6.n3
+	test/ref/bi-t8.n3
+	test/ref/bi-t9.n3
+	test/ref/bi-uri-startswith.n3
+	test/ref/bnode.n3
+	test/ref/bnode.rdf
+	test/ref/bnode_in_list_in_list.ref
+	test/ref/colon-in-uri.n3
+	test/ref/colon-no-qname.n3
+	test/ref/conclusion.n3
+	test/ref/conjunction.n3
+	test/ref/contexts-1.n3
+	test/ref/daml-ex.n3
+	test/ref/daml-ont.n3
+	test/ref/dec-div.ref.n3
+	test/ref/djb1a-out.n3
+	test/ref/dot-dash.n3
+	test/ref/dtlit1.n3
+	test/ref/endsWith-out.n3
+	test/ref/environ.n3
+	test/ref/equiv-syntax.n3
+	test/ref/filter-bnode.n3
+	test/ref/genBnodeInNestedFormula-out.n3
+	test/ref/in-xml-t.n3
+	test/ref/in-xml.n3
+	test/ref/includes-builtins.n3
+	test/ref/itemType.n3
+	test/ref/keywords1.n3
+	test/ref/keywords2.n3
+	test/ref/li-double.n3
+	test/ref/li-r1.n3
+	test/ref/list-bug1.n3
+	test/ref/list-bug2.n3
+	test/ref/list-builtin_generated_match.n3
+	test/ref/list-construct.n3
+	test/ref/list-last.n3
+	test/ref/list-unify1.n3
+	test/ref/list-unify2.n3
+	test/ref/list-unify3.n3
+	test/ref/list-unify4.n3
+	test/ref/list-unify5.n3
+	test/ref/lists-simple-1.rdf
+	test/ref/lists-simple.n3
+	test/ref/lists.n3
+	test/ref/lstring-out.n3
+	test/ref/math1.n3
+	test/ref/n3ExprFor-out.n3
+	test/ref/n3string.n3
+	test/ref/no-last-nl.n3
+	test/ref/norm-av1.n3
+	test/ref/norm-av2.n3
+	test/ref/numbers-n.n3
+	test/ref/numbers.n3
+	test/ref/path1.n3
+	test/ref/path2.n3
+	test/ref/piped-t016-out.n3
+	test/ref/prefix1.rdf
+	test/ref/prefix2.rdf
+	test/ref/prefix3.rdf
+	test/ref/quotient_string.ref.n3
+	test/ref/qvars1.n3
+	test/ref/qvars2.n3
+	test/ref/rdf-redefine.rdf
+	test/ref/reason-poor-urop.n3
+	test/ref/reason-rename-loop.n3
+	test/ref/reason-single-gen.n3
+	test/ref/reason-t01check.n3
+	test/ref/reason-t02check.n3
+	test/ref/reason-t03check.n3
+	test/ref/reason-t04check.n3
+	test/ref/reason-t05check.n3
+	test/ref/reason-t06check.n3
+	test/ref/reason-t08check.n3
+	test/ref/reason-t09check.n3
+	test/ref/reason-t09filtercheck.n3
+	test/ref/reason-t90check.n3
+	test/ref/reluri-1.rdf
+	test/ref/resolves-rdf.n3
+	test/ref/roadmap-test.dot
+	test/ref/rules-flag-a.n3
+	test/ref/rules-flag-t.n3
+	test/ref/rules12-1.n3
+	test/ref/rules12-n.n3
+	test/ref/rules13-n.n3
+	test/ref/schema1.n3
+	test/ref/schema2.n3
+	test/ref/smush.rdf
+	test/ref/smush6.n3
+	test/ref/socrates.n3
+	test/ref/strquot.n3
+	test/ref/strquot_a.n3
+	test/ref/timet1.n3
+	test/ref/timet1s.n3
+	test/ref/two-route.n3
+	test/ref/underbarscope-out.n3
+	test/ref/uriEncode.n3
+	test/ref/vblsNotURIs-out.n3
+	test/ref/xml-base3.n3
+	test/ref/xml-redefine.rdf
+	test/ref/xml-redefine2.rdf
+	test/ref/xml-syntax-basic-serialization.rdf
+	test/ref/xmllit.nt
+	test/regression.n3
+	test/reify/detailed.tests
+	test/reluri-1.n3
+	test/resolves-rdf.n3
+	test/retest.py
+	test/roadmap/test.graph
+	test/roadmap/todot.n3
+	test/rules12.n3
+	test/rules13.n3
+	test/schema-filter.n3
+	test/schema-rules.n3
+	test/sets/detailed.tests
+	test/sets/set-builtins.ref
+	test/sets/set_ops.n3
+	test/sets/sets-reified.n3
+	test/sets/sets.n3
+	test/smush-examples.rdf
+	test/smush-query.n3
+	test/smush-schema.n3
+	test/sparql/construct.sparql
+	test/sparql/construct1-result.n3
+	test/sparql/data.n3
+	test/sparql/data_construct1.n3
+	test/sparql/datatype-result.n3
+	test/sparql/datatype.n3
+	test/sparql/datatype.sparql
+	test/sparql/detailed.tests
+	test/sparql/example.rq
+	test/sparql/filter6-result.n3
+	test/sparql/filter6.sparql
+	test/sparql/filter6_data.n3
+	test/sparql/mixing-egl-result.n3
+	test/sparql/mixing_egl.n3
+	test/sparql/mixing_egl.rq
+	test/sparql/notIncludes4-result.n3
+	test/sparql/notIncludes4.sparql
+	test/sparql/notIncludes4_data.n3
+	test/sparql/optional.sparql
+	test/sparql/optional1-result.n3
+	test/sparql/optional_data.n3
+	test/sparql/query1_result.rl
+	test/sparql/sparql_builtin1.n3
+	test/string/detailed.tests
+	test/string/endsWith.n3
+	test/string/uriEncode.n3
+	test/strquot.n3
+	test/syntax/base-ref.n3
+	test/syntax/base.n3
+	test/syntax/boolean-ref.n3
+	test/syntax/boolean.n3
+	test/syntax/colon-in-uri.rdf
+	test/syntax/colon-no-qname.n3
+	test/syntax/decimal-ref.n3
+	test/syntax/decimal.n3
+	test/syntax/detailed.tests
+	test/syntax/djb1a.n3
+	test/syntax/dot-dash.n3
+	test/syntax/keywords1.n3
+	test/syntax/keywords2.n3
+	test/syntax/lstring.n3
+	test/syntax/no-last-nl.n3
+	test/syntax/numbers.n3
+	test/syntax/path1.n3
+	test/syntax/path2.n3
+	test/syntax/qvars1.n3
+	test/syntax/qvars2.n3
+	test/syntax/space-in-uri-rdf.rdf
+	test/syntax/space-in-uri-ref.n3
+	test/syntax/space-in-uri.n3
+	test/syntax/this-quantifiers-ref2.n3
+	test/syntax/this-rules-ref2.n3
+	test/syntax/trailing-semicolon-ref.nt
+	test/syntax/trailing-semicolon.n3
+	test/testmeta.n3
+	test/time/t1.n3
+	test/time/t1s.n3
+	test/two-route.n3
+	test/underbarscope.n3
+	test/unify/reflexive-ref.n3
+	test/unify/reflexive.n3
+	test/vblsNotURIs.n3
+	test/xml-syntax/basic-serialization.n3
+	test/xml-syntax/in-xml.xml
+	test/xml-syntax/non-ascii-pred.rdf
+	test/xml-syntax/rdf_prefix.n3
+	test/xml-syntax/xml_prefix.n3
+	test/xml-syntax/xml_prefix2.n3
+	test/xml-syntax/xmlbase3.rdf
+	thing.html
+	toXML.html
+	uripath.html
+	why.html
+	xml2infoset.html
+Copyright: *No copyright*
+License: UNKNOWN
+
+Files: test/forgetDups.n3
+	test/sameDan.n3
+	test/sameThing.n3
+	test/string/roughly.n3
+Copyright: 2001, W3C (MIT, Keio, INRIA)"
+License: UNKNOWN
+
+Files: swap/n3p/n3meta.py
+	swap/sparql/sparql_table.py
+	swap/sparql/sparql_tokens_table.py
+Copyright: *No copyright*
+License: UNKNOWN (GENERATED FILE)
+
+Files: cwm
+	swap/cwm.py
+Copyright: 2000-2004, World Wide Web Consortium, (Massachusetts
+License: UNKNOWN
+
+Files: test/ref/roughly-out.n3
+	test/ref/sameDan.n3
+Copyright: 2001, W3C (MIT, Keio, INRIA)";
+License: UNKNOWN
+
+Files: test/norm/t-200401-unicode.rdf
+	test/norm/t-200401-unicode.ref
+Copyright: 2004, Norman Walsh. All rights reserved.</dc:rights>
+License: UNKNOWN
+
+Files: LICENSE.n3
+	LICENSE.rdf
+Copyright: other contributers mentioned in individual files
+	2000,1,2 W3C (MIT, INRIA, Keio)
+License: UNKNOWN
+
+Files: debian/cdbs/1/class/python-distutils.mk
+Copyright: 2003,2006-2008, Jonas Smedegaard <dr@jones.dk>
+	2003, Colin Walters <walters@debian.org>
+	2006, Marc Dequnes (Duck) <Duck@DuckCorp.org>
+License: GPL
+
+Files: debian/cdbs/1/rules/buildinfo.mk
+Copyright: 2004-2007, Jonas Smedegaard <dr@jones.dk>
+License: GPL
+
+Files: debian/cdbs/1/rules/upstream-tarball.mk
+Copyright: 2007-2008, Jonas Smedegaard <dr@jones.dk>
+License: GPL
+
+Files: debian/cdbs/1/rules/package-relations.mk
+Copyright: 2008, Jonas Smedegaard <dr@jones.dk>
+License: GPL
+
+Files: debian/rules
+Copyright: 2009, Jonas Smedegaard <dr@jones.dk>
+License: GPL
+
+Files: debian/cdbs/1/rules/copyright-check.mk
+Copyright: \s*(\S.*?)\s*\
+License: GPL
+
+Files: swap/llyn.py
+Copyright: () 2000-2004, World Wide Web Consortium, (Massachusetts Institute
+License: UNKNOWN
+
+Files: swap/sax2rdf.py
+Copyright: 2002, Daniel Krech, http://eikeon.com/
+License: UNKNOWN
+
+Files: swap/isodate.py
+Copyright: 2002, Mark Nottingham, <mailto:mnot@pobox.com>
+License: UNKNOWN
+
+Files: swap/xmlC14n.py
+Copyright: = ''' 2001, Zolera Systems Inc. All Rights Reserved
+	2001, MIT. All Rights Reserved
+License: UNKNOWN
+
+Files: LICENSE
+Copyright: HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT
+	holders may
+	HOLDERS MAKE NO REPRESENTATIONS OR
+	in this software
+	holders under the following
+	holders
+License: UNKNOWN
+
+Files: test/xml-syntax/xmllit.rdf
+Copyright: clause at
+	World Wide Web Consortium, (Massachusetts Institute of
+License: UNKNOWN
+
--- swap-cwm-1.2.1.orig/debian/gbp.conf
+++ swap-cwm-1.2.1/debian/gbp.conf
@@ -0,0 +1,5 @@
+# Configuration file for git-buildpackage and friends
+
+[DEFAULT]
+pristine-tar = True
+sign-tags = True
--- swap-cwm-1.2.1.orig/debian/control.in
+++ swap-cwm-1.2.1/debian/control.in
@@ -0,0 +1,35 @@
+Source: swap-cwm
+Section: python
+Priority: optional
+Maintainer: Jonas Smedegaard <dr@jones.dk>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.0
+Homepage: http://www.w3.org/2000/10/swap/
+Vcs-Git: git://git.debian.org:/git/collab-maint/swap-cwm.git
+Vcs-Browser: http://git.debian.org/?p=collab-maint/swap-cwm.git
+
+Package: python-swap
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ${cdbs:Depends}
+Provides: ${python:Provides}
+Suggests: ${cdbs:Suggests}
+Description: Semantic Web Area for Play
+ SWAP is a Python library of RDF/XML and RDF/N3 semantic web routines,
+ primarily used by Cwm.
+ .
+ SWAP is an acronym for both "Semantic Web Area for Play" and "Semantic
+ Web Application Platform".
+
+Package: swap-cwm
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ${cdbs:Depends}
+Suggests: ${cdbs:Suggests}
+Description: RDF/XML and RDF/N3 semantic web data processor
+ Cwm (pronounced coom) is a general-purpose data processor for the
+ semantic web, somewhat like sed, awk, etc. for text files or XSLT for
+ XML. It is a forward chaining reasoner which can be used for querying,
+ checking, transforming and filtering information. Its core language is
+ RDF, extended to include rules, and it uses RDF/XML or RDF/N3
+ (Notation3) serializations as required.
+ .
+ Also included is the RDF tools cant and delta.
--- swap-cwm-1.2.1.orig/debian/changelog
+++ swap-cwm-1.2.1/debian/changelog
@@ -0,0 +1,50 @@
+swap-cwm (1.2.1-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/rules
+    - added '--install-layout=deb' parameter to setup.py install call; thanks to
+      Jakub Wilk for the report; Closes: #571512
+  * debian/control
+    - set b-d on python (instead of p-dev) and bump version to '>= 2.5.3-1~', to
+      support install-layout
+    - bump versioned b-d on cdbs and python-support to properly support Python
+
+ -- Sandro Tosi <morph@debian.org>  Mon, 01 Mar 2010 15:58:28 +0100
+
+swap-cwm (1.2.1-4) unstable; urgency=low
+
+  * Have both python-swap and swap-cwm suggest python-crypto and
+    python-rdflib.
+  * Have swap-cwm suggest otter.
+  * Maintain all package dependencies in debian/rules, with comments.
+  * Install Cwm binary as cwm (not swap-cwm).
+  * Fix spelling (just small typos) in --help output of cwm script.
+  * Fix typo in README.source: new new.
+  * Extend package-relation cleanup to include debhelper 6 and 7.0.1.
+  * Drop TopGit noise from cdbs-skel.
+  * Fix description in copyright header of debian/rules.
+  * Use variables libpkg and pkg in debian/rules.
+  * Generate manpages using help2man.
+
+ -- Jonas Smedegaard <dr@jones.dk>  Fri, 17 Apr 2009 00:59:23 +0200
+
+swap-cwm (1.2.1-3) unstable; urgency=low
+
+  * Fix have swap-cwm depend on python-swap.
+  * Install documentation only on python-swap.
+  * Use $(MAKE) when invoking tests (hopefully fixes invoking twice).
+
+ -- Jonas Smedegaard <dr@jones.dk>  Wed, 11 Mar 2009 04:43:53 +0100
+
+swap-cwm (1.2.1-2) unstable; urgency=low
+
+  * Fix debian/copyright to include all licenses and owners.
+  * Install upstream changelog and documentation.
+
+ -- Jonas Smedegaard <dr@jones.dk>  Wed, 11 Mar 2009 03:51:04 +0100
+
+swap-cwm (1.2.1-1) unstable; urgency=low
+
+  * Initial release. Closes: bug#519205.
+
+ -- Jonas Smedegaard <dr@jones.dk>  Wed, 11 Mar 2009 00:33:58 +0100
--- swap-cwm-1.2.1.orig/debian/watch
+++ swap-cwm-1.2.1/debian/watch
@@ -0,0 +1,5 @@
+# Run the "uscan" command to check for upstream updates and more.
+version=3
+# Below works only for --report - for actual download use the following:
+#   debian/rules get-orig-source
+http://dev.w3.org/cvsweb/2000/10/swap/ cwm-([\d+\.]+)\.tar\.gz
--- swap-cwm-1.2.1.orig/debian/pycompat
+++ swap-cwm-1.2.1/debian/pycompat
@@ -0,0 +1 @@
+2
--- swap-cwm-1.2.1.orig/debian/delta
+++ swap-cwm-1.2.1/debian/delta
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Cwm wrapper for use with help2man
+
+basename="$(basename "$0")"
+basedir="$(dirname "$0")"
+
+export PYTHONPATH="$basedir/.."
+
+case "$1" in
+    --version)
+	python "$basedir/../swap/$basename.py" --revision 2>&1 | grep \$Id: | sed "s/.*,v *//; s/ .*//"
+	;;
+    --description)
+	echo "find differences between two RDF graphs"
+	;;
+    --help)
+	python "$basedir/../swap/$basename.py" "$@" 2>&1
+	;;
+    *)
+	python "$basedir/../swap/$basename.py" "$@"
+	;;
+esac
--- swap-cwm-1.2.1.orig/debian/compat
+++ swap-cwm-1.2.1/debian/compat
@@ -0,0 +1 @@
+6
--- swap-cwm-1.2.1.orig/debian/cant
+++ swap-cwm-1.2.1/debian/cant
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Cwm wrapper for use with help2man
+
+basename="$(basename "$0")"
+basedir="$(dirname "$0")"
+
+export PYTHONPATH="$basedir/.."
+
+case "$1" in
+    --version)
+	python "$basedir/../swap/$basename.py" --revision 2>&1 | grep \$Id: | sed "s/.*,v *//; s/ .*//"
+	;;
+    --description)
+	echo "CAnonicalize N-Triples"
+	;;
+    *)
+	python "$basedir/../swap/$basename.py" "$@"
+	;;
+esac
--- swap-cwm-1.2.1.orig/debian/README.source
+++ swap-cwm-1.2.1/debian/README.source
@@ -0,0 +1,52 @@
+Building this package for Debian
+--------------------------------
+
+This source package uses quilt to apply and remove its patches.  Please
+refer to /usr/share/doc/quilt/README.source for information about how to
+use quilt for source packages.
+
+
+Developing this package for Debian
+----------------------------------
+
+The source of this package is developed using git and the helper tool
+git-buildpackage, with all official releases tagged and signed and
+binary diffs of tarballs stored using pristine-tar.  This is documented
+below /usr/share/doc/git-buildpackage/manual-html/ .
+
+A custom build target shows current upstream and packaging versions:
+
+    debian/rules print-version
+
+Current upstream tarball can be prepared using this other build target:
+
+    debian/rules get-orig-source
+
+To switch to newer upstream source, first add a dummy changelog entry
+and comment out DEB_UPSTREAM_TARBALL_MD5 before getting the source:
+
+    dch -v ${new_upstream_version}-1 "Dummy changelog entry"
+    sed -i -e 's/^\(DEB_UPSTREAM_TARBALL_MD5\b\)/#\1/' debian/rules
+    debian/rules get-orig-source
+
+Store new md5sum to help ensure identical source is received later.
+
+Setting DEB_MAINTAINER_MODE=1 enables additional build routines helpful
+during development of the package, but unfit for normal builds.  This
+typically includes the CDBS feature of auto-updating debian/control with
+CDBS-related build-dependencies, which is forbidden by Debian Policy as
+build environment must not change during automated builds.
+
+
+Maintaining packaging build routines
+------------------------------------
+
+This source package wraps debhelper commands and other tedious parts of
+the build routines using the CDBS framework.  Please refer to the actual
+makefile snippets included from debian/rules for details on their
+purpose and ways to override defaults.  Additionally, makefile snippets
+included from below /usr/share/cdbs may also be documented in
+/usr/share/doc/cdbs/cdbs-doc.pdf.gz .
+
+
+ -- Jonas Smedegaard <dr@jones.dk>  Thu, 26 Feb 2009 21:28:29 +0100
--- swap-cwm-1.2.1.orig/debian/patches/series
+++ swap-cwm-1.2.1/debian/patches/series
@@ -0,0 +1 @@
+1001_cwm_fix_spelling.patch
--- swap-cwm-1.2.1.orig/debian/patches/README
+++ swap-cwm-1.2.1/debian/patches/README
@@ -0,0 +1,3 @@
+0xxx: Grabbed from upstream development.
+1xxx: Possibly relevant for upstream adoption.
+2xxx: Only relevant for official Debian release.
--- swap-cwm-1.2.1.orig/debian/patches/1001_cwm_fix_spelling.patch
+++ swap-cwm-1.2.1/debian/patches/1001_cwm_fix_spelling.patch
@@ -0,0 +1,256 @@
+diff --git a/cwm b/cwm
+--- a/cwm
++++ b/cwm
+@@ -80,7 +80,7 @@ options:
+ 
+ steps, in order left to right:
+ 
+---rdf         Input & Output ** in RDF/XML insead of n3 from now on
++--rdf         Input & Output ** in RDF/XML instead of n3 from now on
+ --n3          Input & Output in N3 from now on. (Default)
+ --rdf=flags   Input & Output ** in RDF and set given RDF flags
+ --n3=flags    Input & Output in N3 and set N3 flags
+@@ -91,7 +91,7 @@ steps, in order left to right:
+ --bySubject   Store input and regurgitate in subject order *
+ --no          No output *
+               (default is to store and pretty print with anonymous nodes) *
+---base=<uri>  Set the base URI. Input or output is done as though theis were the document URI.
++--base=<uri>  Set the base URI. Input or output is done as though this were the document URI.
+ --closure=flags  Control automatic lookup of identifiers (see below)
+ <uri>         Load document. URI may be relative to current directory.
+ 
+@@ -133,16 +133,16 @@ Examples:
+   cwm foo.n3 bar.n3 --think         Combine data and find all deductions
+   cwm foo.n3 --flat --n3=spart
+ 
+-Mode flags affect inference extedning to the web:
++Mode flags affect inference extending to the web:
+  r   Needed to enable any remote stuff.
+  a   When reading schema, also load rules pointed to by schema (requires r, s)
+  E   Errors loading schemas of definitive documents are ignored
+- m   Schemas and definitive documents laoded are merged into the meta knowledge
++ m   Schemas and definitive documents loaded are merged into the meta knowledge
+      (otherwise they are consulted independently)
+  s   Read the schema for any predicate in a query.
+  u   Generate unique ids using a run-specific
+ 
+-Closure flags are set to cause the working formula to be automatically exapnded to
++Closure flags are set to cause the working formula to be automatically expanded to
+ the closure under the operation of looking up:
+ 
+  s   the subject of a statement added
+@@ -158,7 +158,7 @@ the closure under the operation of looking up:
+ 
+ See http://www.w3.org/2000/10/swap/doc/cwm  for more documentation.
+ 
+-Setting the environment variable CWM_RDFLIB to 1 maked Cwm use rdflib to parse
++Setting the environment variable CWM_RDFLIB to 1 makes Cwm use rdflib to parse
+ rdf/xml files. Note that this requires rdflib.
+ """
+         
+diff --git a/swap/cwm.py b/swap/cwm.py
+--- a/swap/cwm.py
++++ b/swap/cwm.py
+@@ -80,7 +80,7 @@ options:
+ 
+ steps, in order left to right:
+ 
+---rdf         Input & Output ** in RDF/XML insead of n3 from now on
++--rdf         Input & Output ** in RDF/XML instead of n3 from now on
+ --n3          Input & Output in N3 from now on. (Default)
+ --rdf=flags   Input & Output ** in RDF and set given RDF flags
+ --n3=flags    Input & Output in N3 and set N3 flags
+@@ -91,7 +91,7 @@ steps, in order left to right:
+ --bySubject   Store input and regurgitate in subject order *
+ --no          No output *
+               (default is to store and pretty print with anonymous nodes) *
+---base=<uri>  Set the base URI. Input or output is done as though theis were the document URI.
++--base=<uri>  Set the base URI. Input or output is done as though this were the document URI.
+ --closure=flags  Control automatic lookup of identifiers (see below)
+ <uri>         Load document. URI may be relative to current directory.
+ 
+@@ -133,16 +133,16 @@ Examples:
+   cwm foo.n3 bar.n3 --think         Combine data and find all deductions
+   cwm foo.n3 --flat --n3=spart
+ 
+-Mode flags affect inference extedning to the web:
++Mode flags affect inference extending to the web:
+  r   Needed to enable any remote stuff.
+  a   When reading schema, also load rules pointed to by schema (requires r, s)
+  E   Errors loading schemas of definitive documents are ignored
+- m   Schemas and definitive documents laoded are merged into the meta knowledge
++ m   Schemas and definitive documents loaded are merged into the meta knowledge
+      (otherwise they are consulted independently)
+  s   Read the schema for any predicate in a query.
+  u   Generate unique ids using a run-specific
+ 
+-Closure flags are set to cause the working formula to be automatically exapnded to
++Closure flags are set to cause the working formula to be automatically expanded to
+ the closure under the operation of looking up:
+ 
+  s   the subject of a statement added
+@@ -158,7 +158,7 @@ the closure under the operation of looking up:
+ 
+ See http://www.w3.org/2000/10/swap/doc/cwm  for more documentation.
+ 
+-Setting the environment variable CWM_RDFLIB to 1 maked Cwm use rdflib to parse
++Setting the environment variable CWM_RDFLIB to 1 makes Cwm use rdflib to parse
+ rdf/xml files. Note that this requires rdflib.
+ """
+         
+diff --git a/swap/notation3.py b/swap/notation3.py
+--- a/swap/notation3.py
++++ b/swap/notation3.py
+@@ -3,7 +3,7 @@
+ $Id: notation3.py,v 1.200 2007/12/11 21:18:08 syosi Exp $
+ 
+ 
+-This module implements a Nptation3 parser, and the final
++This module implements a Notation3 parser, and the final
+ part of a notation3 serializer.
+ 
+ See also:
+@@ -11,7 +11,7 @@ See also:
+ Notation 3
+ http://www.w3.org/DesignIssues/Notation3
+ 
+-Closed World Machine - and RDF Processor
++Closed World Machine - an RDF Processor
+ http://www.w3.org/2000/10/swap/cwm
+ 
+ To DO: See also "@@" in comments
+@@ -19,10 +19,10 @@ To DO: See also "@@" in comments
+ - Clean up interfaces
+ ______________________________________________
+ 
+-Module originally by Dan Connolly, includeing notation3
++Module originally by Dan Connolly, including notation3
+ parser and RDF generator. TimBL added RDF stream model
+ and N3 generation, replaced stream model with use
+-of common store/formula API.  Yosi Scharf developped
++of common store/formula API.  Yosi Scharf developed
+ the module, including tests and test harness.
+ 
+ """
+@@ -774,7 +774,7 @@ class SinkParser:
+ 
+         Note that the RDF convention of directly concatenating
+         NS and local name is now used though I prefer inserting a '#'
+-        to make the namesapces look more like what XML folks expect.
++        to make the namespaces look more like what XML folks expect.
+         """
+         qn = []
+         j = self.qname(str, i, qn)
+@@ -1232,14 +1232,14 @@ p   Prefix suppression - don't use them, always URIs in <> instead of qnames.
+ q   Quiet - don't output comments about version and base URI used.
+ r   Relative URI suppression. Always use absolute URIs.
+ s   Subject must be explicit for every statement. Don't use ";" shorthand.
+-t   "this" and "()" special syntax should be suppresed.
++t   "this" and "()" special syntax should be suppressed.
+ u   Use \u for unicode escaping in URIs instead of utf-8 %XX
+ v   Use  "this log:forAll" for @forAll, and "this log:forAll" for "@forSome".
+ /   If namespace has no # in it, assume it ends at the last slash if outputting.
+ 
+ Flags for N3 input:
+ 
+-B   Turn any blank node into a existentially qualified explicitly named node.
++B   Turn any blank node into an existentially qualified explicitly named node.
+ """
+ # "
+ 
+@@ -1248,8 +1248,8 @@ B   Turn any blank node into a existentially qualified explicitly named node.
+ #
+ # Within the program, the URI of a resource is kept the same, and in fact
+ # tampering with it would leave risk of all kinds of inconsistencies.
+-# Hwoever, on output, where there are URIs whose values are irrelevant,
+-# such as variables and generated IDs from anonymous ndoes, it makes the
++# However, on output, where there are URIs whose values are irrelevant,
++# such as variables and generated IDs from anonymous nodes, it makes the
+ # document very much more readable to regenerate the IDs.
+ #  We use here a convention that underscores at the start of fragment IDs
+ # are reserved for generated Ids. The caller can change that.
+diff --git a/swap/sax2rdf.py b/swap/sax2rdf.py
+--- a/swap/sax2rdf.py
++++ b/swap/sax2rdf.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/python
+ """
+-  A parser for RDF/XML built on the sax2 interface;
++  A parser for RDF/XML built on the SAX2 interface;
+   derived from a parser for RDF/XML built on the xmllib XML parser.
+ 
+   To do: Passing on namesapce bindings!
+@@ -86,8 +86,8 @@ import xml.sax # PyXML stuff
+                # and suggests TimBL try the win32 distribution from
+                # the PyXML sourceforge project
+                # http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.5.win32-py2.1.exe
+-               # TimBL points outhe does not use windows env't but cygwin and
+-               #   giuesses he should compile python2-xml for cygwin.
++               # TimBL points out he does not use windows env't but cygwin and
++               #   guesses he should compile python2-xml for cygwin.
+ import xml.sax._exceptions
+ from xml.sax.saxutils import quoteattr
+ from xml.sax.handler import feature_namespaces
+@@ -538,7 +538,7 @@ class RDFHandler(xml.sax.ContentHandler):
+                 elif name == "nodeID":
+                     assert not gotSubject
+                     if not isXML.isNCName(value):
+-                        raise  BadSyntax(sys.exc_info(), 'A nodeID must be a NCName %s' % value)
++                        raise  BadSyntax(sys.exc_info(), 'A nodeID must be an NCName %s' % value)
+                     obj = self._nodeIDs.get(value, None)
+                     if obj == None:
+                         obj = self.newBlankNode()
+@@ -871,19 +871,19 @@ class RDFHandler(xml.sax.ContentHandler):
+ 
+ 
+ class RDFXMLParser(RDFHandler):
+-    """XML/RDF parser based on sax XML interface"""
++    """XML/RDF parser based on SAX XML interface"""
+ 
+     flagDocumentation = """
+     Flags to control RDF/XML INPUT (after --rdf=) follow:
+         S  - Strict spec. Unknown parse type treated as Literal instead of error.
+         T  - take foreign XML as transparent and parse any RDF in it
+-             (default it is to ignore unless rdf:RDF at top level)
++             (default is to ignore unless rdf:RDF at top level)
+         L  - If non-rdf attributes have no namespace prefix, assume in local <#> namespace
+-        D  - Assume default namespace decalred as local document is assume xmlns=""
++        D  - Assume default namespace declared as local document is assume xmlns=""
+         R  -  Do not require an outer <rdf:RDF>, treating the file as RDF content (opposite of T)
+ 
+     Note: The parser (sax2rdf) does not support reification, bagIds, or parseType=Literal.
+-          It does support the rest of RDF inc. datatypes, xml:lang, and nodeIds.
++          It does support the rest of RDF incl. datatypes, xml:lang, and nodeIds.
+ 
+ """
+ 
+@@ -924,7 +924,7 @@ class RDFXMLParser(RDFHandler):
+ 
+ 
+ class XMLDOMParser(RDFXMLParser):
+-    """XML format to RDF Graph parser based on sax XML interface"""
++    """XML format to RDF Graph parser based on SAX XML interface"""
+ 
+ 
+     def __init__(self,   thisDoc=None,  flags="", why=None):
+diff --git a/swap/toXML.py b/swap/toXML.py
+--- a/swap/toXML.py
++++ b/swap/toXML.py
+@@ -6,7 +6,7 @@ $Id: toXML.py,v 1.41 2007/10/15 14:55:55 syosi Exp $
+ This module implements basic sources and sinks for RDF data.
+ It defines a stream interface for such data.
+ It has a command line interface, can work as a web query engine,
+-and has built in test(), all of which demosntrate how it is used.
++and has built in test(), all of which demonstrate how it is used.
+ 
+ To make a new RDF processor, subclass RDFSink.
+ 
+@@ -20,7 +20,7 @@ http;//www.w3.org/2000/10/swap/cwm
+ 
+ To DO: See also "@@" in comments
+ 
+-Internationlization:
++Internationalization:
+ - Decode incoming N3 file as unicode
+ - Encode outgoing file
+ - unicode \u  (??) escapes in parse
--- swap-cwm-1.2.1.orig/debian/cdbs/1/rules/upstream-tarball.mk
+++ swap-cwm-1.2.1/debian/cdbs/1/rules/upstream-tarball.mk
@@ -0,0 +1,137 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2007-2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Convenience rules for dealing with upstream tarballs
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+
+ifndef _cdbs_rules_upstream_tarball
+_cdbs_rules_upstream_tarball := 1
+
+include $(_cdbs_rules_path)/buildvars.mk$(_cdbs_makefile_suffix)
+
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), cdbs (>= 0.4.39)
+
+# Prefix for upstream location of all upstream tarballs (mandatory!)
+#DEB_UPSTREAM_URL = 
+
+DEB_UPSTREAM_PACKAGE = $(DEB_SOURCE_PACKAGE)
+DEB_UPSTREAM_TARBALL_VERSION = $(if $(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE)),$(DEB_UPSTREAM_VERSION:$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG)=),$(DEB_UPSTREAM_VERSION))
+DEB_UPSTREAM_TARBALL_EXTENSION = tar.gz
+# Checksum to ensure integrity of downloadeds using get-orig-source (optional)
+#DEB_UPSTREAM_TARBALL_MD5 = 
+
+DEB_UPSTREAM_WORKDIR = ../tarballs
+
+# Base filename (without extension) as used in upstream URL
+DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_PACKAGE)-$(DEB_UPSTREAM_TARBALL_VERSION)
+
+# Perl regexp to change locally used string into that in upstream URL and srcdir
+#DEB_UPSTREAM_TARBALL_BASENAME_MANGLE =
+
+# Base directory within tarball
+DEB_UPSTREAM_TARBALL_SRCDIR = $(cdbs_upstream_tarball_basename)
+
+# Space-delimited list of directories and files to strip (optional)
+#DEB_UPSTREAM_REPACKAGE_EXCLUDE = CVS .cvsignore doc/rfc*.txt doc/draft*.txt
+DEB_UPSTREAM_REPACKAGE_TAG = dfsg
+DEB_UPSTREAM_REPACKAGE_DELIMITER = ~
+
+cdbs_upstream_tarball_basename = $(if $(strip $(DEB_UPSTREAM_TARBALL_BASENAME_MANGLE)),$(shell echo '$(DEB_UPSTREAM_TARBALL_BASENAME)' | perl -pe '$(DEB_UPSTREAM_TARBALL_BASENAME_MANGLE)'),$(DEB_UPSTREAM_TARBALL_BASENAME))
+cdbs_upstream_tarball = $(cdbs_upstream_tarball_basename).$(DEB_UPSTREAM_TARBALL_EXTENSION)
+cdbs_upstream_received_tarball = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION).orig.$(if $(findstring $(DEB_UPSTREAM_TARBALL_EXTENSION),tgz),tar.gz,$(DEB_UPSTREAM_TARBALL_EXTENSION))
+cdbs_upstream_local_basename = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION)$(if $(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE)),$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG))
+cdbs_upstream_local_srcdir = $(cdbs_upstream_tarball_basename)$(if $(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE)),$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG))
+
+# # These variables are deprecated
+_cdbs_deprecated_vars += DEB_UPSTREAM_TARBALL DEB_UPSTREAM_LOCAL_TARBALL DEB_UPSTREAM_REPACKAGE_TARBALL DEB_UPSTREAM_TARBALL_VERSION_MANGLE
+_cdbs_deprecated_vars += DEB_UPSTREAM_REPACKAGE_EXCLUDES
+DEB_UPSTREAM_REPACKAGE_EXCLUDE += $(DEB_UPSTREAM_REPACKAGE_EXCLUDES)
+
+print-version:
+	@@echo "Debian version:          $(DEB_VERSION)"
+	@@echo "Upstream version:        $(DEB_UPSTREAM_TARBALL_VERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@mkdir -p "$(DEB_UPSTREAM_WORKDIR)"
+
+	@if [ ! -s "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ] ; then \
+		if [ -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ] ; then \
+			rm "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ; \
+		fi ; \
+		echo "Downloading $(cdbs_upstream_received_tarball) from $(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball) ..." ; \
+		wget -nv -T10 -t3 -O "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" "$(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball)" ; \
+	else \
+		echo "Upstream source tarball have been already downloaded: $(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ; \
+	fi
+
+	@md5current=`md5sum "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" | sed -e 's/ .*//'`; \
+	if [ -n "$(DEB_UPSTREAM_TARBALL_MD5)" ] ; then \
+		if [ "$$md5current" != "$(DEB_UPSTREAM_TARBALL_MD5)" ] ; then \
+			echo "Expecting upstream tarball md5sum $(DEB_UPSTREAM_TARBALL_MD5), but $$md5current found" ; \
+			echo "Upstream tarball md5sum is NOT trusted! Possible upstream tarball forge!" ; \
+			echo "Purging downloaded file. Try new download." ; \
+			rm -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ; \
+			false ; \
+		else \
+			echo "Upstream tarball is trusted!" ; \
+		fi; \
+	else \
+		echo "Upstream tarball NOT trusted (current md5sum is $$md5current)!" ; \
+	fi
+
+# TODO: Rewrite using make variables like cdbs_upstream_unpack_cmd and
+# DEB_UPSTREAM_SUPPORTED_COMPRESSIONS (recent dpkg supports bz2)
+# TODO: Add .orig suffix to top folder inside tarball when only
+# recompressing (when $uncompress set and ...REPACKAGE_EXCLUDE unset)
+	@untar="tar -x -C"; \
+	case "$(cdbs_upstream_received_tarball)" in \
+	    *.tar.gz)  unpack="gunzip -c";; \
+	    *.tar.bz2) unpack="bunzip2 -c";    uncompress="bunzip2";; \
+	    *.tar.Z)   unpack="uncompress -c"; uncompress="uncompress";; \
+	    *.zip)     unpack="unzip -q";      uncompress="false";       untar="-d"; nopipe="true";; \
+	    *.tar)     unpack="cat";           uncompress="true";; \
+	    *) echo "Unknown extension for upstream tarball $(cdbs_upstream_received_tarball)"; false;; \
+	esac && \
+	if [ -n "$(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE))" ] || [ "$$uncompress" = "false" ]; then \
+		echo "Repackaging tarball ..." && \
+		mkdir -p "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" && \
+		if [ -n "$$nopipe" ]; then \
+			$$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" \
+				$$untar "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" $(patsubst %,--exclude='%',$(DEB_UPSTREAM_REPACKAGE_EXCLUDE)); \
+		else \
+			$$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" \
+				| $$untar "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" $(patsubst %,--exclude='%',$(DEB_UPSTREAM_REPACKAGE_EXCLUDE)); \
+		fi && \
+		if [ "$(DEB_UPSTREAM_TARBALL_SRCDIR)" != "$(cdbs_upstream_local_srcdir)" ]; then \
+			mv -T "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(DEB_UPSTREAM_TARBALL_SRCDIR)" "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(cdbs_upstream_local_srcdir)"; \
+		fi && \
+		GZIP=-9 tar -b1 -czf "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_basename).orig.tar.gz" -C "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" "$(cdbs_upstream_local_srcdir)" && \
+		echo "Cleaning up" && \
+		rm -rf "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)"; \
+	elif [ -n "$$uncompress" ]; then \
+		echo "Recompressing tarball ..." && \
+		$$uncompress "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)"; \
+		gzip -9 "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_basename).orig.tar"; \
+	fi
+
+DEB_PHONY_RULES += print-version get-orig-source
+
+endif
--- swap-cwm-1.2.1.orig/debian/cdbs/1/rules/copyright-check.mk
+++ swap-cwm-1.2.1/debian/cdbs/1/rules/copyright-check.mk
@@ -0,0 +1,113 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2005-2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Check for changes to copyright notices in source
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+
+ifndef _cdbs_rules_copyright_check
+_cdbs_rules_copyright_check := 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), devscripts (>= 2.10.7)
+
+# Set to yes to fail on changed/new hints are found
+#DEB_COPYRIGHT_CHECK_STRICT := yes
+
+# Single regular expression for files to include or ignore
+DEB_COPYRIGHT_CHECK_REGEX = .*
+#DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(debian/.*|(.*/)?config\.(guess|sub|rpath)(\..*)?)$
+DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^debian/(changelog|copyright(|_hints|_newhints))$
+
+pre-build:: debian/stamp-copyright-check
+
+debian/stamp-copyright-check:
+	@echo 'Scanning upstream source for new/changed copyright notices...'
+	@echo licensecheck -c '$(DEB_COPYRIGHT_CHECK_REGEX)' -r --copyright -i '$(DEB_COPYRIGHT_CHECK_IGNORE_REGEX)' * \
+		"| some-output-filtering..."
+
+# Perl in shell in make requires extra care:
+#  * Single-quoting ('...') protects against shell expansion
+#  * Double-dollar ($$) expands to plain dollar ($) in make
+	@licensecheck -c '$(DEB_COPYRIGHT_CHECK_REGEX)' -r --copyright -i '$(DEB_COPYRIGHT_CHECK_IGNORE_REGEX)' * \
+		| LC_ALL=C perl -e \
+	'print "Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=XXX\n";'\
+	'print "Upstream-Name: Untrusted draft - double-check copyrights yourself!\n\n";'\
+	'$$n=0; while (<>) {'\
+	'	s/[^[:print:]]//g;'\
+	'	if (/^([^:\s][^:]+):[\s]+(\S.*?)\s*$$/) {'\
+	'		$$files[$$n]{name}=$$1;'\
+	'		$$files[$$n]{license}=$$2;'\
+	'	};'\
+	'	if (/^\s*\[Copyright:\s*(\S.*?)\s*\]/) {'\
+	'		$$files[$$n]{copyright}=$$1;'\
+	'	};'\
+	'	/^$$/ and $$n++;'\
+	'};'\
+	'foreach $$file (@files) {'\
+	'	$$file->{license} =~ s/\s*\(with incorrect FSF address\)//;'\
+	'	$$file->{license} =~ s/\s+\(v([^)]+) or later\)/-$$1+/;'\
+	'	$$file->{license} =~ s/\s+\(v([^)]+)\)/-$$1/;'\
+	'	$$file->{license} =~ s/\s*(\*No copyright\*)\s*// and $$file->{copyright} = $$1;'\
+	'	$$file->{license} =~ s/^\s*(GENERATED FILE)/UNKNOWN ($$1)/;'\
+	'	$$file->{license} =~ s/\s+(GENERATED FILE)/ ($$1)/;'\
+	'	$$file->{copyright} =~ s/(?<=(\b\d{4}))(?{$$y=$$^N})\s*[,-]\s*((??{$$y+1}))\b/-$$2/g;'\
+	'	$$file->{copyright} =~ s/(?<=\b\d{4})\s*-\s*\d{4}(?=\s*-\s*(\d{4})\b)//g;'\
+	'	$$file->{copyright} =~ s/\b(\d{4})\s+([\S^\d])/$$1, $$2/g;'\
+	'	$$file->{copyright} =~ s/^\W*\s+\/\s+//g;'\
+	'	$$file->{copyright} =~ s/\s+\/\s+\W*$$//;'\
+	'	$$file->{copyright} =~ s/\s+\/\s+/\n\t/g;'\
+	'	$$pattern = "$$file->{license} [$$file->{copyright}]";'\
+	'	push @{ $$patternfiles{"$$pattern"} }, $$file->{name};'\
+	'};'\
+	'foreach $$pattern ( sort {'\
+	'			@{$$patternfiles{$$b}} <=> @{$$patternfiles{$$a}}'\
+	'			||'\
+	'			$$a cmp $$b'\
+	'		} keys %patternfiles ) {'\
+	'	($$license, $$copyright) = $$pattern =~ /(.*) \[(.*)\]/s;'\
+	'	print "Files: ", join("\n\t", sort @{ $$patternfiles{$$pattern} }), "\n";'\
+	'	print "Copyright: $$copyright\n";'\
+	'	print "License: $$license\n\n";'\
+	'};'\
+		> debian/copyright_newhints
+	@patterncount="`cat debian/copyright_newhints | sed 's/^[^:]*://' | LANG=C sort -u | grep . -c -`"; \
+		echo "Found $$patterncount different copyright and licensing combinations."
+	@if [ ! -f debian/copyright_hints ]; then touch debian/copyright_hints; fi
+	@newstrings=`diff -u debian/copyright_hints debian/copyright_newhints | sed '1,2d' | egrep '^\+' - | sed 's/^\+//'`; \
+		if [ -n "$$newstrings" ]; then \
+			echo "$(if $(DEB_COPYRIGHT_CHECK_STRICT),ERROR,WARNING): The following new or changed copyright notices discovered:"; \
+			echo; \
+			echo "$$newstrings"; \
+			echo; \
+			echo "To fix the situation please do the following:"; \
+			echo "  1) Investigate the above changes and update debian/copyright as needed"; \
+			echo "  2) Replace debian/copyright_hints with debian/copyright_newhints"; \
+			$(if $(DEB_COPYRIGHT_CHECK_STRICT),exit 1,:); \
+		else \
+			echo 'No new copyright notices found - assuming no news is good news...'; \
+			rm -f debian/copyright_newhints; \
+		fi
+	touch $@
+
+clean::
+	rm -f debian/stamp-copyright-check
+
+endif
--- swap-cwm-1.2.1.orig/debian/cdbs/1/rules/package-relations.mk
+++ swap-cwm-1.2.1/debian/cdbs/1/rules/package-relations.mk
@@ -0,0 +1,76 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Resolve, cleanup and apply package relationships
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+
+ifndef _cdbs_rules_package_relations
+_cdbs_rules_package_relations = 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+# Merge build-dependencies on same packages
+# TODO: rewrite (in perl, probably) to be more generic
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bcdbs (>= 0.4.43)/ s/ *,* *\bcdbs (>= \(0.4.23-1.1\|0.4.27\|0.4.39\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bcdbs (>= 0.4.39)/ s/ *,* *\bcdbs (>= \(0.4.23-1.1\|0.4.27\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bcdbs (>= 0.4.27)/ s/ *,* *\bcdbs (>= \(0.4.23-1.1\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 7.0.1)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\|4.2.21\|4.2.28\|5\|5.0.37.2\|5.0.44\|7.0.1\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 6)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\|4.2.21\|4.2.28\|5\|5.0.37.2\|5.0.44\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 5.0.44)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\|4.2.21\|4.2.28\|5\|5.0.37.2\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 5.0.37.2)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\|4.2.21\|4.2.28\|5\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 5)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\|4.2.21\|4.2.28\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 4.2.28)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\|4.2.21\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 4.2.21)/ s/ *,* *\bdebhelper (>= \(4.1.60\|4.2.0\)) *,* */, /g')
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e '/\bdebhelper (>= 4.2.0)/ s/ *,* *\bdebhelper (>= \(4.1.60\)) *,* */, /g')
+
+# Cleanup superfluous commas
+CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//')
+
+# Apply CDBS-declared dependencies to binary packages
+$(patsubst %,binary-predeb/%,$(DEB_PACKAGES)) :: binary-predeb/%:
+	echo 'cdbs:Depends=$(CDBS_DEPENDS_ALL), $(or $(CDBS_DEPENDS_$(cdbs_curpkg)),$(CDBS_DEPENDS))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Pre-Depends=$(CDBS_PREDEPENDS_ALL), $(or $(CDBS_PREDEPENDS_$(cdbs_curpkg)),$(CDBS_PREDEPENDS))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Recommends=$(CDBS_RECOMMENDS_ALL), $(or $(CDBS_RECOMMENDS_$(cdbs_curpkg)),$(CDBS_RECOMMENDS))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Suggests=$(CDBS_SUGGESTS_ALL), $(or $(CDBS_SUGGESTS_$(cdbs_curpkg)),$(CDBS_SUGGESTS))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Breaks=$(CDBS_BREAKS_ALL), $(or $(CDBS_BREAKS_$(cdbs_curpkg)),$(CDBS_BREAKS))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Provides=$(CDBS_PROVIDES_ALL), $(or $(CDBS_PROVIDES_$(cdbs_curpkg)),$(CDBS_PROVIDES))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Replaces=$(CDBS_REPLACES_ALL), $(or $(CDBS_REPLACES_$(cdbs_curpkg)),$(CDBS_REPLACES))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Conflicts=$(CDBS_CONFLICTS_ALL), $(or $(CDBS_CONFLICTS_$(cdbs_curpkg)),$(CDBS_CONFLICTS))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+	echo 'cdbs:Enhances=$(CDBS_ENHANCES_ALL), $(or $(CDBS_ENHANCES_$(cdbs_curpkg)),$(CDBS_ENHANCES))' \
+	  | sed -e 's/ *,/,/g' -e 's/^ *, *//' -e 's/ *, *$$//' \
+	  >> debian/$(cdbs_curpkg).substvars
+
+endif
--- swap-cwm-1.2.1.orig/debian/cdbs/1/rules/buildinfo.mk
+++ swap-cwm-1.2.1/debian/cdbs/1/rules/buildinfo.mk
@@ -0,0 +1,40 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2004-2007 Jonas Smedegaard <dr@jones.dk>
+# Description: Generate and include build information
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+
+ifndef _cdbs_rules_buildinfo
+_cdbs_rules_buildinfo = 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), dh-buildinfo
+
+common-install-arch common-install-indep:: debian/stamp-buildinfo
+
+debian/stamp-buildinfo:
+	dh_buildinfo
+	touch debian/stamp-buildinfo
+
+clean::
+	rm -f debian/stamp-buildinfo
+
+endif
--- swap-cwm-1.2.1.orig/debian/cdbs/1/class/python-distutils.mk
+++ swap-cwm-1.2.1/debian/cdbs/1/class/python-distutils.mk
@@ -0,0 +1,297 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2003 Colin Walters <walters@debian.org>
+# Copyright © 2006 Marc Dequènes (Duck) <Duck@DuckCorp.org>
+# Copyright © 2003,2006-2008 Jonas Smedegaard <dr@jones.dk>
+# Description: manage Python modules using the 'distutils' build system
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02111-1307 USA.
+#
+
+# This class provides rules for old and new Python policy.  Leaving
+# DEB_PYTHON_SYSTEM unset selects the old behavior.  The pysupport and
+# pycentral methods are available to comply with new policy.  Don't forget
+# to update your 'debian/control'.  (Build-Depends are correctly generated
+# if you are using the auto control generation feature.)
+
+
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+
+ifndef _cdbs_class_python_distutils
+_cdbs_class_python_distutils = 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
+
+
+# common variables
+DEB_PYTHON_SETUP_CMD = setup.py
+DEB_PYTHON_CLEAN_ARGS = -a
+DEB_PYTHON_BUILD_ARGS = --build-base="$(CURDIR)/$(DEB_BUILDDIR)/build"
+DEB_PYTHON_INSTALL_ARGS_ALL = --no-compile -O0
+
+# We always install into target package, unlike DEB_DESTDIR
+ifndef DEB_PYTHON_SYSTEM
+DEB_PYTHON_DESTDIR = $(CURDIR)/debian/$(cdbs_curpkg)
+else
+# Arrrrgh - except for new python policy that broke the promise! :-(
+DEB_PYTHON_DESTDIR = $(DEB_DESTDIR)
+endif
+
+
+ifndef DEB_PYTHON_SYSTEM
+########################### old policy method ###########################
+
+$(warning ########################################################)
+$(warning Your package does not conform to the new Python policy.)
+$(warning Please consider updating.  Here is some documentation:)
+$(warning   http://wiki.debian.org/DebianPython/NewPolicy)
+$(warning   http://wiki.debian.org/DebianPythonFAQ)
+$(warning ########################################################)
+
+DEB_PYTHON_COMPILE_VERSION = 
+DEB_PYTHON_VERSIONS = 2.1 2.2 2.3 2.4 2.5
+
+cdbs_python_current_version := $(shell /usr/bin/python -V 2>&1 | sed 's/^[^0-9]*\([0-9]\+.[0-9]\+\)[^0-9].*/\1/')
+cdbs_python_next_version := $(shell expr '$(cdbs_python_current_version)' : '[^0-9]*\([0-9]\+\).').$(shell expr '(' '$(cdbs_python_current_version)' : '[^0-9]*[0-9]\+.\([0-9]\+\)' ')' + 1)
+
+# This variable is deprecated.
+DEB_PYTHON_REAL_LIB_PACKAGES = $(strip $(filter $(patsubst %,python%%,$(DEB_PYTHON_VERSIONS)),$(filter-out $(DEB_PYTHON_PACKAGES_EXCLUDE),$(DEB_ALL_PACKAGES))))
+_cdbs_deprecated_vars += DEB_PYTHON_REAL_LIB_PACKAGES
+_cdbs_deprecated_DEB_PYTHON_REAL_LIB_PACKAGES_default := $(DEB_PYTHON_REAL_LIB_PACKAGES)
+# New in 0.x.y.
+DEB_PYTHON_MODULE_PACKAGES = $(DEB_PYTHON_REAL_LIB_PACKAGES)
+
+DEB_PYTHON_MODULE_ARCH_PACKAGES = $(filter $(DEB_PYTHON_MODULE_PACKAGES), $(DEB_ARCH_PACKAGES))
+DEB_PYTHON_MODULE_INDEP_PACKAGES = $(filter $(DEB_PYTHON_MODULE_PACKAGES), $(DEB_INDEP_PACKAGES))
+
+# If no versioned python library packages found, grab all simpler ones
+ifeq (,$(DEB_PYTHON_MODULE_ARCH_PACKAGES))
+# This variable is deprecated.
+DEB_PYTHON_SIMPLE_PACKAGES = $(strip $(filter python-%,$(filter-out $(DEB_PYTHON_PACKAGES_EXCLUDE),$(DEB_ALL_PACKAGES))))
+_cdbs_deprecated_vars += DEB_PYTHON_SIMPLE_PACKAGES
+_cdbs_deprecated_DEB_PYTHON_SIMPLE_PACKAGES_default := $(DEB_PYTHON_SIMPLE_PACKAGES)
+# New in 0.x.y.
+DEB_PYTHON_MODULE_PACKAGES = $(DEB_PYTHON_SIMPLE_PACKAGES)
+endif
+
+ifeq (,$(DEB_PYTHON_MODULE_ARCH_PACKAGES))
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-dev (>= $(cdbs_python_current_version)), python-dev (<< $(cdbs_python_next_version))
+else
+cdbs_python_build_versions := $(filter-out -%,$(subst -, -,$(patsubst python%,%,$(DEB_PYTHON_MODULE_ARCH_PACKAGES))))
+comma := ,
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), $(patsubst %,python%-dev$(comma),$(cdbs_python_build_versions)) python
+endif
+
+cdbs_python_compile_version = $(DEB_PYTHON_COMPILE_VERSION)
+cdbs_python_curpkg_build_versions = $(filter-out -%,$(subst -, -,$(patsubst python%,%,$(cdbs_curpkg))))
+
+# This class can optionally utilize debhelper's "dh_python" command.  Just
+# be sure you include debhelper.mk before including this file.
+ifdef _cdbs_rules_debhelper
+ifneq (,$(strip $(filter 2.4,$(cdbs_python_build_versions))))
+# Python 2.4 support
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), debhelper (>= 4.2.28)
+else
+# Python 2.3 support
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), debhelper (>= 4.1.60)
+endif
+
+DEB_DH_PYTHON_ARGS = $(addprefix -V ,$(cdbs_python_compile_version)) $(DEB_DH_PYTHON_ARGS_ALL) $(DEB_DH_PYTHON_ARGS_$(cdbs_curpkg))
+endif
+
+
+else
+########################## new policy methods ###########################
+
+# This variable is deprecated.
+DEB_PYTHON_MODULE_PACKAGE = $(firstword $(filter-out %-doc %-dev %-common, $(DEB_PACKAGES)))
+_cdbs_deprecated_vars += DEB_PYTHON_MODULE_PACKAGE
+_cdbs_deprecated_DEB_PYTHON_MODULE_PACKAGE_default := $(DEB_PYTHON_MODULE_PACKAGE)
+# New in 0.x.y.
+# TODO: Use DEB_PYTHON_MODU*LE_PACKAGE but without firstword function (requires abi bump!)
+DEB_PYTHON_MODULE_PACKAGES = $(DEB_PYTHON_MODULE_PACKAGE)
+
+DEB_PYTHON_MODULE_ARCH_PACKAGES = $(filter $(DEB_PYTHON_MODULE_PACKAGES), $(DEB_ARCH_PACKAGES))
+DEB_PYTHON_MODULE_INDEP_PACKAGES = $(filter $(DEB_PYTHON_MODULE_PACKAGES), $(DEB_INDEP_PACKAGES))
+
+# This variable is deprecated
+## FIXME: Die if used together with pycentral, that does not support it!
+## FIXME: Warn if used without debhelper: is applied with dh_pysupport.
+## TODO: Check if usable also with old python policy: was added to deprecated dh_python too.
+DEB_PYTHON_PRIVATE_MODULES_DIRS =
+_cdbs_deprecated_vars += DEB_PYTHON_PRIVATE_MODULES_DIRS
+
+# check python system
+cdbs_use_xs_field := $(shell grep -q "^XS-Python-Version:" debian/control && echo yes)
+cdbs_selected_pycompat := $(shell if [ -e debian/pycompat ]; then cat debian/pycompat; fi)
+cdbs_pycompat = $(cdbs_selected_pycompat)
+ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
+  ifeq (, $(cdbs_selected_pycompat))
+    cdbs_pycompat = 2
+  endif # use pycompat
+  # warning pysupport compatibility mode
+  ifneq (, $(cdbs_use_xs_field))
+    $(warning Use of XS-Python-Version and XB-Python-Version fields in 'debian/control' is deprecated with pysupport method, use 'debian/pyversions' if you need to specify specific versions)
+  endif # use XS field (compat)
+else
+  ifeq (pycentral, $(DEB_PYTHON_SYSTEM))
+    ifeq (, $(cdbs_selected_pycompat))
+      cdbs_pycompat = 2
+    endif # use pycompat
+  else
+    ifneq (, $(DEB_PYTHON_SYSTEM))
+      $(error unsupported Python system: $(DEB_PYTHON_SYSTEM) (select either pysupport or pycentral))
+    else
+      ifneq (, $(cdbs_use_xs_field))
+        $(error Your package uses the new Python policy; you must set DEB_PYTHON_SYSTEM to "pysupport" or "pycentral".)
+      endif
+      ifneq (, $(cdbs_selected_pycompat))
+        ifeq (yes, $(shell expr $(cdbs_selected_pycompat) \> 1 >/dev/null && echo yes))
+          $(error Your package uses the new Python policy; you must set DEB_PYTHON_SYSTEM to "pysupport" or "pycentral".)
+        endif
+      endif # use pycompat
+    endif # unknown method
+  endif # pycentral
+endif # pysupport
+
+# Calculate cdbs_python_build_versions
+cdbs_python_current_version := $(shell pyversions -vd)
+ifeq (,$(DEB_PYTHON_MODULE_ARCH_PACKAGES))
+  # check if current is in build versions
+  ifneq ($(cdbs_python_current_version), $(filter $(cdbs_python_current_version), $(shell pyversions -vr)))
+    cdbs_python_compile_version := $(firstword $(strip $(sort $(shell pyversions -vr))))
+    cdbs_python_build_versions := $(cdbs_python_compile_version)
+  else
+    cdbs_python_build_versions := $(cdbs_python_current_version)
+  endif
+else
+cdbs_python_build_versions := $(shell pyversions -vr)
+endif # archall
+
+# check if build is possible
+ifeq (, $(cdbs_python_build_versions))
+ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
+$(error invalid setting in 'debian/pyversions')
+else
+$(error invalid setting for XS-Python-Version)
+endif # system selected
+endif # build versions empty
+
+
+# Declare Build-Deps for packages using this file
+# This class can optionally utilize debhelper's "dh_python" command.  Just
+# be sure you include debhelper.mk before including this file.
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), cdbs (>= 0.4.43)
+ifdef _cdbs_rules_debhelper
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), debhelper (>= 5.0.37.2)
+endif
+ifeq (,$(DEB_PYTHON_MODULE_ARCH_PACKAGES))
+  ifneq (, $(cdbs_python_compile_version))
+    CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python$(cdbs_python_compile_version)-dev, python (>= 2.3.5-11)
+  else
+    CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-dev (>= 2.3.5-11)
+  endif
+else
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-all-dev (>= 2.3.5-11)
+endif
+ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-support (>= 0.3.2)
+else
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-central (>= 0.5.6)
+endif
+
+# TODO: Support multiple python modules built for different python versions
+cdbs_python_curpkg_build_versions = $(cdbs_python_build_versions)
+
+DEB_DH_PYTHON_ARGS = $(DEB_DH_PYTHON_ARGS_ALL) $(DEB_DH_PYTHON_ARGS_$(cdbs_curpkg)) $(DEB_PYTHON_PRIVATE_MODULES_DIRS) $(DEB_PYTHON_PRIVATE_MODULES_DIRS_$(cdbs_curpkg))
+
+endif
+
+
+########################## all policy methods ###########################
+
+pre-build::
+	mkdir -p python-module-stamp
+
+
+# build stage
+$(patsubst %,build/%,$(DEB_PYTHON_MODULE_INDEP_PACKAGES) $(DEB_PYTHON_MODULE_ARCH_PACKAGES)) :: build/% : python-module-stamp/%
+
+$(patsubst %,python-module-stamp/%,$(DEB_PYTHON_MODULE_INDEP_PACKAGES)) :: python-module-stamp/%:
+	cd $(DEB_SRCDIR) && /usr/bin/python$(cdbs_python_compile_version) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
+	touch $@
+
+$(patsubst %,python-module-stamp/%,$(DEB_PYTHON_MODULE_ARCH_PACKAGES)) :: python-module-stamp/%:
+	for buildver in $(cdbs_python_curpkg_build_versions); do \
+		cd $(DEB_SRCDIR) && /usr/bin/python$$buildver $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS); \
+	done
+	touch $@
+
+
+# install stage
+$(patsubst %,install/%,$(DEB_PYTHON_MODULE_INDEP_PACKAGES)) :: install/%:
+	cd $(DEB_SRCDIR) && /usr/bin/python$(cdbs_python_compile_version) $(DEB_PYTHON_SETUP_CMD) install --root="$(DEB_PYTHON_DESTDIR)" $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
+
+$(patsubst %,install/%,$(DEB_PYTHON_MODULE_ARCH_PACKAGES)) :: install/%:
+	for buildver in $(cdbs_python_curpkg_build_versions); do \
+		cd $(DEB_SRCDIR) && /usr/bin/python$$buildver $(DEB_PYTHON_SETUP_CMD) install --root="$(DEB_PYTHON_DESTDIR)" $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg)); \
+	done
+
+
+# This class can optionally use debhelper's commands.  Just
+# be sure you include debhelper.mk before including this file.
+ifdef _cdbs_rules_debhelper
+
+$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%: binary-install-python/%
+$(patsubst %,binary-install-python/%,$(DEB_PACKAGES)) :: binary-install-python/%:
+ifdef DEB_PYTHON_SYSTEM
+ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
+	dh_pysupport -p$(cdbs_curpkg) $(DEB_PYTHON_PRIVATE_MODULES_DIRS) $(DEB_PYTHON_PRIVATE_MODULES_DIRS_$(cdbs_curpkg))
+else
+	dh_pycentral -p$(cdbs_curpkg)
+endif
+endif
+	dh_python -p$(cdbs_curpkg) $(DEB_DH_PYTHON_ARGS)
+endif
+
+
+# clean stage
+clean:: $(patsubst %,python-module-clean/%,$(DEB_PYTHON_MODULE_INDEP_PACKAGES) $(DEB_PYTHON_MODULE_ARCH_PACKAGES))
+
+$(patsubst %,python-module-clean/%,$(DEB_PYTHON_MODULE_INDEP_PACKAGES)) :: python-module-clean/%:
+	-cd $(DEB_SRCDIR) && /usr/bin/python$(cdbs_python_compile_version) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
+
+$(patsubst %,python-module-clean/%,$(DEB_PYTHON_MODULE_ARCH_PACKAGES)) :: python-module-clean/%:
+	-for buildver in $(cdbs_python_curpkg_build_versions); do \
+		cd $(DEB_SRCDIR) && /usr/bin/python$$buildver $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS); \
+	done
+
+clean::
+ifdef DEB_PYTHON_SYSTEM
+ifeq (, $(cdbs_selected_pycompat))
+	echo "$(cdbs_pycompat)" >debian/pycompat
+endif # use pycompat
+endif
+	rm -rf python-module-stamp
+
+# Calling setup.py clean may create .pyc files, so we need a final cleanup
+# pass here.
+clean::
+	find . -name '*.pyc' -exec rm '{}' ';'
+
+endif