r3458 - trunk/kernel/source/linux-kernel-2.6.12/debian

Andres Salomon dilinger@costa.debian.org
Mon, 11 Jul 2005 03:35:11 +0000


Author: dilinger
Date: 2005-07-11 03:35:09 +0000 (Mon, 11 Jul 2005)
New Revision: 3458

Modified:
   trunk/kernel/source/linux-kernel-2.6.12/debian/rules
Log:
generate debian/control completely from debian/templates, instead of using
arch/*/control.in.  We can add overrides for individual things later on
(i'm thinking specifically of descriptions, here).


Modified: trunk/kernel/source/linux-kernel-2.6.12/debian/rules
===================================================================
--- trunk/kernel/source/linux-kernel-2.6.12/debian/rules	2005-07-11 03:22:30 UTC (rev 3457)
+++ trunk/kernel/source/linux-kernel-2.6.12/debian/rules	2005-07-11 03:35:09 UTC (rev 3458)
@@ -218,18 +218,39 @@
 # Makes the master debian/control file by substituting
 # variable values into the template.
 #
+archs := $(shell find debian/arch/ -mindepth 1 -maxdepth 1 -type d ! -name '.svn' -printf '%f\n')
 debian/control: debian/templates/control.main.in
-	cat debian/templates/control.source.in		\
-	    debian/templates/control.main.in		\
-	    `find debian/arch -name control.in` |	\
-	sed -e 's/@version@/$(version)/g'       	\
-	    -e 's/@major@/$(major)/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' > debian/control
+	rm -f control.tmp 2>/dev/null
+	substitute() {					\
+		cat debian/templates/control.$$1 |	\
+		sed -e 's/@version@/$(version)/g'       \
+		    -e 's/@major@/$(major)/g'		\
+		    -e "s/@arch@/$$2/g"			\
+		    -e 's/@subarch@//g'			\
+		    -e "s/@flavour@/$$3/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';		\
+	};						\
+	list_flavours() {				\
+		find debian/arch/$$1/ -name 'config.*'	\
+			! -name '*.svn*' -printf '%f\n' |  \
+			sed 's/^config\.//';		\
+	};						\
+	substitute source.in "" "" >> control.tmp;	\
+	substitute main.in "" "" >> control.tmp;	\
+	substitute headers.in "" "" >> control.tmp;	\
+	for a in $(archs); do				\
+		substitute headers.arch.in $$a "" >> control.tmp; \
+		for f in $$(list_flavours $$a); do	\
+			substitute headers.flavour.in $$a $$f >>  control.tmp; \
+			substitute image.in $$a $$f >> control.tmp; \
+		done;					\
+	done
+	mv control.tmp debian/control
 	
 .PHONY: clean build unpack binary-indep binary-arch binary patch unpatch source tree