#! /bin/bash # # Create substvars for the Haskell package description blurbs # # Copyright (C) 2013 Joachim Breitner set -e DEB_DEFAULT_COMPILER=$1 shift . /usr/share/haskell-devscripts/Dh_Haskell.sh # PS4=" + dh_haskell_blurbs> " # set -x packages=`dh_listpackages` hc=`packages_hc ${DEB_DEFAULT_COMPILER} ${packages}` for pkg in `dh_listpackages $args`; do sfile=debian/$pkg.substvars touch $sfile grep -v -a \ -e ^haskell:Blurb \ -e ^haskell:ShortBlurb \ -e ^haskell:LongDescription \ -e ^haskell:ShortDescription \ $sfile > $sfile.tmp || true ext=`package_ext ${pkg}` case "$ext" in dev) cat >> $sfile.tmp <<'__END__' ;; haskell:ShortBlurb= haskell:Blurb=This package provides a library for the Haskell programming language.${Newline}See http://www.haskell.org/ for more information on Haskell. __END__ prof) cat >> $sfile.tmp <<'__END__' ;; haskell:ShortBlurb=; profiling libraries haskell:Blurb=This package provides a library for the Haskell programming language, compiled${Newline}for profiling. See http://www.haskell.org/ for more information on Haskell. __END__ doc) cat >> $sfile.tmp <<'__END__' ;; haskell:ShortBlurb=; documentation haskell:Blurb=This package provides the documentation for a library for the Haskell${Newline}programming language.${Newline}See http://www.haskell.org/ for more information on Haskell. __END__ esac shortDescription="$( cat debian/control | grep-dctrl -F Source '' -s X-Description -n| head -n1 )" longDescription="$( cat debian/control | grep-dctrl -F Source '' -s X-Description -n| sed 's/^[\t ]//;s/^\.$//'| # remove initial space tail -n +2| # skip short description perl -pe 's/\n$/\$\{Newline}/'| # prepare for dpkg-gencontrol perl -pe 's/\$\{Newline}$//' # but not final lineline )" cat >> $sfile.tmp <<__END__ haskell:ShortDescription=$shortDescription haskell:LongDescription=$longDescription __END__ version=$(dpkg-query --showformat='${version}' --show ${hc} | egrep -o ".*-" \ | egrep -o "[^-]*") echo "haskell:${hc}-version=${hc} (>= ${version}), ${hc} (<< ${version}+)" >> $sfile.tmp mv $sfile.tmp $sfile done