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).

svn path=/trunk/kernel/source/linux-kernel-2.6.12/; revision=3458
This commit is contained in:
Andres Salomon 2005-07-11 03:35:09 +00:00
parent 7e7f0c97ca
commit 47109cf6eb
1 changed files with 33 additions and 12 deletions

45
debian/rules vendored
View File

@ -218,18 +218,39 @@ binary: binary-indep binary-arch
# 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