Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/README.cdbs-tweaks111
-rw-r--r--debian/README.packaging126
-rw-r--r--debian/TODO7
-rw-r--r--debian/cdbs/1/class/autotools-vars.mk114
-rw-r--r--debian/cdbs/1/class/autotools.mk59
-rw-r--r--debian/cdbs/1/class/makefile-vars.mk64
-rw-r--r--debian/cdbs/1/class/makefile.mk79
-rw-r--r--debian/cdbs/1/class/python-autotools.mk75
-rw-r--r--debian/cdbs/1/class/python-vars.mk110
-rw-r--r--debian/cdbs/1/rules/buildinfo.mk40
-rw-r--r--debian/cdbs/1/rules/copyright-check.mk93
-rw-r--r--debian/cdbs/1/rules/upstream-tarball.mk139
-rw-r--r--debian/changelog168
-rw-r--r--debian/compat1
-rw-r--r--debian/control29
-rw-r--r--debian/control.in29
-rw-r--r--debian/copyright36
-rw-r--r--debian/copyright_hints44
-rw-r--r--debian/patches/1002_avoid_try-except-finally.patch68
-rw-r--r--debian/patches/1003_avoid_with_statement.patch96
-rw-r--r--debian/patches/1004_avoid_queue_hints.patch41
-rw-r--r--debian/patches/1005_avoid_check_call.patch24
-rw-r--r--debian/patches/README3
-rw-r--r--debian/patches/series4
-rw-r--r--debian/pycompat1
-rwxr-xr-xdebian/rules33
-rw-r--r--debian/watch3
27 files changed, 1597 insertions, 0 deletions
diff --git a/debian/README.cdbs-tweaks b/debian/README.cdbs-tweaks
new file mode 100644
index 0000000..5880b2f
--- /dev/null
+++ b/debian/README.cdbs-tweaks
@@ -0,0 +1,111 @@
+CDBS tweak
+==========
+
+CDBS is great. In some corner cases, however, some parts of CDBS
+sometimes needs a few tweaks to work optimally.
+
+This is a collection of such tweaks. The goal is for these tweaks to be
+absorbed into upstream CDBS. We just haven't found time yet to discuss
+them at the CDBS developers' mailinglist. And possible we do not all
+agree that the tweaks are so great - therefore this "staging area".
+
+If you found this file below debian/ subdir in a source package, most
+probably only a subset of the below mentioned tweaks are relevant and
+have been shipped with the package. The repository of all these tweaks
+is here: svn://svn.debian.org/build-common/people/js/overlay/
+
+Web access: http://svn.debian.org/wsvn/build-common/people/js/overlay/
+
+
+
+New buildinfo rule
+------------------
+
+See package description for "buildinfo" for more info.
+
+
+
+Improved support for multiple compilations
+------------------------------------------
+
+Create and clean builddir _after_ resolving per-package DEB_BUILDDIR.
+
+Honour per-package DEB_BUILDDIR in makefile and autotools classes.
+
+Support multiple build flavors in makefile and autotools classes.
+
+
+
+Various improvements to python-distutils class
+----------------------------------------------
+
+Use full path to Python interpreter (Python Policy section 1.3.2).
+
+Add CDBS_BUILD_DEPENDS to old policy method.
+
+Fix CDBS_BUILD_DEPENDS in new policy methods to only depend on debhelper
+when actually used.
+
+Fix DEB_PYTHON_SIMPLE_PACKAGES sometimes installed twice (and only one
+of them honouring DEB_PYTHON_COMPILE_VERSION).
+
+Unify install path using new DEB_PYTHON_DESTDIR.
+
+Quote install path.
+
+
+
+New python-autotools class
+--------------------------
+
+Handle autotools-based Python packaging.
+
+
+
+New python-sugar class
+----------------------
+
+Handle packaging of Sugar activities.
+
+
+
+New copyright-check rule
+------------------------
+
+Refuse to build if the source is found to contain different copyright
+info than earlier builds.
+
+
+
+New kernelpatches rule
+----------------------
+
+Small wrapper around dh-kpatches, taking care of build-dependencies too.
+
+
+
+New routines for handling upstream tarball
+------------------------------------------
+
+Rules and variables to help downloading, validating and repackaging
+upstream tarball.
+
+Implements the rules print-version and get-orig-source commonly used
+for group-maintained packages with Debian-specific patches maintained in
+SVN or some other VCS, and automated fetching virgin upstream tarball
+(possibly massaged after download e.g. to strip non-DFSG material).
+
+
+
+Support for custom BTS info
+---------------------------
+
+Include BTS control info found in debian/*.bts files, or alternatively
+redirect bug reports to the email address defined in DEB_BTS_EMAIL.
+
+
+
+New dict class
+--------------
+
+Rules for packaging ispell, aspell, myspell and wordlist dictionaries.
diff --git a/debian/README.packaging b/debian/README.packaging
new file mode 100644
index 0000000..c0b03a2
--- /dev/null
+++ b/debian/README.packaging
@@ -0,0 +1,126 @@
+Packaging hints
+===============
+
+This packaging is maintained with the use of Git, using the following
+branches:
+
+ upstream-git - master branch of upstream Git source
+ upstream - unpackaged upstream tarballs
+ pristine-tar - binary deltas to recreate pristine tarballs
+ master - Debian packaging
+
+With the above, we can switch between working from upstream released
+tarballs and syncing directly with upstream development, both using
+git-buildpackage (with its default branch names).
+
+
+Package sugar-base as example
+-----------------------------
+
+The rest of this document uses sugar-base as sample package, and some
+old actual version numbers from that package - replace with your actual
+package as needed...
+
+
+Getting packaging source from Git repository
+--------------------------------------------
+
+The following commands (in an empty dir) fetch and build the package:
+
+aptitude install git-buildpackage
+git clone git://git.debian.org/git/collab-maint/sugar-base
+cd sugar-base
+git fetch origin upstream:upstream
+git-buildpackage
+
+
+Merging with newer upstream Git tree
+------------------------------------
+
+The following commands (inside Git repository) updates the local mirror
+of upstream source, and merges with our packaging branch:
+
+cd sugar-base
+git checkout upstream-git
+git pull
+git fetch --tags
+git checkout master
+git pull . upstream-git
+
+The following command shows upstream changes possibly relevant to
+mention in changelog (replace "HEAD^" with a reference to actual sync
+commit if not invoked right after sync'ing):
+
+git log --pretty="format:%h %s" HEAD^..upstream-git
+
+
+Doing a package release from upstream tarball
+---------------------------------------------
+
+The following command (inside Git repository) imports a downloaded
+tarball into the "upstream" and pristine-tarball Git branches (taball
+name is recorded too and used later, so make sure to first rename the
+tarball to follow Debian naming convention {name}_{version}.orig.{ext}):
+
+git-import-orig --pristine-tar --sign-tags path/to/sugar-base_0.79.0.orig.tar.gz
+
+Check that all files are included in "upstream" branch (don't know why
+this fails sometimes):
+
+git status
+
+If some files are "untracked", then do the following to manually add
+untracked files to upstream branch and merge them with master branch
+(the stash commands puts changelog update aside and restore it again
+afterwards):
+
+git stash
+git checkout upstream
+git add *
+git commit -m "Add files mysteriously skipped by git-import-orig."
+git checkout master
+git pull . upstream
+git stash apply
+
+Comment out tarball hash in debian/control, test get-orig-source, and
+enable hash line with new hash:
+
+fakeroot debian/rules get-orig-source
+
+Adjust changelog and package, and if satisfied with the result then tag
+it, push Git sources and release the package:
+
+git-buildpackage --git-tag --git-sign-tags
+[test package...]
+git push --all
+git push --tags
+cd ..
+dput sugar-base_0.79.0-1_amd64.changes
+
+
+Doing a package release from upstream Git snapshot
+--------------------------------------------------
+
+First, look at upstream development for a good place to release, and tag
+by its date, replacing "~" with ".". Normally just tag the latest
+upstream commit, to avoid simply including later upstream work in the
+debian diff:
+
+git log --abbrev-commit upstream-git
+git tag -s -m "Tag upstream for package release." upstream/0.2.git20080130 61279f8
+
+Adjust changelog and package, and if satisfied with the result then tag
+it, push Git sources and release the package:
+
+dch -r -v "0.2~git20080130-0~0jones1" "New upstream Git snapshot."
+debcommit -r -a
+git-buildpackage
+[test package...]
+git tag -s -m "Tag package release." debian/0.2.git20080130-0.0jones1
+git push --all
+git push --tags
+cd ..
+dput sugar-base_0.2~git20080130-0~0jones1_amd64.changes
+
+
+ -- Jonas Smedegaard <dr@jones.dk> Sat, 08 Mar 2008 01:08:36 +0100
diff --git a/debian/TODO b/debian/TODO
new file mode 100644
index 0000000..6276e7d
--- /dev/null
+++ b/debian/TODO
@@ -0,0 +1,7 @@
+Pending tasks
+=============
+
+ * Use Xappy (backwards-compatible successor of secore included in
+ source)
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 09 Mar 2008 13:12:07 +0100
diff --git a/debian/cdbs/1/class/autotools-vars.mk b/debian/cdbs/1/class/autotools-vars.mk
new file mode 100644
index 0000000..4b6de38
--- /dev/null
+++ b/debian/cdbs/1/class/autotools-vars.mk
@@ -0,0 +1,114 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2002,2003 Colin Walters <walters@debian.org>
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Common variables for GNU autoconf+automake packages
+#
+# 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_class_autotools_vars
+_cdbs_class_autotools_vars = 1
+
+#include $(_cdbs_class_path)/makefile.mk$(_cdbs_makefile_suffix)
+include debian/cdbs/1/class/makefile.mk
+
+DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(DEB_DESTDIR)
+DEB_MAKE_CLEAN_TARGET = distclean
+#DEB_MAKE_CHECK_TARGET = check
+
+DEB_AC_AUX_DIR = $(DEB_SRCDIR)
+
+DEB_CONFIGURE_SCRIPT = $(CURDIR)/$(DEB_SRCDIR)/configure
+DEB_CONFIGURE_SCRIPT_ENV = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
+DEB_CONFIGURE_NORMAL_ARGS = --build=$(DEB_BUILD_GNU_TYPE) --prefix=$(DEB_CONFIGURE_PREFIX) --includedir=$(DEB_CONFIGURE_INCLUDEDIR) --mandir=$(DEB_CONFIGURE_MANDIR) --infodir=$(DEB_CONFIGURE_INFODIR) --sysconfdir=$(DEB_CONFIGURE_SYSCONFDIR) --localstatedir=$(DEB_CONFIGURE_LOCALSTATEDIR) --libexecdir=$(DEB_CONFIGURE_LIBEXECDIR) --disable-maintainer-mode --disable-dependency-tracking
+
+# Provide --host only if different from --build, as recommended in
+# autotools-dev README.Debian: When provided (even if equal) autotools
+# 2.52+ switches to cross-compiling mode.
+
+ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+DEB_CONFIGURE_NORMAL_ARGS += --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+### TODO: Fix the above to also handle 2.13 which needs other tweaks
+### (read autotools-dev README.Debian!). For now we conflict with
+### autoconf2.13!
+
+# This magic is required because otherwise configure wants to analyse
+# $0 to see whether a VPATH build is needed. This tells it with
+# absolute certainly that this is NOT a VPATH build.
+DEB_CONFIGURE_NORMAL_ARGS += $(if $(subst $(DEB_SRCDIR),,$(cdbs_make_curbuilddir)),,--srcdir=.)
+
+DEB_CONFIGURE_INVOKE = cd $(cdbs_make_curbuilddir) && $(DEB_CONFIGURE_SCRIPT_ENV) $(DEB_CONFIGURE_SCRIPT) $(DEB_CONFIGURE_NORMAL_ARGS)
+DEB_CONFIGURE_PREFIX =/usr
+DEB_CONFIGURE_INCLUDEDIR = "\$${prefix}/include"
+DEB_CONFIGURE_MANDIR ="\$${prefix}/share/man"
+DEB_CONFIGURE_INFODIR ="\$${prefix}/share/info"
+DEB_CONFIGURE_SYSCONFDIR =/etc
+DEB_CONFIGURE_LOCALSTATEDIR =/var
+DEB_CONFIGURE_LIBEXECDIR ="\$${prefix}/lib/$(DEB_SOURCE_PACKAGE)"
+DEB_CONFIGURE_EXTRA_FLAGS =
+
+ifneq (, $(DEB_AUTO_UPDATE_LIBTOOL))
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), libtool
+endif
+
+ifneq (:, $(DEB_AUTO_UPDATE_ACLOCAL):$(DEB_AUTO_UPDATE_AUTOMAKE))
+ifeq ($(DEB_AUTO_UPDATE_ACLOCAL), $(DEB_AUTO_UPDATE_AUTOMAKE))
+# avoid duped build-dependencies
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), automake$(DEB_AUTO_UPDATE_ACLOCAL)
+else
+# either only one of them is required, or different versions are
+ifneq (, $(DEB_AUTO_UPDATE_ACLOCAL))
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), automake$(DEB_AUTO_UPDATE_ACLOCAL)
+endif
+ifneq (, $(DEB_AUTO_UPDATE_AUTOMAKE))
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), automake$(DEB_AUTO_UPDATE_AUTOMAKE)
+endif
+endif
+endif
+
+ifneq (:, $(DEB_AUTO_UPDATE_AUTOCONF):$(DEB_AUTO_UPDATE_AUTOHEADER))
+ifeq ($(DEB_AUTO_UPDATE_AUTOCONF), $(DEB_AUTO_UPDATE_AUTOHEADER))
+# avoid duped build-dependencies
+ifeq ($(DEB_AUTO_UPDATE_AUTOCONF), 2.13)
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), autoconf2.13
+else
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), autoconf
+endif
+else
+# either only one of them is required, or different versions are
+ifneq (, $(DEB_AUTO_UPDATE_AUTOCONF))
+ifeq ($(DEB_AUTO_UPDATE_AUTOCONF), 2.13)
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), autoconf2.13
+else
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), autoconf
+endif
+endif
+ifneq (, $(DEB_AUTO_UPDATE_AUTOHEADER))
+ifeq ($(DEB_AUTO_UPDATE_AUTOHEADER), 2.13)
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), autoconf2.13
+else
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), autoconf
+endif
+endif
+endif
+endif
+
+endif
diff --git a/debian/cdbs/1/class/autotools.mk b/debian/cdbs/1/class/autotools.mk
new file mode 100644
index 0000000..bcff6e4
--- /dev/null
+++ b/debian/cdbs/1/class/autotools.mk
@@ -0,0 +1,59 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2002,2003 Colin Walters <walters@debian.org>
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: A class to configure and build GNU autoconf+automake packages
+#
+# 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_class_autotools
+_cdbs_class_autotools = 1
+
+include debian/cdbs/1/class/autotools-vars.mk
+include $(_cdbs_class_path)/autotools-files.mk$(_cdbs_makefile_suffix)
+
+cdbs_autotools_configure_stamps = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-autotools-configure/%,$(DEB_MAKE_FLAVORS)),debian/stamp-autotools-configure)
+
+# Overriden from makefile-vars.mk. We pass CFLAGS and friends to ./configure, so
+# no need to pass them to make.
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) -C $(cdbs_make_curbuilddir)
+
+pre-build::
+ $(if $(DEB_MAKE_FLAVORS),mkdir -p debian/stamp-autotools-configure)
+
+common-configure-arch common-configure-indep:: common-configure-impl
+common-configure-impl:: $(cdbs_autotools_configure_stamps)
+$(cdbs_autotools_configure_stamps):
+ chmod a+x $(DEB_CONFIGURE_SCRIPT)
+ mkdir -p $(cdbs_make_curbuilddir)
+ $(DEB_CONFIGURE_INVOKE) $(cdbs_autotools_flags) $(DEB_CONFIGURE_EXTRA_FLAGS) $(DEB_CONFIGURE_USER_FLAGS)
+ $(if $(filter post,$(DEB_AUTO_UPDATE_LIBTOOL)),if [ -e $(cdbs_make_curbuilddir)/libtool ]; then cp -f /usr/bin/libtool $(cdbs_make_curbuilddir)/libtool; fi)
+ touch $@
+
+cleanbuilddir:: $(patsubst %,cleanbuilddir/%,$(DEB_MAKE_FLAVORS))
+ rm -rf debian/stamp-autotools-configure
+
+DEB_PHONY_RULES += $(patsubst %,cleanbuilddir/%,$(DEB_MAKE_FLAVORS))
+$(patsubst %,cleanbuilddir/%,$(DEB_MAKE_FLAVORS))::
+ -rmdir $(cdbs_make_curbuilddir)
+# FIXME: Avoid force-removing!
+# -rm -rf $(cdbs_make_curbuilddir)
+ rm -f debian/stamp-autotools-configure/$(cdbs_make_curflavor)
+
+endif
diff --git a/debian/cdbs/1/class/makefile-vars.mk b/debian/cdbs/1/class/makefile-vars.mk
new file mode 100644
index 0000000..1719791
--- /dev/null
+++ b/debian/cdbs/1/class/makefile-vars.mk
@@ -0,0 +1,64 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2002,2003 Colin Walters <walters@debian.org>
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Defines useful variables for packages which have a Makefile
+#
+# 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_class_makefile_vars
+_cdbs_class_makefile_vars = 1
+
+include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
+
+DEB_MAKE_MAKEFILE =
+DEB_MAKE_ENVVARS =
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) $(if $(DEB_MAKE_MAKEFILE), -f $(DEB_MAKE_MAKEFILE),) -C $(cdbs_make_curbuilddir) CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") CPPFLAGS=$(if $(CPPFLAGS_$(cdbs_curpkg)),"$(CPPFLAGS_$(cdbs_curpkg))","$(CPPFLAGS)") LDFLAGS=$(if $(LDFLAGS_$(cdbs_curpkg)),"$(LDFLAGS_$(cdbs_curpkg))","$(LDFLAGS)")
+
+# This variable is deprecated.
+DEB_BUILD_MAKE_TARGET =
+_cdbs_deprecated_vars += DEB_BUILD_MAKE_TARGET
+# New in 0.2.8.
+DEB_MAKE_BUILD_TARGET = $(DEB_BUILD_MAKE_TARGET)
+
+# If your Makefile provides an "install" target, you need to give the requisite commands
+# here to install it into the staging directory. For automake-using programs, this
+# looks like: install DESTDIR=$(DEB_DESTDIR)
+# If you're using automake though, you likely want to be including autotools.mk instead
+# of this file.
+
+# This variable is deprecated.
+DEB_CLEAN_MAKE_TARGET = clean
+_cdbs_deprecated_vars += DEB_CLEAN_MAKE_TARGET
+_cdbs_deprecated_DEB_CLEAN_MAKE_TARGET_default := $(DEB_CLEAN_MAKE_TARGET)
+# New in 0.2.8.
+DEB_MAKE_CLEAN_TARGET = $(DEB_CLEAN_MAKE_TARGET)
+
+# This variable is deprecated.
+DEB_MAKE_TEST_TARGET =
+_cdbs_deprecated_vars += DEB_MAKE_TEST_TARGET
+# New in 0.2.8.
+# New in 0.4.2.
+DEB_MAKE_CHECK_TARGET = $(DEB_MAKE_TEST_TARGET)
+
+# NB! This needs to be declared _before_ including makefile
+#DEB_MAKE_FLAVORS =
+DEB_MAKE_FLAVORS_BUILDDIRSKEL = $(DEB_BUILDDIR)/@FLAVOR@
+
+endif
diff --git a/debian/cdbs/1/class/makefile.mk b/debian/cdbs/1/class/makefile.mk
new file mode 100644
index 0000000..7f931ec
--- /dev/null
+++ b/debian/cdbs/1/class/makefile.mk
@@ -0,0 +1,79 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2002,2003 Colin Walters <walters@debian.org>
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Builds and cleans packages which have a Makefile
+#
+# 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_class_makefile
+_cdbs_class_makefile = 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+#include $(_cdbs_class_path)/makefile-vars.mk$(_cdbs_makefile_suffix)
+include debian/cdbs/1/class/makefile-vars.mk
+
+DEB_PHONY_RULES += makefile-clean
+
+# TODO: Move this to buildvars.mk
+cdbs_curpkgbuilddir = $(if $(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR))
+
+cdbs_make_builddir_check = $(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),$(error DEB_MAKE_FLAVORS in use: DEB_BUILDDIR must be different from DEB_SRCDIR, and needs to be declared before including makefile.mk))
+cdbs_make_build_targets = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-build/%,$(DEB_MAKE_FLAVORS)),debian/stamp-makefile-build)
+cdbs_make_install_targets = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-install/%,$(DEB_MAKE_FLAVORS)),debian/stamp-makefile-install)
+cdbs_make_check_targets = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-check/%,$(DEB_MAKE_FLAVORS)),debian/stamp-makefile-check)
+cdbs_make_clean_targets = $(if $(DEB_MAKE_CLEAN_TARGET),$(if $(DEB_MAKE_FLAVORS),$(patsubst %,makefile-clean/%,$(DEB_MAKE_FLAVORS)),makefile-clean))
+cdbs_make_curflavor = $(notdir $@)
+cdbs_make_curbuilddir = $(if $(DEB_MAKE_FLAVORS),$(subst @FLAVOR@,$(cdbs_make_curflavor),$(DEB_MAKE_FLAVORS_BUILDDIRSKEL)),$(cdbs_curpkgbuilddir))
+
+pre-build::
+ $(if $(DEB_MAKE_FLAVORS),mkdir -p debian/stamp-makefile-build debian/stamp-makefile-install)
+ $(if $(and $(DEB_MAKE_FLAVORS),$(DEB_MAKE_CHECK_TARGET)),mkdir -p debian/stamp-makefile-check)
+
+common-build-arch common-build-indep:: $(cdbs_make_build_targets)
+$(cdbs_make_build_targets):
+ +$(DEB_MAKE_INVOKE) $(DEB_MAKE_BUILD_TARGET)
+ touch $@
+
+cleanbuilddir:: makefile-clean
+makefile-clean:: $(cdbs_make_clean_targets)
+ $(if $(DEB_MAKE_CLEAN_TARGET),,@echo "DEB_MAKE_CLEAN_TARGET unset, not running clean")
+ rm -rf debian/stamp-makefile-build debian/stamp-makefile-install
+
+DEB_PHONY_RULES += makefile-clean $(cdbs_make_clean_targets)
+$(cdbs_make_clean_targets)::
+ +-$(DEB_MAKE_INVOKE) -k $(DEB_MAKE_CLEAN_TARGET)
+
+common-install-arch common-install-indep:: common-install-impl
+common-install-impl:: $(cdbs_make_install_targets)
+$(cdbs_make_install_targets):
+ $(if $(DEB_MAKE_INSTALL_TARGET),+$(DEB_MAKE_INVOKE) $(DEB_MAKE_INSTALL_TARGET),@echo "DEB_MAKE_INSTALL_TARGET unset, skipping default makefile.mk common-install target")
+ $(if $(DEB_MAKE_INSTALL_TARGET),touch $@)
+
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+common-build-arch common-build-indep:: $(cdbs_make_check_targets)
+$(cdbs_make_check_targets) : debian/stamp-makefile-check% : debian/stamp-makefile-build%
+ $(if $(DEB_MAKE_CHECK_TARGET),+$(DEB_MAKE_INVOKE) $(DEB_MAKE_CHECK_TARGET),@echo "DEB_MAKE_CHECK_TARGET unset, not running checks")
+ $(if $(DEB_MAKE_CHECK_TARGET),touch $@)
+
+clean::
+ rm -rf debian/stamp-makefile-check
+endif
+
+endif
diff --git a/debian/cdbs/1/class/python-autotools.mk b/debian/cdbs/1/class/python-autotools.mk
new file mode 100644
index 0000000..28290d3
--- /dev/null
+++ b/debian/cdbs/1/class/python-autotools.mk
@@ -0,0 +1,75 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Class to configure + build GNU autoconf+automake+python packages
+#
+# 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.
+#
+
+_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_autotools
+_cdbs_class_python_autotools = 1
+
+#include $(_cdbs_class_path)/python-vars.mk$(_cdbs_makefile_suffix)
+include debian/cdbs/1/class/python-vars.mk
+
+# Flavors are used in implicit rules, so must be set before including makefile
+DEB_MAKE_FLAVORS = $(cdbs_python_curpkg_build_versions)
+
+#include $(_cdbs_class_path)/autotools.mk$(_cdbs_makefile_suffix)
+include debian/cdbs/1/class/autotools.mk
+
+# Declare Build-Deps for packages using this file
+# FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only
+ifeq (,$(cdbs_python_pkg_check)$(DEB_PYTHON_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
+
+DEB_CONFIGURE_SCRIPT_ENV += PYTHON="python$(cdbs_make_curflavor)"
+
+# This class can optionally use debhelper's commands.
+# (if not, this build target should simply be ignored)
+$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
+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
+
+clean::
+ifeq (, $(cdbs_selected_pycompat))
+ echo "$(cdbs_pycompat)" >debian/pycompat
+endif # use pycompat
+ rm -rf python-build-stamp
+
+## TODO: Drop this when DEB_PYTHON_PACKAGES is only resolved in build targets
+pre-build clean::
+ $(cdbs_python_pkgresolve_check)
+
+endif
diff --git a/debian/cdbs/1/class/python-vars.mk b/debian/cdbs/1/class/python-vars.mk
new file mode 100644
index 0000000..3f78176
--- /dev/null
+++ b/debian/cdbs/1/class/python-vars.mk
@@ -0,0 +1,110 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+# Description: Defines useful variables for Python packages
+#
+# 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.
+#
+
+
+_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_vars
+_cdbs_class_python_vars = 1
+
+include $(_cdbs_rules_path)/buildvars.mk$(_cdbs_makefile_suffix)
+
+DEB_PYTHON_PACKAGES = $(filter-out %-doc %-dev %-common, $(DEB_PACKAGES))
+
+DEB_PYTHON_ARCH_PACKAGES = $(filter $(DEB_PYTHON_PACKAGES), $(DEB_ARCH_PACKAGES))
+DEB_PYTHON_INDEP_PACKAGES = $(filter $(DEB_PYTHON_PACKAGES), $(DEB_INDEP_PACKAGES))
+
+## FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only
+# Avoid including buildcore.mk to not risk breaking when hopefully removing again
+cdbs_python_streq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),,yes)
+cdbs_python_packages_pre := $(DEB_PYTHON_ARCH_PACKAGES)$(DEB_PYTHON_INDEP_PACKAGES)
+cdbs_python_pkgresolve_check = $(if $(call cdbs_python_streq,$(DEB_PYTHON_ARCH_PACKAGES)$(DEB_PYTHON_INDEP_PACKAGES),$(cdbs_python_packages_pre)),, $(warning Setting DEB_PYTHON_*PACKAGES after python-vars in included is currently unsupported))
+## TODO: Rephrase when DEB_PYTHON_PACKAGES is only resolved in build targets
+cdbs_python_pkg_check = $(if $(DEB_PYTHON_ARCH_PACKAGES)$(DEB_PYTHON_INDEP_PACKAGES),, $(warning No Python packages found or declared - either rename binary packages or set DEB_PYTHON_PACKAGES (or one or both of DEB_PYTHON_ARCH_PACKAGES and DEB_PYTHON_INDEP_PACKAGES) before including python-vars.mk))
+
+# 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)
+## FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only
+ifeq (,$(cdbs_python_pkg_check)$(DEB_PYTHON_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
+
+# TODO: Support multiple python programs built for different python versions
+# FIXME: Understand the above sentence and rephrase it
+cdbs_python_curpkg_build_versions = $(cdbs_python_build_versions)
+
+## TODO: Drop this when DEB_PYTHON_PACKAGES is only resolved in build targets
+pre-build clean::
+ $(cdbs_python_pkgresolve_check)
+
+endif
diff --git a/debian/cdbs/1/rules/buildinfo.mk b/debian/cdbs/1/rules/buildinfo.mk
new file mode 100644
index 0000000..bd62ee5
--- /dev/null
+++ b/debian/cdbs/1/rules/buildinfo.mk
@@ -0,0 +1,40 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2004-2006 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
diff --git a/debian/cdbs/1/rules/copyright-check.mk b/debian/cdbs/1/rules/copyright-check.mk
new file mode 100644
index 0000000..645363b
--- /dev/null
+++ b/debian/cdbs/1/rules/copyright-check.mk
@@ -0,0 +1,93 @@
+# -*- 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)
+
+# Single regular expression for files to include or ignore
+DEB_COPYRIGHT_CHECK_REGEX = .*
+DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(debian/.*|(.*/)?config\.(guess|sub|rpath)(\..*)?)$
+
+pre-build:: debian/stamp-copyright-check
+
+debian/stamp-copyright-check:
+ @echo 'Scanning upstream source for new/changed copyright notices (except debian subdir!)...'
+
+# 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 \
+ '$$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->{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;'\
+ ' $$pattern = "$$file->{license} [$$file->{copyright}]";'\
+ ' push @{ $$patternfiles{"$$pattern"} }, $$file->{name};'\
+ '};'\
+ 'foreach $$pattern ( sort {'\
+ ' @{$$patternfiles{$$b}} <=> @{$$patternfiles{$$a}}'\
+ ' ||'\
+ ' $$a cmp $$b'\
+ ' } keys %patternfiles ) {'\
+ ' print "$$pattern: ", join("\n\t", sort @{ $$patternfiles{$$pattern} }), "\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 "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"; \
+ 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
diff --git a/debian/cdbs/1/rules/upstream-tarball.mk b/debian/cdbs/1/rules/upstream-tarball.mk
new file mode 100644
index 0000000..e34a317
--- /dev/null
+++ b/debian/cdbs/1/rules/upstream-tarball.mk
@@ -0,0 +1,139 @@
+# -*- 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
+
+# Perl regexp to change locally used string into that in upstream URL and srcdir
+#DEB_UPSTREAM_TARBALL_VERSION_MANGLE
+cdbs_upstream_tarball_version_mangled = $(if $(strip $(DEB_UPSTREAM_TARBALL_VERSION_MANGLE)),$(shell echo '$(DEB_UPSTREAM_TARBALL_VERSION)' | perl -pe '$(DEB_UPSTREAM_TARBALL_VERSION_MANGLE)'),$(DEB_UPSTREAM_TARBALL_VERSION))
+
+# Base filename (without extension) as used in upstream URL
+DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_PACKAGE)-$(cdbs_upstream_tarball_version_mangled)
+
+# Base directory within tarball
+DEB_UPSTREAM_TARBALL_SRCDIR = $(DEB_UPSTREAM_PACKAGE)-$(cdbs_upstream_tarball_version_mangled)
+
+# 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 = $(DEB_UPSTREAM_TARBALL_BASENAME).$(DEB_UPSTREAM_TARBALL_EXTENSION)
+cdbs_upstream_local_tarball = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION).orig.$(if $(findstring $(DEB_UPSTREAM_TARBALL_EXTENSION),tgz),tar.gz,$(DEB_UPSTREAM_TARBALL_EXTENSION))
+cdbs_upstream_repackaged_basename = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION)$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG).orig
+cdbs_upstream_uncompressed_tarball = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION).orig.tar
+
+# # These variables are deprecated
+_cdbs_deprecated_vars += DEB_UPSTREAM_TARBALL DEB_UPSTREAM_LOCAL_TARBALL DEB_UPSTREAM_REPACKAGE_TARBALL
+_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_local_tarball)" ] ; then \
+ if [ -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ] ; then \
+ rm "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ; \
+ fi ; \
+ echo "Downloading $(cdbs_upstream_local_tarball) from $(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball) ..." ; \
+ wget -nv -T10 -t3 -O "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" "$(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball)" ; \
+ else \
+ echo "Upstream source tarball have been already downloaded: $(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ; \
+ fi
+
+ @md5current=`md5sum "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_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_local_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)
+ @untar="tar -x -C"; \
+ case "$(cdbs_upstream_local_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_local_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_local_tarball)" \
+ $$untar "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" $(patsubst %,--exclude='%',$(DEB_UPSTREAM_REPACKAGE_EXCLUDE)); \
+ else \
+ $$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" \
+ | $$untar "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" $(patsubst %,--exclude='%',$(DEB_UPSTREAM_REPACKAGE_EXCLUDE)); \
+ fi && \
+ if [ "$(DEB_UPSTREAM_TARBALL_SRCDIR)" != "$(cdbs_upstream_repackaged_basename)" ]; then \
+ mv -T "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(DEB_UPSTREAM_TARBALL_SRCDIR)" "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(cdbs_upstream_repackaged_basename)"; \
+ fi && \
+ if [ -n "$(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE))" ]; then \
+ GZIP=-9 tar -b1 -czf "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_repackaged_basename).tar.gz" -C "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" "$(cdbs_upstream_repackaged_basename)"; \
+ else \
+ GZIP=-9 tar -b1 -czf "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_uncompressed_tarball).gz" -C "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" "$(cdbs_upstream_repackaged_basename)"; \
+ fi && \
+ 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_local_tarball)"; \
+ gzip -9 "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_uncompressed_tarball)"; \
+ fi
+
+DEB_PHONY_RULES += print-version get-orig-source
+
+endif
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..58e34f0
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,168 @@
+sugar-datastore (0.8.2-1) unstable; urgency=low
+
+ * New upstream release.
+ * Unfuzz patches.
+ * Update local cdbs snippets:
+ + Relax copyright-check to only warn about its discoveries. Closes:
+ bug#486979.
+ + Update dependency cleanup to strip cdbs 0.4.27 (not 0.4.27-1).
+ * Update debian/copyright-hints.
+
+ -- Jonas Smedegaard <dr@jones.dk> Sat, 21 Jun 2008 01:19:15 +0200
+
+sugar-datastore (0.8.1-3) UNRELEASED; urgency=low
+
+ * Add URL to upstream tarball source in debian/copyright.
+
+ -- Jonas Smedegaard <dr@jones.dk> Mon, 26 May 2008 14:30:28 +0200
+
+sugar-datastore (0.8.1-2) unstable; urgency=low
+
+ * Really update build-dependencies as promised in 0.8.1-1.
+
+ -- Jonas Smedegaard <dr@jones.dk> Mon, 26 May 2008 12:23:09 +0200
+
+sugar-datastore (0.8.1-1) unstable; urgency=low
+
+ * New upstream release (only version number bumped, compared to prior
+ Git snapshot release).
+ * Drop patch 1001 against no longer included doc file.
+ * Unfuzz patch 1005.
+ * Update copyright-check (only files dropped or replaced with
+ auto-generated ones).
+ * Update local cdbs snippets:
+ + Use upstream-tarball.mk to track upstream source releases.
+ + Drop use of autotools.
+ * Semi-auto-update debian/control to update build-dependencies:
+ DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+
+ -- Jonas Smedegaard <dr@jones.dk> Mon, 26 May 2008 11:28:42 +0200
+
+sugar-datastore (0.8.0~git.13d354b-11) unstable; urgency=low
+
+ * Bump debhelper compatibility level to 6 (was 5).
+ * Update local cdbs snippets:
+ + Relax python-central and python-support build-dependencies in
+ python-autotools.mk.
+ + Update copyright-check cdbs snippet to store newline-delimited
+ hints, and strip any non-printable characters. Update hints.
+ + Drop wget options broken with recent versions of wget in
+ update-tarball.mk.
+ * Mention exact upstream Git source in debian/copyright.
+ * Semi-auto-update debian/control to update build-dependencies:
+ DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+
+ -- Jonas Smedegaard <dr@jones.dk> Thu, 24 Apr 2008 12:43:35 +0200
+
+sugar-datastore (0.8.0~git.13d354b-10) unstable; urgency=low
+
+ * Suggest (not recommend) abiword and poppler-utils - really this time
+ (forgot to semi-auto-update debian/control in last upload :-P ).
+
+ -- Jonas Smedegaard <dr@jones.dk> Fri, 11 Apr 2008 21:40:00 +0200
+
+sugar-datastore (0.8.0~git.13d354b-9) unstable; urgency=low
+
+ * Suggest (not recommend) abiword and poppler-utils.
+
+ -- Jonas Smedegaard <dr@jones.dk> Fri, 11 Apr 2008 19:17:30 +0200
+
+sugar-datastore (0.8.0~git.13d354b-8) unstable; urgency=low
+
+ * Fix typo in long description.
+ * Add patches 1004 and 1005 to avoid queue.join and queue.task_done,
+ and check_call, all of them unavailable in Python < 2.5.
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 23 Mar 2008 15:10:46 +0100
+
+sugar-datastore (0.8.0~git.13d354b-7) unstable; urgency=low
+
+ * Rename binary package to python-olpc-datastore (not sugar-datastore
+ and not python-sugar-datastore), to comply with Python policy
+ (currently this package also contains secore which should be dropped
+ as soon as its backwards-compatilbe successor - Xappy - is packaged
+ for Debian).
+ * Update debian/copyright to advertise this packaging as "Python
+ module OLPC Datastore" (not "Sugar Datastore").
+ * Fix email address of OLPC Alioth team.
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 16 Mar 2008 13:23:29 +0100
+
+sugar-datastore (0.8.0~git.13d354b-6) unstable; urgency=low
+
+ * Update CDBS tweaks:
+ + Add local python-autotools.mk (and drop py-compile.mk).
+ + Update python-vars.mk and makefile.mk for improved DEB_*PACKAGES
+ and build-dependency resolving.
+ + Cosmetic updates to README.cdbs-tweaks.
+ * Fix patch 1003 to not strip declaring self._write_lock.
+ * Remove auto-generated py-compile in target clean.
+ * Semi-auto-update debian/control to update build-dependencies:
+ DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 16 Mar 2008 12:35:19 +0100
+
+sugar-datastore (0.8.0~git.13d354b-5) unstable; urgency=low
+
+ * Pass over maintenance of the package to the OLPC team: Change
+ Maintainer, and add myself to Uploaders.
+ * Fix README.packaging to use "pull; fetch --tags" (not "pull -t").
+ * Rename binary package sugar-datastore -> python-sugar-datastore, to
+ comply with Python policy (or maybe not: should each Python module
+ be packaged separately?).
+ * Change binary package to section python.
+ * Depend on python-sugar (not sugar-base).
+ * Update CDBS tweaks:
+ + Add local py-compile.mk and python-vars.mk to handle autotools-
+ based Python compilation. This adds suppurt also for non-default
+ Python versions.
+ + Add local autotools.mk, autotools-vars.mk, makefile.mk and
+ makefile-vars.mk providing multi-flavor build support needed by
+ py-compile.mk.
+ + Add patchsys-quilt.mk.
+ + README.cdbs-tweaks updated to mention the above.
+ * Add already applied patch 1001 to use unversioned Python hashbang in
+ getbuildpath.py script.
+ * Add already applied patch 1002 to nest try-except in
+ try-except-finally constructs, for Python < 2.5 compatibility.
+ * Add already applied patch 1003 to avoid fancy locking using "with"
+ statement, for Python < 2.5 compatibility.
+ * Drop empty usr/lib cleanup, now handled by puthon-central.
+ * Semi-auto-update debian/control to update build-dependencies:
+ DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+
+ -- Jonas Smedegaard <dr@jones.dk> Fri, 14 Mar 2008 13:14:12 +0100
+
+sugar-datastore (0.8.0~git.13d354b-4) unstable; urgency=low
+
+ * Fix watch file (no tarball yet - just guessing the upcoming name).
+ * Update CDBS tweaks:
+ + Replace virtual automake1.10 build-dependency with automake
+ * Semi-auto-update debian/control to update build-dependencies:
+ DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+
+ -- Jonas Smedegaard <dr@jones.dk> Tue, 11 Mar 2008 02:36:26 +0100
+
+sugar-datastore (0.8.0~git.13d354b-3) unstable; urgency=low
+
+ * Patch xapianindex to not import with-statement (now that we've
+ patched around using it).
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 09 Mar 2008 17:46:58 +0100
+
+sugar-datastore (0.8.0~git.13d354b-2) unstable; urgency=low
+
+ * Patch converter, datatore and backingstore to nest try: except: in
+ try: except: finally: constructs, to support Python 2.4.
+ * Patch xapianindex to manually acquire and release locks (not using
+ with construct), to support Python 2.4.
+ * Drop documentation-related build-dependencies: Not yet integrated
+ with main build routines.
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 09 Mar 2008 17:24:15 +0100
+
+sugar-datastore (0.8.0~git.13d354b-1) unstable; urgency=low
+
+ * Initial release. Closes: bug#444021.
+
+ -- Jonas Smedegaard <dr@jones.dk> Sun, 09 Mar 2008 14:59:33 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..1e8b314
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+6
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..df7be7a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,29 @@
+Source: sugar-datastore
+Section: python
+Priority: optional
+Maintainer: Debian OLPC <debian-olpc-devel@lists.alioth.debian.org>
+Uploaders: Jonas Smedegaard <dr@jones.dk>
+Build-Depends: cdbs (>= 0.4.39), quilt, patchutils (>= 0.2.25), devscripts (>= 2.10.7), python-dev (>= 2.3.5-11), python-central (>= 0.5.6), debhelper (>= 5.0.44), dh-buildinfo
+Standards-Version: 3.7.3
+Vcs-Git: git://git.debian.org/git/collab-maint/sugar-datastore.git
+Vcs-Browser: http://git.debian.org/?p=collab-maint/sugar-datastore.git;a=summary
+Homepage: http://wiki.laptop.org/go/Sugar
+XS-Python-Version: all
+
+Package: python-olpc-datastore
+Architecture: all
+Depends: ${shlibs:Depends}, ${python:Depends}, python-gobject, python-dbus, python-gnome2, python-xapian, python-sugar
+Suggests: sugar, poppler-utils | xpdf-utils, abiword | abiword-gnome
+Provides: ${python:Provides}
+XB-Python-Version: ${python:Versions}
+Description: Sugar graphical shell - datastore
+ Sugar is a graphical user interface aimed at children.
+ .
+ Sugar is mainly used as the interface for One Laptop Per Child (OLPC)
+ XO machines.
+ .
+ This package contains a simple log like datastore able to connect with
+ multiple backends. The datastore supports connecting and disconnecting
+ from backends on the fly to help the support the limit space/memory
+ characteristics of the OLPC system and the fact that network services
+ may become unavailable at times.
diff --git a/debian/control.in b/debian/control.in
new file mode 100644
index 0000000..cdfa63f
--- /dev/null
+++ b/debian/control.in
@@ -0,0 +1,29 @@
+Source: sugar-datastore
+Section: python
+Priority: optional
+Maintainer: Debian OLPC <debian-olpc-devel@lists.alioth.debian.org>
+Uploaders: Jonas Smedegaard <dr@jones.dk>
+Build-Depends: @cdbs@
+Standards-Version: 3.7.3
+Vcs-Git: git://git.debian.org/git/collab-maint/sugar-datastore.git
+Vcs-Browser: http://git.debian.org/?p=collab-maint/sugar-datastore.git;a=summary
+Homepage: http://wiki.laptop.org/go/Sugar
+XS-Python-Version: all
+
+Package: python-olpc-datastore
+Architecture: all
+Depends: ${shlibs:Depends}, ${python:Depends}, python-gobject, python-dbus, python-gnome2, python-xapian, python-sugar
+Suggests: sugar, poppler-utils | xpdf-utils, abiword | abiword-gnome
+Provides: ${python:Provides}
+XB-Python-Version: ${python:Versions}
+Description: Sugar graphical shell - datastore
+ Sugar is a graphical user interface aimed at children.
+ .
+ Sugar is mainly used as the interface for One Laptop Per Child (OLPC)
+ XO machines.
+ .
+ This package contains a simple log like datastore able to connect with
+ multiple backends. The datastore supports connecting and disconnecting
+ from backends on the fly to help the support the limit space/memory
+ characteristics of the OLPC system and the fact that network services
+ may become unavailable at times.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..249d5c0
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,36 @@
+This is Python module OLPC Datastore packaged for Debian GNU systems.
+
+Upstream source: http://dev.laptop.org/pub/sugar/sources/sugar-datastore/
+
+Upstream Git source: git://dev.laptop.org/projects/datastore
+
+Upstream author: Benjamin Saller <bcsaller@objectrealms.net>
+
+Files: debian/*
+Copyright: © 2008 Jonas Smedegaard <dr@jones.dk>
+License: GPL-2+
+ The Debian packaging information is under the GPL, version 2 or later.
+
+Files: *
+Copyright: © 2007 ObjectRealms, LLC
+License: GPL-2+
+ __license__ = 'The GNU Public License V2+'
+
+Files: secore/*
+Copyright: © 2007 Lemur Consulting Ltd
+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 of the License, or
+ (at your option) any later version.
+
+Files: maint-helper.py
+Copyright: © 2007, Red Hat, Inc.
+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 of the License, or
+ (at your option) any later version.
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in file "/usr/share/common-licenses/GPL".
diff --git a/debian/copyright_hints b/debian/copyright_hints
new file mode 100644
index 0000000..9c85959
--- /dev/null
+++ b/debian/copyright_hints
@@ -0,0 +1,44 @@
+*No copyright* UNKNOWN []: Makefile.am
+ bin/Makefile.am
+ bin/datastore-service
+ configure.ac
+ etc/Makefile.am
+ etc/org.laptop.sugar.DataStore.service.in
+ secore/Makefile.am
+ src/Makefile.am
+ src/olpc/Makefile.am
+ src/olpc/__init__.py
+ src/olpc/datastore/Makefile.am
+ src/olpc/datastore/__init__.py
+ src/olpc/datastore/__version__.py
+ src/olpc/datastore/bin_copy.py
+ src/olpc/datastore/utils.py
+GPL-2+ [2007 Lemur Consulting Ltd]: secore/__init__.py
+ secore/datastructures.py
+ secore/fieldactions.py
+ secore/fieldmappings.py
+ secore/highlight.py
+ secore/indexerconnection.py
+ secore/marshall.py
+ secore/parsedate.py
+ secore/searchconnection.py
+GENERATED FILE [1994-2002]: Makefile.in
+ bin/Makefile.in
+ etc/Makefile.in
+ secore/Makefile.in
+ src/Makefile.in
+ src/olpc/Makefile.in
+ src/olpc/datastore/Makefile.in
+UNKNOWN [ObjectRealms, LLC, 2007']: src/olpc/datastore/backingstore.py
+ src/olpc/datastore/converter.py
+ src/olpc/datastore/datastore.py
+ src/olpc/datastore/model.py
+ src/olpc/datastore/xapianindex.py
+GENERATED FILE [1992-1996, 1998-2001]: configure
+GPL GENERATED FILE [1996-1997, 1999-2000, 2002-2005]: missing
+GPL GENERATED FILE [2000-2001, 2003-2005 Free Software Foundation, Inc]: py-compile
+GPL-2+ GENERATED FILE [2007 Lemur Consulting Ltd]: secore/errors.py
+MIT/X11 (BSD like) [1994 X Consortium]: install-sh
+UNKNOWN [2002-2003, 2005 Free Software Foundation, Inc / 1996-2004 / 2001, 2003, 2005 Free Software Foundation, Inc]: aclocal.m4
+UNKNOWN [ObjectRealms, LLC. 2007]: README.txt
+UNKNOWN [law: / holder saying it may be distributed]: LICENSE.GPL
diff --git a/debian/patches/1002_avoid_try-except-finally.patch b/debian/patches/1002_avoid_try-except-finally.patch
new file mode 100644
index 0000000..8fe7bb8
--- /dev/null
+++ b/debian/patches/1002_avoid_try-except-finally.patch
@@ -0,0 +1,68 @@
+--- sugar-datastore-0.8.0~git.13d354b.orig/src/olpc/datastore/backingstore.py
++++ sugar-datastore-0.8.0~git.13d354b/src/olpc/datastore/backingstore.py
+@@ -269,9 +269,10 @@
+ if os.path.exists(fn):
+ fp = open(fn, 'r')
+ try:
+- desc = pickle.load(fp)
+- except:
+- desc = {}
++ try:
++ desc = pickle.load(fp)
++ except:
++ desc = {}
+ finally:
+ fp.close()
+
+--- sugar-datastore-0.8.0~git.13d354b.orig/src/olpc/datastore/converter.py
++++ sugar-datastore-0.8.0~git.13d354b/src/olpc/datastore/converter.py
+@@ -74,17 +74,18 @@
+ cmd = self.raw % data
+
+ try:
+- cmd = cmd.split()
+- # the stderr capture here will hide glib error messages
+- # from converters which shouldn't be generating output anyway
+- retcode = subprocess.call(cmd, stderr=subprocess.PIPE)
+- if retcode: return None
+- return codecs.open(target, 'r', 'utf-8')
+- except UnicodeDecodeError:
+- # The data was an unknown type but couldn't be understood
+- # as text so we don't attempt to index it. This most
+- # likely means its just an unknown binary format.
+- return None
++ try:
++ cmd = cmd.split()
++ # the stderr capture here will hide glib error messages
++ # from converters which shouldn't be generating output anyway
++ retcode = subprocess.call(cmd, stderr=subprocess.PIPE)
++ if retcode: return None
++ return codecs.open(target, 'r', 'utf-8')
++ except UnicodeDecodeError:
++ # The data was an unknown type but couldn't be understood
++ # as text so we don't attempt to index it. This most
++ # likely means its just an unknown binary format.
++ return None
+ finally:
+ # we unlink the file as its already been opened for
+ # reading
+--- sugar-datastore-0.8.0~git.13d354b.orig/src/olpc/datastore/datastore.py
++++ sugar-datastore-0.8.0~git.13d354b/src/olpc/datastore/datastore.py
+@@ -394,11 +394,12 @@
+ backingstore = content.backingstore
+ backingstore.current_user_id = dbus.Bus().get_unix_user(sender)
+ try:
+- # Retrieving the file path for the file will cause the file to be
+- # copied or linked to a directory accessible by the caller.
+- file_path = content.filename
+- except AttributeError:
+- file_path = ''
++ try:
++ # Retrieving the file path for the file will cause the file to be
++ # copied or linked to a directory accessible by the caller.
++ file_path = content.filename
++ except AttributeError:
++ file_path = ''
+ finally:
+ backingstore.current_user_id = None
+ return file_path
diff --git a/debian/patches/1003_avoid_with_statement.patch b/debian/patches/1003_avoid_with_statement.patch
new file mode 100644
index 0000000..8e0f442
--- /dev/null
+++ b/debian/patches/1003_avoid_with_statement.patch
@@ -0,0 +1,96 @@
+diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
+index 888bd26..c2506cb 100644
+--- a/src/olpc/datastore/xapianindex.py
++++ b/src/olpc/datastore/xapianindex.py
+@@ -4,8 +4,6 @@ xapianindex
+ maintain indexes on content
+
+ """
+-from __future__ import with_statement
+-
+ __author__ = 'Benjamin Saller <bcsaller@objectrealms.net>'
+ __docformat__ = 'restructuredtext'
+ __copyright__ = 'Copyright ObjectRealms, LLC, 2007'
+@@ -173,7 +170,8 @@ class IndexManager(object):
+
+ self.deltact += 1
+ if force or self.deltact > FLUSH_THRESHOLD:
+- with self._write_lock:
++ self._write_lock.acquire()
++ try:
+
+ # TODO: Would be better to check if the device is present and
+ # don't try to flush if it's not.
+@@ -185,6 +183,8 @@ class IndexManager(object):
+
+ #self.read_index.reopen()
+ self.deltact = 0
++ finally:
++ self._write_lock.release()
+ else:
+ self._flush_timeout = gobject.timeout_add(FLUSH_TIMEOUT * 1000,
+ self._flush_timeout_cb)
+@@ -196,13 +196,16 @@ class IndexManager(object):
+ # conversion/fulltext indexing can
+ # happen in the thread
+ if operation in (CREATE, UPDATE):
+- with self._write_lock:
++ self._write_lock.acquire()
++ try:
+ if operation is CREATE:
+ self.write_index.add(doc)
+ logger.info("created %s:%s" % (uid, vid))
+ elif operation is UPDATE:
+ self.write_index.replace(doc)
+ logger.info("updated %s:%s" % (uid, vid))
++ finally:
++ self._write_lock.release()
+ self.flush()
+
+ # Disable content indexing for Trial-3.
+@@ -217,9 +220,12 @@ class IndexManager(object):
+ return
+ elif operation is DELETE:
+ # sync deletes
+- with self._write_lock:
++ self._write_lock.acquire()
++ try:
+ self.write_index.delete(uid)
+ logger.info("deleted content %s:%s" % (uid,vid))
++ finally:
++ self._write_lock.release()
+ self.flush()
+ return
+
+@@ -246,7 +252,8 @@ class IndexManager(object):
+ continue
+
+ try:
+- with self._write_lock:
++ self._write_lock.acquire()
++ try:
+ if operation is UPDATE:
+ # Here we handle the conversion of binary
+ # documents to plain text for indexing. This is
+@@ -276,6 +283,8 @@ class IndexManager(object):
+
+ # tell the queue its complete
+ self.queue.task_done()
++ finally:
++ self._write_lock.release()
+
+ # we do flush on each record now
+ self.flush()
+@@ -336,8 +345,11 @@ class IndexManager(object):
+ d[p.key] = p
+
+ if add_anything:
+- with self._write_lock:
++ self._write_lock.acquire()
++ try:
+ self.datamodel.apply(self)
++ finally:
++ self._write_lock.release()
+
+ return d
+
diff --git a/debian/patches/1004_avoid_queue_hints.patch b/debian/patches/1004_avoid_queue_hints.patch
new file mode 100644
index 0000000..a74d648
--- /dev/null
+++ b/debian/patches/1004_avoid_queue_hints.patch
@@ -0,0 +1,41 @@
+diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
+index b3da0cc..8cf6a5a 100644
+--- a/src/olpc/datastore/xapianindex.py
++++ b/src/olpc/datastore/xapianindex.py
+@@ -151,8 +151,7 @@ class IndexManager(object):
+
+ def stopIndexer(self, force=False):
+ if not self.indexer_running: return
+- if not force: self.queue.join()
+- self.indexer_running = False
++ if force: self.indexer_running = False
+ # should terminate after the current task
+ self.indexer.join()
+
+@@ -250,6 +249,7 @@ class IndexManager(object):
+ uid, vid, doc, operation, filestuff = data
+ except Empty:
+ #time.sleep(1.0)
++ self.indexer_running = False
+ continue
+
+ try:
+@@ -281,9 +281,6 @@ class IndexManager(object):
+ logger.warning("""Conversion process failed for document %s %s""" % (uid, filename))
+ else:
+ logger.warning("Unknown indexer operation ( %s: %s)" % (uid, operation))
+-
+- # tell the queue its complete
+- self.queue.task_done()
+ finally:
+ self._write_lock.release()
+
+@@ -297,7 +294,7 @@ class IndexManager(object):
+ """Intentionally block until the indexing is complete. Used
+ primarily in testing.
+ """
+- self.queue.join()
++ self.indexer.join()
+ self.flush()
+
+ #
diff --git a/debian/patches/1005_avoid_check_call.patch b/debian/patches/1005_avoid_check_call.patch
new file mode 100644
index 0000000..25547dc
--- /dev/null
+++ b/debian/patches/1005_avoid_check_call.patch
@@ -0,0 +1,24 @@
+diff --git a/src/olpc/datastore/bin_copy.py b/src/olpc/datastore/bin_copy.py
+index 6cf7036..3440b1b 100644
+--- a/src/olpc/datastore/bin_copy.py
++++ b/src/olpc/datastore/bin_copy.py
+@@ -2,15 +2,13 @@ import os, subprocess
+
+
+ def bin_copy(src, dest):
+- try:
+- subprocess.check_call(['/bin/cp', src, dest])
+- except subprocess.CalledProcessError:
++ retcode = subprocess.call(['/bin/cp', src, dest])
++ if retcode:
+ raise OSError("Copy failed %s %s" % (src, dest))
+
+ def bin_mv(src, dest):
+- try:
+- subprocess.check_call(['/bin/mv', src, dest])
+- except subprocess.CalledProcessError:
++ retcode = subprocess.call(['/bin/mv', src, dest])
++ if retcode:
+ raise OSError("Move failed %s %s" % (src, dest))
+
+ if __name__ == "__main__":
diff --git a/debian/patches/README b/debian/patches/README
new file mode 100644
index 0000000..80c1584
--- /dev/null
+++ b/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.
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..64e4de0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+1002_avoid_try-except-finally.patch
+1003_avoid_with_statement.patch
+1004_avoid_queue_hints.patch
+1005_avoid_check_call.patch
diff --git a/debian/pycompat b/debian/pycompat
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/debian/pycompat
@@ -0,0 +1 @@
+2
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..461db95
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,33 @@
+#!/usr/bin/make -f
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2008 Jonas Smedegaard <dr@jones.dk>
+
+# NB! Local CDBS tweaks in use. More info in README.cdbs-tweaks
+DEB_BUILDDIR = build
+DEB_PYTHON_SYSTEM = pycentral
+include debian/cdbs/1/rules/upstream-tarball.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+include debian/cdbs/1/rules/copyright-check.mk
+include debian/cdbs/1/class/python-autotools.mk
+include /usr/share/cdbs/1/rules/debhelper.mk
+include debian/cdbs/1/rules/buildinfo.mk
+
+DEB_UPSTREAM_URL = http://dev.laptop.org/pub/sugar/sources/$(DEB_UPSTREAM_PACKAGE)
+DEB_UPSTREAM_TARBALL_EXTENSION = tar.bz2
+DEB_UPSTREAM_TARBALL_MD5 = d47b72caa054b034cdbd6a47c7966367
+
+pkg = python-olpc-datastore
+
+# Unittests temporarily disabled: python-sugar-toolkit is not yet in Debian
+#DEB_MAKE_CHECK_TARGET = test
+
+# Needed by upstream documentation build process
+# (disabled: not yet integrated with main build routines)
+#CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-docutils, python-epydoc
+
+# Needed by upstream unittests
+# (temporarily disabled: python-sugar-toolkit is not yet in Debian)
+#CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-setuptools, python-dbus, python-gobject, python-sugar-toolkit
+
+# Merge duplicate build-dependencies
+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' -e 's/^ *, *//' -e 's/ *, *$$//')
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..e1189b7
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+# run the "uscan" command to check for upstream updates and more.
+version=3
+http://dev.laptop.org/pub/sugar/sources/sugar-datastore/sugar-datastore-(.*)\.tar\.bz2