From 02bde96f5c7da06ec30d71ad5d4666bf2dfa3bad Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 21 Apr 2008 23:30:56 +0000 Subject: [PATCH] * Rename DEB_REPLACE_FILES to DEB_TRANSFORM_FILES * Create new config-package.mk as the outward-facing makefile fragment. * Replace DEB_{UNREMOVE,UNDIVERT}_FILES_VERSION_file with DEB_$1_VERSION_file * Version bump, since 4.4~ << 4.4 causes build failures on Debathena. git-svn-id: svn+ssh://svn.mit.edu/athena/trunk/debathena/debathena/config-package-dev@22923 728af825-273c-0410-89f9-f7d3b574a069 --- config-package.mk | 25 +++++++++++++++++++++ debian/changelog | 15 +++++++++++++ debian/config-package-dev.install | 3 ++- divert.mk | 14 ++++++------ replace-files.mk => transform-files.mk | 30 +++++++++++++------------- 5 files changed, 64 insertions(+), 23 deletions(-) create mode 100644 config-package.mk rename replace-files.mk => transform-files.mk (53%) diff --git a/config-package.mk b/config-package.mk new file mode 100644 index 0000000..55d8cd4 --- /dev/null +++ b/config-package.mk @@ -0,0 +1,25 @@ +# -*- mode: makefile; coding: utf-8 -*- +# Copyright © 2007-2008 Anders Kaseorg and +# Tim Abbott +# +# 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. + +ifndef _cdbs_rules_config_package +_cdbs_rules_config_package = 1 + +include /usr/share/cdbs/1/rules/transform-files.mk + +endif diff --git a/debian/changelog b/debian/changelog index a76f588..2bffc8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +config-package-dev (4.5) unstable; urgency=low + + * Rename DEB_REPLACE_FILES to DEB_TRANSFORM_FILES + * Create new config-package.mk as the outward-facing makefile fragment. + * Replace DEB_{UNREMOVE,UNDIVERT}_FILES_VERSION_file with + DEB_$1_VERSION_file + + -- Tim Abbott Mon, 21 Apr 2008 18:39:40 -0400 + +config-package-dev (4.4.1) unstable; urgency=low + + * Version bump, since 4.4~ << 4.4 causes build failures on Debathena. + + -- Tim Abbott Mon, 21 Apr 2008 17:51:02 -0400 + config-package-dev (4.4) unstable; urgency=low * Add new DEB_REMOVE_FILES_$package variable designed for removing diff --git a/debian/config-package-dev.install b/debian/config-package-dev.install index e2d8b70..111f6b3 100644 --- a/debian/config-package-dev.install +++ b/debian/config-package-dev.install @@ -1,7 +1,8 @@ divert.mk usr/share/cdbs/1/rules/ debconf-divert.mk usr/share/cdbs/1/rules/ check-files.mk usr/share/cdbs/1/rules/ -replace-files.mk usr/share/cdbs/1/rules/ +config-package.mk usr/share/cdbs/1/rules/ +transform-files.mk usr/share/cdbs/1/rules/ encode usr/share/config-package-dev/ divert.sh.in usr/share/config-package-dev/ debconf-hack.sh usr/share/config-package-dev/ diff --git a/divert.mk b/divert.mk index bab1770..60729e5 100644 --- a/divert.mk +++ b/divert.mk @@ -20,12 +20,12 @@ ifndef _cdbs_rules_divert _cdbs_rules_divert = 1 -CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), config-package-dev (>= 4.4) +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), config-package-dev (>= 4.5~) DEB_DIVERT_SCRIPT = /usr/share/config-package-dev/divert.sh.in DEB_DIVERT_PACKAGES += $(foreach package,$(DEB_ALL_PACKAGES), \ - $(if $(DEB_REPLACE_FILES_$(package)),$(package), \ + $(if $(DEB_TRANSFORM_FILES_$(package)),$(package), \ $(if $(DEB_REMOVE_FILES_$(package)),$(package), \ $(if $(DEB_UNREMOVE_FILES_$(package)),$(package), \ $(if $(DEB_UNDIVERT_FILES_$(package)),$(package), \ @@ -40,7 +40,7 @@ DEB_DIVERT_ENCODER = /usr/share/config-package-dev/encode divert_files_replace_name = $(shell echo $(1) | perl -pe 's/(.*)\Q$(DEB_DIVERT_EXTENSION)\E/$$1$(2)/') debian-divert/%: package = $(subst debian-divert/,,$@) -debian-divert/%: divert_files = $(DEB_DIVERT_FILES_$(package)) $(DEB_REPLACE_FILES_$(package)) +debian-divert/%: divert_files = $(DEB_DIVERT_FILES_$(package)) $(DEB_TRANSFORM_FILES_$(package)) debian-divert/%: divert_remove_files = $(DEB_REMOVE_FILES_$(package)) debian-divert/%: divert_undivert_files = $(DEB_UNDIVERT_FILES_$(package)) debian-divert/%: divert_unremove_files = $(DEB_UNREMOVE_FILES_$(package)) @@ -52,17 +52,17 @@ $(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%: $(if $(divert_files_all), \ echo 'if [ "$$1" = "configure" ]; then'; \ $(foreach file,$(divert_undivert_files), \ - $(if $(DEB_UNDIVERT_FILES_VERSION_$(file)),,\ + $(if $(DEB_UNDIVERT_VERSION_$(file)),,\ echo "ERROR! Missing undivert version for $(file)!">&2; exit 1;) \ echo -n " if [ -n \"\$$2\" ] && dpkg --compare-versions \"\$$2\" '<<' "; \ - echo "'$(DEB_UNDIVERT_FILES_VERSION_$(file))'; then"; \ + echo "'$(DEB_UNDIVERT_VERSION_$(file))'; then"; \ echo " undivert_unlink $(call divert_files_replace_name,$(file), )"; \ echo " fi";) \ $(foreach file,$(divert_unremove_files), \ - $(if $(DEB_UNREMOVE_FILES_VERSION_$(file)),,\ + $(if $(DEB_UNREMOVE_VERSION_$(file)),,\ echo "ERROR! Missing unremove version for $(file)!">&2; exit 1;) \ echo -n " if [ -n \"\$$2\" ] && dpkg --compare-versions \"\$$2\" '<<' "; \ - echo "'$(DEB_UNREMOVE_FILES_VERSION_$(file))'; then"; \ + echo "'$(DEB_UNREMOVE_VERSION_$(file))'; then"; \ echo " undivert_unremove $(file)"; \ echo " fi";) \ $(foreach file,$(divert_files), \ diff --git a/replace-files.mk b/transform-files.mk similarity index 53% rename from replace-files.mk rename to transform-files.mk index 4305432..48e0fc0 100644 --- a/replace-files.mk +++ b/transform-files.mk @@ -17,34 +17,34 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # 02111-1307 USA. -ifndef _cdbs_rules_replace_files -_cdbs_rules_replace_files = 1 +ifndef _cdbs_rules_transform_files +_cdbs_rules_transform_files = 1 include /usr/share/cdbs/1/rules/check-files.mk -DEB_REPLACE_FILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEB_REPLACE_FILES_$(package))) +DEB_TRANSFORM_FILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEB_TRANSFORM_FILES_$(package))) -DEB_REPLACE_FILES_DIR=debian/replace_file_copies +DEB_TRANSFORM_FILES_DIR=debian/transform_file_copies -debian_replace_files = $(patsubst %,$(DEB_REPLACE_FILES_DIR)%,$(1)) -undebian_replace_files = $(patsubst $(DEB_REPLACE_FILES_DIR)%,%,$(1)) +debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_DIR)%,$(1)) +undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_DIR)%,%,$(1)) -common-build-indep:: $(foreach file,$(DEB_REPLACE_FILES),$(call debian_replace_files,$(file))) +common-build-indep:: $(foreach file,$(DEB_TRANSFORM_FILES),$(call debian_transform_files,$(file))) -$(call debian_replace_files,%): $(call debian_check_files,%) +$(call debian_transform_files,%): $(call debian_check_files,%) mkdir -p $(@D) - $(if $(DEB_TRANSFORM_SCRIPT_$(call undebian_replace_files,$@)), \ - $(DEB_TRANSFORM_SCRIPT_$(call undebian_replace_files,$@)), \ - debian/transform_$(notdir $(call undebian_replace_files,$@))) < $< > $@ + $(if $(DEB_TRANSFORM_SCRIPT_$(call undebian_transform_files,$@)), \ + $(DEB_TRANSFORM_SCRIPT_$(call undebian_transform_files,$@)), \ + debian/transform_$(notdir $(call undebian_transform_files,$@))) < $< > $@ $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%: - $(foreach file,$(DEB_REPLACE_FILES_$(cdbs_curpkg)), \ + $(foreach file,$(DEB_TRANSFORM_FILES_$(cdbs_curpkg)), \ install -d $(DEB_DESTDIR)/$(dir $(file)); \ - cp -a $(DEB_REPLACE_FILES_DIR)$(file) \ + cp -a $(DEB_TRANSFORM_FILES_DIR)$(file) \ $(DEB_DESTDIR)/$(dir $(file));) clean:: - $(foreach file,$(DEB_REPLACE_FILES),rm -f debian/$(notdir $(file))) - rm -rf $(DEB_REPLACE_FILES_DIR) + $(foreach file,$(DEB_TRANSFORM_FILES),rm -f debian/$(notdir $(file))) + rm -rf $(DEB_TRANSFORM_FILES_DIR) endif -- 2.45.0