#!/bin/sh # # This is created by the debian/makevars target in the rules file. # . debian/makevars list_arches() { find debian/arch -mindepth 1 -maxdepth 1 \ ! -name '*.svn*' -type d -printf '%f\n' } # # Parameters: # ${1} - architecture to list the subarches for # list_subarches() { echo "none" find debian/arch/${1} -mindepth 1 -maxdepth 1 \ ! -name '*.svn*' -type d -printf '%f\n' } # # Parameters: # ${1} - architecture # ${2} - subarchitecture ('none' if there are no subarches) # list_flavours() { find debian/arch/${1}/${2#none} -name 'config.*' \ ! -name '*.svn*' -printf '%f\n' | sed 's/^config\.//' } # # Parameters: # ${1} - filename to use as a template # ${2} - arch # ${3} - subarch ('none', if the subarch is empty) # ${4} - flavour # substitute() { if [ "${3}" = "none" ]; then sa="" sdir="debian/arch/${2}" else sa="${3}-" sdir="debian/arch/${2}/${3}" fi class="${4}-class" longclass="" desc="" [ -f "${sdir}/desc.${4}" ] && . "${sdir}/desc.${4}" [ -z "${longclass}" ] && longclass="${class}" cat debian/templates/control.${1} | \ sed -e "s#@version@#${version}#g" \ -e "s#@major@#${major}#g" \ -e "s#@arch@#${2}#g" \ -e "s#@subarch@#${sa}#g" \ -e "s#@flavour@#${4}#g" \ -e "s#@class@#${class}#g" \ -e "s#@longclass@#${longclass}#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" [ -z "${5}" ] || printf "${desc}\n" } rm -f control.tmp 2>/dev/null substitute source.in "" "none" >> control.tmp substitute main.in "" "none" >> control.tmp substitute headers.in "" "none" >> control.tmp for a in $(list_arches); do for s in $(list_subarches ${a}); do for f in $(list_flavours ${a} ${s}); do substitute headers.flavour.in ${a} ${s} ${f} >> control.tmp substitute image.in ${a} ${s} ${f} "1" >> control.tmp done done done sed -e '/^[[:space:]]*$/d' control.tmp | \ sed -e 's/^Package:/\n&/g' > debian/control rm -rf control.tmp