Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-08-16 12:42:07 (GMT)
committer Jonas Smedegaard <dr@jones.dk>2008-08-16 12:42:07 (GMT)
commit0a07004818526dc825bb4e328941dd5e5f0a9267 (patch)
tree9766419f662eaf767f95c198670b79dda34f5d2e
parente90287c423640c36344d8aa3d64bfeace1752016 (diff)
Update cdbs snippets and copyright-hints.
* Update cdbs snippets: + Move dependency cleanup to new local snippet package-relations.mk. + Update copyright-check output to more closely match proposed new copyright file format. Update copyright-hints. + Internal restructuring of flavor-enhanced autotools- and makefile- snippets. + Update README.cdbs-tweaks. * Add DEB_MAINTAINER_MODE in debian/rules (thanks to Romain Beauxis).
-rw-r--r--debian/README.cdbs-tweaks17
-rw-r--r--debian/cdbs/1/class/autotools-vars.mk2
-rw-r--r--debian/cdbs/1/class/autotools.mk26
-rw-r--r--debian/cdbs/1/class/makefile-vars.mk14
-rw-r--r--debian/cdbs/1/class/makefile.mk56
-rw-r--r--debian/cdbs/1/rules/copyright-check.mk26
-rw-r--r--debian/cdbs/1/rules/package-relations.mk50
-rw-r--r--debian/changelog8
-rw-r--r--debian/copyright_hints68
-rwxr-xr-xdebian/rules9
10 files changed, 213 insertions, 63 deletions
diff --git a/debian/README.cdbs-tweaks b/debian/README.cdbs-tweaks
index 5880b2f..6130d0f 100644
--- a/debian/README.cdbs-tweaks
+++ b/debian/README.cdbs-tweaks
@@ -69,6 +69,13 @@ Handle packaging of Sugar activities.
+New perl-build class
+--------------------
+
+Handle Perl modules using Module::Build.
+
+
+
New copyright-check rule
------------------------
@@ -84,6 +91,16 @@ Small wrapper around dh-kpatches, taking care of build-dependencies too.
+New package-relations rule
+--------------------------
+
+Improved build-dependency handling (merging multiple dependencies on
+same packages), and add dependency handling for binary packages (to ease
+maintaining identical build-dependencies and dependencies for eg. Perl
+modules meeding runtime stuff for buildtime tests).
+
+
+
New routines for handling upstream tarball
------------------------------------------
diff --git a/debian/cdbs/1/class/autotools-vars.mk b/debian/cdbs/1/class/autotools-vars.mk
index 4b6de38..87e3a3c 100644
--- a/debian/cdbs/1/class/autotools-vars.mk
+++ b/debian/cdbs/1/class/autotools-vars.mk
@@ -28,7 +28,7 @@ _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_INSTALL_TARGET = install DESTDIR=$(cdbs_curpkgdestdir)
DEB_MAKE_CLEAN_TARGET = distclean
#DEB_MAKE_CHECK_TARGET = check
diff --git a/debian/cdbs/1/class/autotools.mk b/debian/cdbs/1/class/autotools.mk
index bcff6e4..98850d7 100644
--- a/debian/cdbs/1/class/autotools.mk
+++ b/debian/cdbs/1/class/autotools.mk
@@ -28,32 +28,28 @@ _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)
+cdbs_configure_stamps = $(if $(cdbs_make_multibuilds),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-autotools/%,$(cdbs_make_multibuilds)),debian/stamp-autotools)
# 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)
+ $(if $(cdbs_make_multibuilds),mkdir -p debian/stamp-autotools)
common-configure-arch common-configure-indep:: common-configure-impl
-common-configure-impl:: $(cdbs_autotools_configure_stamps)
-$(cdbs_autotools_configure_stamps):
+common-configure-impl:: $(cdbs_configure_stamps)
+$(cdbs_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 $(call cdbs_streq,$(cdbs_make_curbuilddir),$(DEB_BUILDDIR_$(cdbs_curpkg))),,mkdir -p $(cdbs_make_curbuilddir))
+ $(DEB_CONFIGURE_INVOKE) $(cdbs_configure_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)
+makefile-clean::
+ $(if $(cdbs_make_multibuilds),-rmdir --ignore-fail-on-non-empty debian/stamp-autotools,rm -f debian/stamp-autotools)
+$(cdbs_make_clean_nonstamps)::
+ $(if $(call cdbs_streq,$(cdbs_make_curbuilddir),$(DEB_BUILDDIR_$(cdbs_curpkg))),,-rmdir --ignore-fail-on-non-empty $(cdbs_make_curbuilddir))
+ $(if $(cdbs_make_multibuilds),rm -f $(@:makefile-clean%=debian/stamp-autotools%))
endif
diff --git a/debian/cdbs/1/class/makefile-vars.mk b/debian/cdbs/1/class/makefile-vars.mk
index 1719791..d731493 100644
--- a/debian/cdbs/1/class/makefile-vars.mk
+++ b/debian/cdbs/1/class/makefile-vars.mk
@@ -42,6 +42,8 @@ DEB_MAKE_BUILD_TARGET = $(DEB_BUILD_MAKE_TARGET)
# looks like: install DESTDIR=$(DEB_DESTDIR)
# If you're using automake though, you likely want to be including autotools.mk instead
# of this file.
+# For multi-flavored builds (see below) installed per-flavor, it looks like this:
+# install DESTDIR=$(cdbs_curpkgdestdir)
# This variable is deprecated.
DEB_CLEAN_MAKE_TARGET = clean
@@ -57,8 +59,14 @@ _cdbs_deprecated_vars += DEB_MAKE_TEST_TARGET
# 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@
+# If DEB_MAKE_FLAVORS is set compilation is done once per flavor.
+# NB! This must be declared _before_ including makefile.mk
+#DEB_MAKE_FLAVORS = light normal enhanced
+
+# If building multiple flavors, skeleton strings are used for
+# DEB_BUILDDIR and DEB_DESTDIR, with @FLAVOR@ expanding to actual
+# flavor.
+DEB_MAKE_BUILDDIRSKEL = $(cdbs_curpkgbuilddir)/@FLAVOR@
+DEB_MAKE_DESTDIRSKEL = $(cdbs_curpkgdestdir)/@FLAVOR@
endif
diff --git a/debian/cdbs/1/class/makefile.mk b/debian/cdbs/1/class/makefile.mk
index 7f931ec..2f4e98f 100644
--- a/debian/cdbs/1/class/makefile.mk
+++ b/debian/cdbs/1/class/makefile.mk
@@ -29,51 +29,55 @@ 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
+# TODO: Move these to buildcore.mk
cdbs_curpkgbuilddir = $(if $(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR))
-
+cdbs_curpkgdestdir = $(if $(DEB_DESTDIR_$(cdbs_curpkg)),$(DEB_DESTDIR_$(cdbs_curpkg)),$(DEB_DESTDIR))
+
+cdbs_make_multibuilds = $(sort $(DEB_MAKE_FLAVORS))
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))
+cdbs_make_build_stamps = $(if $(cdbs_make_multibuilds),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-build/%,$(cdbs_make_multibuilds)),debian/stamp-makefile-build)
+cdbs_make_install_stamps = $(if $(cdbs_make_multibuilds),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-install/%,$(cdbs_make_multibuilds)),debian/stamp-makefile-install)
+cdbs_make_check_stamps = $(if $(cdbs_make_multibuilds),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-check/%,$(cdbs_make_multibuilds)),debian/stamp-makefile-check)
+cdbs_make_clean_nonstamps = $(if $(cdbs_make_multibuilds),$(patsubst %,makefile-clean/%,$(cdbs_make_multibuilds)),makefile-clean)
+cdbs_make_curflavor = $(filter-out %/,$(subst /,/ ,$@))
+cdbs_make_curbuilddir = $(if $(cdbs_make_multibuilds),$(subst @FLAVOR@,$(cdbs_make_curflavor),$(DEB_MAKE_BUILDDIRSKEL)),$(cdbs_curpkgbuilddir))
+
+DEB_PHONY_RULES += makefile-clean $(cdbs_make_clean_nonstamps)
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)
+ $(if $(cdbs_make_multibuilds),mkdir -p debian/stamp-makefile-build debian/stamp-makefile-install)
+ $(and $(cdbs_make_multibuilds),$(not $(findstring nocheck,$(DEB_BUILD_OPTIONS))),$(DEB_MAKE_CHECK_TARGET),mkdir -p debian/stamp-makefile-check)
-common-build-arch common-build-indep:: $(cdbs_make_build_targets)
-$(cdbs_make_build_targets):
+common-build-arch common-build-indep:: $(cdbs_make_build_stamps)
+$(cdbs_make_build_stamps):
+$(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
+makefile-clean:: $(if $(cdbs_make_multibuilds),$(cdbs_make_clean_nonstamps))
+ $(if $(cdbs_make_multibuilds),-rmdir --ignore-fail-on-non-empty debian/stamp-makefile-build debian/stamp-makefile-install,rm -f 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)
+$(cdbs_make_clean_nonstamps)::
+ $(if $(DEB_MAKE_CLEAN_TARGET),+-$(DEB_MAKE_INVOKE) -k $(DEB_MAKE_CLEAN_TARGET),@echo "DEB_MAKE_CLEAN_TARGET unset, not running clean")
+ $(if $(cdbs_make_multibuilds),rm -f $(@:makefile-clean%=debian/stamp-makefile-build%) $(@:makefile-clean%=debian/stamp-makefile-install%))
common-install-arch common-install-indep:: common-install-impl
-common-install-impl:: $(cdbs_make_install_targets)
-$(cdbs_make_install_targets):
+common-install-impl:: $(cdbs_make_install_stamps)
+$(cdbs_make_install_stamps)::
$(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%
+common-build-arch common-build-indep:: $(cdbs_make_check_stamps)
+$(cdbs_make_check_stamps) : 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
+makefile-clean::
+ $(if $(DEB_MAKE_CHECK_TARGET),rm -f debian/stamp-makefile-check)
+
+$(cdbs_make_clean_nonstamps)::
+ $(if $(cdbs_make_multibuilds),rm -f $(@:makefile-clean%=debian/stamp-makefile-check%))
endif
endif
diff --git a/debian/cdbs/1/rules/copyright-check.mk b/debian/cdbs/1/rules/copyright-check.mk
index 645363b..d96681a 100644
--- a/debian/cdbs/1/rules/copyright-check.mk
+++ b/debian/cdbs/1/rules/copyright-check.mk
@@ -28,6 +28,9 @@ 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)(\..*)?)$
@@ -35,13 +38,17 @@ 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!)...'
+ @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)' * \
+ @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*$$/) {'\
@@ -56,8 +63,15 @@ debian/stamp-copyright-check:
'foreach $$file (@files) {'\
' $$file->{license} =~ s/\s*\(with incorrect FSF address\)//;'\
' $$file->{license} =~ s/\s+\(v([^)]+) or later\)/-$$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};'\
'};'\
@@ -66,7 +80,10 @@ debian/stamp-copyright-check:
' ||'\
' $$a cmp $$b'\
' } keys %patternfiles ) {'\
- ' print "$$pattern: ", join("\n\t", sort @{ $$patternfiles{$$pattern} }), "\n";'\
+ ' ($$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 -`"; \
@@ -74,13 +91,14 @@ debian/stamp-copyright-check:
@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 "$(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; \
diff --git a/debian/cdbs/1/rules/package-relations.mk b/debian/cdbs/1/rules/package-relations.mk
new file mode 100644
index 0000000..3a92eb7
--- /dev/null
+++ b/debian/cdbs/1/rules/package-relations.mk
@@ -0,0 +1,50 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2004-2006 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 (>= 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
+
+endif
diff --git a/debian/changelog b/debian/changelog
index 65b3f64..26bf566 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,14 @@
sugar-datastore (0.82.0-1) UNRELEASED; urgency=low
* New upstream release.
+ * Update cdbs snippets:
+ + Move dependency cleanup to new local snippet package-relations.mk.
+ + Update copyright-check output to more closely match proposed new
+ copyright file format. Update copyright-hints.
+ + Internal restructuring of flavor-enhanced autotools- and makefile-
+ snippets.
+ + Update README.cdbs-tweaks.
+ * Add DEB_MAINTAINER_MODE in debian/rules (thanks to Romain Beauxis).
-- Jonas Smedegaard <dr@jones.dk> Sat, 16 Aug 2008 13:36:18 +0200
diff --git a/debian/copyright_hints b/debian/copyright_hints
index 9c85959..85aa680 100644
--- a/debian/copyright_hints
+++ b/debian/copyright_hints
@@ -1,5 +1,10 @@
-*No copyright* UNKNOWN []: Makefile.am
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=XXX
+Upstream-Name: Untrusted draft - double-check copyrights yourself!
+
+Files: Makefile.am
bin/Makefile.am
+ bin/copy-from-journal
+ bin/copy-to-journal
bin/datastore-service
configure.ac
etc/Makefile.am
@@ -13,7 +18,10 @@
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
+Copyright: *No copyright*
+License: UNKNOWN
+
+Files: secore/__init__.py
secore/datastructures.py
secore/fieldactions.py
secore/fieldmappings.py
@@ -22,23 +30,59 @@ GPL-2+ [2007 Lemur Consulting Ltd]: secore/__init__.py
secore/marshall.py
secore/parsedate.py
secore/searchconnection.py
-GENERATED FILE [1994-2002]: Makefile.in
+Copyright: 2007, Lemur Consulting Ltd
+License: GPL-2+
+
+Files: 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
+Copyright: 1994-2002
+License: UNKNOWN (GENERATED FILE)
+
+Files: 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
+Copyright: ObjectRealms, LLC, 2007'
+License: UNKNOWN
+
+Files: missing
+Copyright: 1996-1997, 1999-2000, 2002-2006
+License: GPL (GENERATED FILE)
+
+Files: py-compile
+Copyright: 2000-2001, 2003-2005, Free Software Foundation, Inc
+License: GPL (GENERATED FILE)
+
+Files: secore/errors.py
+Copyright: 2007, Lemur Consulting Ltd
+License: GPL-2+ (GENERATED FILE)
+
+Files: install-sh
+Copyright: 1994, X Consortium
+License: MIT/X11 (BSD like)
+
+Files: configure
+Copyright: 1992-1996, 1998-2001
+License: UNKNOWN (GENERATED FILE)
+
+Files: aclocal.m4
+Copyright: 2002-2003, 2005-2007, Free Software Foundation, Inc
+ 1996-2004,
+ 2001, 2003, 2005, Free Software Foundation, Inc
+License: UNKNOWN
+
+Files: README.txt
+Copyright: ObjectRealms, LLC. 2007
+License: UNKNOWN
+
+Files: LICENSE.GPL
+Copyright: law:
+ holder saying it may be distributed
+License: UNKNOWN
+
diff --git a/debian/rules b/debian/rules
index 49c47b9..8f19889 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,11 @@
# NB! Local CDBS tweaks in use. More info in README.cdbs-tweaks
DEB_BUILDDIR = build
DEB_PYTHON_SYSTEM = pycentral
+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 /usr/share/cdbs/1/rules/patchsys-quilt.mk
include debian/cdbs/1/rules/copyright-check.mk
@@ -29,5 +34,5 @@ pkg = python-olpc-datastore
# (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/ *, *$$//')
+# Resolve, cleanup and apply CDBS-declared dependencies
+include debian/cdbs/1/rules/package-relations.mk