[Pkg-haskell-commits] darcs: haskell-devscripts: dh_haskell_blurbs added, provides substitution variables for the common package description blurbs, and also for reading the package description from the Source’s Description field. Until http://bugs.debian.org/680871 is fixed this does not work well for packages with multiple paragraphs in their description.

Joachim Breitner mail at joachim-breitner.de
Fri May 17 20:12:50 UTC 2013


Fri May 17 19:50:21 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * dh_haskell_blurbs added, provides substitution variables for the common package description blurbs, and also for reading the package description from the Source[_\e2_][_\80_][_\99_]s Description field. Until http://bugs.debian.org/680871 is fixed this does not work well for packages with multiple paragraphs in their description.
  Ignore-this: dce175e1524d790c05532b8422432ac0

    M ./debian/changelog +10
    M ./debian/install +1
    M ./debian/manpages +1
    A ./dh_haskell_blurbs
    A ./dh_haskell_blurbs.pod
    M ./hlibrary.mk +4

Fri May 17 19:50:21 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * dh_haskell_blurbs added, provides substitution variables for the common package description blurbs, and also for reading the package description from the Source’s Description field. Until http://bugs.debian.org/680871 is fixed this does not work well for packages with multiple paragraphs in their description.
  Ignore-this: dce175e1524d790c05532b8422432ac0
diff -rN -u old-haskell-devscripts//debian/changelog new-haskell-devscripts//debian/changelog
--- old-haskell-devscripts//debian/changelog	2013-05-17 20:12:49.879259982 +0000
+++ new-haskell-devscripts//debian/changelog	2013-05-17 20:12:49.899363792 +0000
@@ -1,3 +1,13 @@
+haskell-devscripts (0.8.15) UNRELEASED; urgency=low
+
+  * dh_haskell_blurbs added, provides substitution variables for the common
+    package description blurbs, and also for reading the package description
+    from the Source’s Description field.
+    Until http://bugs.debian.org/680871 is fixed this does not work well for
+    packages with multiple paragraphs in their description.
+
+ -- Joachim Breitner <nomeata at debian.org>  Fri, 17 May 2013 20:59:46 +0200
+
 haskell-devscripts (0.8.14) experimental; urgency=low
 
   * Explicitly mention which Prelude to use in dh_haskell_shlibdeps, thanks to
diff -rN -u old-haskell-devscripts//debian/install new-haskell-devscripts//debian/install
--- old-haskell-devscripts//debian/install	2013-05-17 20:12:49.879259982 +0000
+++ new-haskell-devscripts//debian/install	2013-05-17 20:12:49.886205040 +0000
@@ -2,5 +2,6 @@
 dh_haskell_depends        usr/bin/
 dh_haskell_shlibdeps      usr/bin/
 dh_haskell_extra_depends  usr/bin/
+dh_haskell_blurbs         usr/bin/
 Dh_Haskell.sh             usr/share/haskell-devscripts/
 hlibrary.mk               usr/share/cdbs/1/class
diff -rN -u old-haskell-devscripts//debian/manpages new-haskell-devscripts//debian/manpages
--- old-haskell-devscripts//debian/manpages	2013-05-17 20:12:49.879259982 +0000
+++ new-haskell-devscripts//debian/manpages	2013-05-17 20:12:49.886205040 +0000
@@ -2,3 +2,4 @@
 dh_haskell_depends.1
 dh_haskell_shlibdeps.1
 dh_haskell_extra_depends.1
+dh_haskell_blurbs.1
diff -rN -u old-haskell-devscripts//dh_haskell_blurbs new-haskell-devscripts//dh_haskell_blurbs
--- old-haskell-devscripts//dh_haskell_blurbs	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-devscripts//dh_haskell_blurbs	2013-05-17 20:12:49.891340548 +0000
@@ -0,0 +1,73 @@
+#! /bin/sh
+#
+# Create substvars for the Haskell package description blurbs
+#
+# Copyright (C) 2013 Joachim Breitner <nomeata at debian.org>
+
+set -e 
+
+for pkg in `dh_listpackages $args`; do
+    case "$pkg" in
+	libghc-*-dev)
+	    what=Dev
+	    ;;
+	libghc-*-prof)
+	    what=Prof
+	    ;;
+	libghc-*-doc)
+	    what=Doc
+	    ;;
+    esac 
+    if [ -z "$what" ]; then continue; fi
+
+    sfile=debian/$pkg.substvars
+    touch $sfile
+
+    grep -v \
+	-e ^haskell:Blurb \
+	-e ^haskell:ShortBlurb \
+	-e ^haskell:LongDescription \
+	-e ^haskell:ShortDescription \
+	$sfile > $sfile.tmp || true
+
+    case "$pkg" in
+	libghc-*-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__
+
+	libghc-*-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__
+
+	libghc-*-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
+	# Remove when http://bugs.debian.org/680871 is fixed
+	)"
+
+    cat >> $sfile.tmp <<__END__
+haskell:ShortDescription=$shortDescription
+haskell:LongDescription=$longDescription
+__END__
+
+    mv $sfile.tmp $sfile
+done
diff -rN -u old-haskell-devscripts//dh_haskell_blurbs.pod new-haskell-devscripts//dh_haskell_blurbs.pod
--- old-haskell-devscripts//dh_haskell_blurbs.pod	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-devscripts//dh_haskell_blurbs.pod	2013-05-17 20:12:49.891340548 +0000
@@ -0,0 +1,39 @@
+=head1 NAME
+
+dh_haskell_blurb - standard haskell package description blurbs
+
+=head1 SYNOPSIS
+
+B<dh_haskell_blurbs> [S<I<debhelper options>>]
+[B<-X>I<package>]
+[B<--exclude=>I<package>]
+[S<I<file>> ...]
+
+=head1 DESCRIPTION
+
+dh_haskell_blurbs is a debhelper program provides substvars for the standard blurbs occurring in Haskell package descriptions.
+
+To use it, move the common parts of the description to the source stanza:
+
+ X-Description: Cool library
+  This is a pure Haskell implementation of coolness. It is cooler
+  than implementation via foreign languages, because we can.
+
+And then use the following for every Haskell library package stanza, C<dev>, C<prof> and C<doc>:
+
+ Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+  ${haskell:LongDescription}
+  .
+  ${haskell:Blurb}
+
+
+=head1 SEE ALSO
+
+L<dh_haskell_depends(1)>
+L<dh_haskell_shlibdeps(1)>
+L<dh_haskell_provides(1)>
+L<debhelper(7)>
+
+=head1 AUTHOR
+
+Joachim Breitner <nomeata at debian.org>
diff -rN -u old-haskell-devscripts//hlibrary.mk new-haskell-devscripts//hlibrary.mk
--- old-haskell-devscripts//hlibrary.mk	2013-05-17 20:12:49.863292226 +0000
+++ new-haskell-devscripts//hlibrary.mk	2013-05-17 20:12:49.895380274 +0000
@@ -161,6 +161,7 @@
 	dh_haskell_provides -p$(notdir $@)
 	dh_haskell_depends -p$(notdir $@)
 	dh_haskell_shlibdeps -p$(notdir $@)
+	dh_haskell_blurbs -p$(notdir $@)
 
 install/libghc-$(CABAL_PACKAGE)-prof:: debian/tmp-inst-ghc install/libghc-$(CABAL_PACKAGE)-dev debian/extra-depends
 	cd debian/tmp-inst-ghc ; find usr/lib/haskell-packages/ghc/lib/ \
@@ -168,6 +169,7 @@
 		-exec install -Dm 644 '{}' ../$(notdir $@)/'{}' ';'
 	dh_haskell_provides -p$(notdir $@)
 	dh_haskell_depends -p$(notdir $@)
+	dh_haskell_blurbs -p$(notdir $@)
 
 install/haskell-$(CABAL_PACKAGE)-doc install/libghc-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghc debian/extra-depends
 	mkdir -p debian/$(notdir $@)/$(DEB_HADDOCK_HTML_DIR)
@@ -182,11 +184,13 @@
 		-printf "%p $(DEB_HOOGLE_TXT_DIR)/%f\n" >> debian/libghc-$(CABAL_PACKAGE)-doc.links
 	sed -i s,^debian/libghc-$(CABAL_PACKAGE)-doc,, debian/libghc-$(CABAL_PACKAGE)-doc.links
 	dh_haskell_depends -p$(notdir $@)
+	dh_haskell_blurbs -p$(notdir $@)
 
 install/libhugs-$(CABAL_PACKAGE):: $(DEB_SETUP_BIN_NAME) dist-hugs debian/extra-depends
 	$(DEB_SETUP_BIN_NAME) copy --destdir=debian/libhugs-$(CABAL_PACKAGE) --builddir=dist-hugs
 	rm -rf debian/libhugs-$(CABAL_PACKAGE)/usr/share/doc/*
 	dh_haskell_depends -p$(notdir $@)
+	dh_haskell_blurbs -p$(notdir $@)
 
 
 # Support for installing executables





More information about the Pkg-haskell-commits mailing list