From 8e7c414f2413fb19e994b85f8f77c5a896b4125a Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Tue, 12 Jul 2005 08:57:24 +0000 Subject: [PATCH] commit this horribly untested code that generates debian/control from templates/control.*.in for generated images. Will start a test build now and see whether it actually worked after lunch :) svn path=/trunk/kernel/source/linux-kernel-2.6.12/; revision=3469 --- debian/Makefile | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/debian/Makefile b/debian/Makefile index b2b9d04b3..92d761731 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -186,20 +186,38 @@ patches += $(wildcard patches-arch/$(subarch)_*) patches += $(wildcard patches-arch/$(karch).*) patches += $(wildcard patches-arch/$(karch)_*) patches := $(strip $(patches)) +# substitute() and friends is duplicated in debian/rules; this should +# be cleaned up in the long term. watch out for relative paths, as +# debian/rules runs in the top level directory, while debian/Makefile +# runs from the debian directory! $(kdir): post-install-$(subarch) $(wildcard templates/control.*.in) mkdir -p $(tkdir) cp -al $(srcfiles) $(tkdir) mkdir -p $(tkdir)/debian cp changelog $(tkdir)/debian cp copyright $(tkdir)/debian - cat $(controls) | \ - sed -e 's/@version@/$(version)/g' \ - -e 's/@ltver@/$(ltver)/g' \ - -e 's/@major@/$(major)/g' \ - -e 's/@subarch@/$(append)/g' \ - -e 's/@abiname@/$(abiname)/g' | \ - sed '/^[[:space:]]*$$/d' | \ - sed 's/^Package:/\n&/g' > $(tkdir)/debian/control + substitute() { \ + cat templates/control.$$1 | \ + sed -e 's/@version@/$(version)/g' \ + -e 's/@major@/$(major)/g' \ + -e "s/@arch@/$(arch)/g" \ + -e "s/@subarch@/$(subarch)/g" \ + -e "s/@flavour@/$$2/g" \ + -e 's/@ltver@/$(ltver)/g' \ + -e 's/@srcver@/$(srcver)/g' \ + -e 's/@lt_depends@/$(lt_depends)/g' \ + -e 's/@lt_provides@/$(lt_provides)/g' \ + -e 's/@abiname@/$(abiname)/g' | \ + sed '/^[[:space:]]*$$/d' | \ + sed 's/^Package:/\n&/g'; \ + }; \ + substitute source.in "" >> $(tkdir)/debian/control; \ + substitute headers.in "" >> $(tkdir)/debian/control; \ + substitute headers.arch.in "" >> $(tkdir)/debian/control; \ + for f in $(flavours); do \ + substitute headers.flavour.in $$f >> $(tkdir)/debian/control; \ + substitute image.in $$f >> $(tkdir)/debian/control; \ + done touch $(tkdir)/debian/official if [ -n '$(patches)' ]; then \ cd $(tkdir); \