diff options
author | joey <joey> | 1999-09-06 05:47:41 +0000 |
---|---|---|
committer | joey <joey> | 1999-09-06 05:47:41 +0000 |
commit | 37c69d4e7124fb03edf46bea4eb38f6721f2aa2a (patch) | |
tree | 2ab81f9330d3cb5b01d3600ec41d1f1988b17f68 /dh_installexamples | |
parent | da7d6c32c080678dc672f7c6e680c11569f46eda (diff) |
r266: * FHS complience. Patch from Johnie Ingram <johnie@netgod.net>.
For the most part, this was a straight-forward substitution,
dh_installmanpages needed a non-obvious change though.
* Closes: #42489, #42587, #41732.
* dh_installdocs: Adds code to postinst and prerm as specified in
http://www.debian.org/Lists-Archives/debian-ctte-9908/msg00038.html,
to make /usr/doc/<package> a compatability symlink to
/usr/share/doc/<package>. Note that currently if something exists in
/usr/doc/<package> when the postinst is run, it will silently not make
the symlink. I'm considering more intellingent handing of this case.
* Note that if you build a package with this version of debhelper, it will
use /usr/share/man, /usr/share/doc, and /usr/share/info. You may need to
modify other files in your package that reference the old locations.
Diffstat (limited to 'dh_installexamples')
-rwxr-xr-x | dh_installexamples | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/dh_installexamples b/dh_installexamples index 7aec26eb..033564ef 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -1,21 +1,31 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Reads debian/examples, installs all files listed there into -# /usr/doc/$PACKAGE/examples +# /usr/share/doc/$PACKAGE/examples -PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +BEGIN { push @INC, "debian", "/usr/share/debhelper" } +use Dh_Lib; +init(); -if [ -e debian/examples ]; then - examples=`cat debian/examples | tr "\n" " "` -fi +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"examples"); + + undef @examples; + + if ($file) { + @examples=filearray($file); + } -if [ "$examples" -o $@ ]; then - if [ ! -d debian/tmp/usr/doc/$PACKAGE/examples ]; then - doit "install -d debian/tmp/usr/doc/$PACKAGE/examples" - fi + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @examples, @ARGV; + } - for file in $examples $@; do - doit "cp -a $file debian/tmp/usr/doc/$PACKAGE/examples/" - done -fi + if (@examples) { + if (! -d "$TMP/usr/share/doc/$PACKAGE/examples") { + doit("install","-d","$TMP/usr/share/doc/$PACKAGE/examples"); + } + + doit("cp","-a",@examples,"$TMP/usr/share/doc/$PACKAGE/examples"); + } +} |