From b236133f4a3a9cd613059f3516fe0ecb303cb9b8 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 16 Aug 2008 10:39:21 +0000 Subject: Update cdbs snippets, copyright-hints and dependencies. * 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. + Minor improvements to flavor-enhanced autotools- and makefile- snippets. + Update README.cdbs-tweaks. * Add DEB_MAINTAINER_MODE in debian/rules (thanks to Romain Beauxis). * Semi-auto-update debian/control to update dependencies: DEB_MAINTAINER_MODE=1 fakeroot debian/rules clean --- (limited to 'debian') 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 +# 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 f282adf..9f38ed9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,16 @@ sugar-hulahop (0.4.3-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. + + Minor improvements to flavor-enhanced autotools- and makefile- + snippets. + + Update README.cdbs-tweaks. + * Add DEB_MAINTAINER_MODE in debian/rules (thanks to Romain Beauxis). + * Semi-auto-update debian/control to update dependencies: + DEB_MAINTAINER_MODE=1 fakeroot debian/rules clean -- Jonas Smedegaard Sat, 16 Aug 2008 12:14:03 +0200 diff --git a/debian/control b/debian/control index 8e94b3c..27ab6d4 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: python Priority: optional Maintainer: Debian OLPC Uploaders: Jonas Smedegaard -Build-Depends: cdbs (>= 0.4.39), autotools-dev, devscripts (>= 2.10.7), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6), debhelper (>= 5.0.44), dh-buildinfo, xulrunner-dev (>= 1.9~rc2), python-xpcom (>= 1.9~rc2), python-gtk2-dev +Build-Depends: cdbs (>= 0.4.39), autotools-dev, devscripts (>= 2.10.7), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6), debhelper (>= 5.0.44), dh-buildinfo, python-xpcom (>= 1.9~rc2), xulrunner-dev (>= 1.9~rc2), python-gtk2-dev Standards-Version: 3.7.3 Vcs-Git: git://git.debian.org/git/collab-maint/sugar-hulahop.git Vcs-Browser: http://git.debian.org/?p=collab-maint/sugar-hulahop.git;a=summary @@ -12,7 +12,7 @@ XS-Python-Version: all Package: python-hulahop Architecture: any -Depends: ${shlibs:Depends}, ${python:Depends}, ${python-xpcom:Depends}, python-gtk2, python-gobject +Depends: ${shlibs:Depends}, ${python:Depends}, ${cdbs:Depends}, python-gtk2, python-gobject Suggests: sugar-web-activity Provides: ${python:Provides} XB-Python-Version: ${python:Versions} diff --git a/debian/control.in b/debian/control.in index c69790d..2612260 100644 --- a/debian/control.in +++ b/debian/control.in @@ -12,7 +12,7 @@ XS-Python-Version: all Package: python-hulahop Architecture: any -Depends: ${shlibs:Depends}, ${python:Depends}, ${python-xpcom:Depends}, python-gtk2, python-gobject +Depends: ${shlibs:Depends}, ${python:Depends}, ${cdbs:Depends}, python-gtk2, python-gobject Suggests: sugar-web-activity Provides: ${python:Provides} XB-Python-Version: ${python:Versions} diff --git a/debian/copyright_hints b/debian/copyright_hints index 383dbdf..0f777df 100644 --- a/debian/copyright_hints +++ b/debian/copyright_hints @@ -1,8 +1,13 @@ -*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 NEWS components/Makefile.am components/hulahopAddCertException.idl components/hulahopAddCertException.js + components/xulappinfo.js + components/xulappinfo.js.in configure.ac data/Makefile.am data/chrome/Makefile.am @@ -12,32 +17,67 @@ data/prefs.js m4/python.m4 python/Makefile.am - python/config.py python/config.py.in python/hulahop.defs python/hulahop.override python/hulahopmodule.c src/Makefile.am -GENERATED FILE [1994-2002]: Makefile.in - components/Makefile.in - data/Makefile.in - data/chrome/Makefile.in - python/Makefile.in - src/Makefile.in -LGPL-2+ [2007, Red Hat, Inc]: python/__init__.py +Copyright: *No copyright* +License: UNKNOWN + +Files: python/__init__.py python/webview.py src/HulahopDirectoryProvider.cpp src/HulahopDirectoryProvider.h src/hulahop-web-view.cpp src/hulahop.cpp -LGPL-2+ [2006, Red Hat, Inc]: src/hulahop-web-view.h +Copyright: 2007, Red Hat, Inc +License: LGPL-2+ + +Files: Makefile.in + components/Makefile.in + data/Makefile.in + data/chrome/Makefile.in + python/Makefile.in + src/Makefile.in +Copyright: 1994-2002 +License: UNKNOWN (GENERATED FILE) + +Files: src/hulahop-web-view.h src/hulahop.h -*No copyright* GENERATED FILE []: python/hulahop.c -GENERATED FILE [1992-1996, 1998-2001]: configure -GPL GENERATED FILE [1996-1997, 1999-2000, 2002-2006]: missing -GPL GENERATED FILE [1999-2000, 2003-2007 Free Software]: depcomp -GPL GENERATED FILE [2000-2001, 2003-2005 Free Software Foundation, Inc]: py-compile -GPL-2+ GENERATED FILE [1996-2001, 2003-2006]: ltmain.sh -MIT/X11 (BSD like) [1994 X Consortium]: install-sh -UNKNOWN [1996-2004]: aclocal.m4 -UNKNOWN [the / 1991, 1999 Free Software Foundation, Inc]: COPYING +Copyright: 2006, Red Hat, Inc +License: LGPL-2+ + +Files: missing +Copyright: 1996-1997, 1999-2000, 2002-2006 +License: GPL (GENERATED FILE) + +Files: depcomp +Copyright: 1999-2000, 2003-2007, Free Software +License: GPL (GENERATED FILE) + +Files: py-compile +Copyright: 2000-2001, 2003-2005, Free Software Foundation, Inc +License: GPL (GENERATED FILE) + +Files: ltmain.sh +Copyright: 1996-2001, 2003-2006 +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: 1996-2004 +License: UNKNOWN + +Files: COPYING +Copyright: the + 1991, 1999, Free Software Foundation, Inc +License: UNKNOWN + diff --git a/debian/rules b/debian/rules index 24ea583..1c5e5a0 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 debian/cdbs/1/rules/copyright-check.mk include debian/cdbs/1/class/python-autotools.mk @@ -31,11 +36,12 @@ clean:: # Minimum usable version of xulrunner python-xpcom-minver = 1.9~rc2 -binary-predep/python-hulahop:: - echo "python-xpcom:Depends=python-xpcom (>= $(python-xpcom-minver))" >> debian/python-hulahop.substvars +# Needed both by upstream build and at runtime +CDBS_DEPENDS_$(pkg) := python-xpcom (>= $(python-xpcom-minver)) +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), $(CDBS_DEPENDS_$(pkg)) # Needed by upstream build process -CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), xulrunner-dev (>= $(python-xpcom-minver)), python-xpcom (>= $(python-xpcom-minver)), python-gtk2-dev +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), xulrunner-dev (>= $(python-xpcom-minver)), python-gtk2-dev -# 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 -- cgit v0.9.1