From 37c69d4e7124fb03edf46bea4eb38f6721f2aa2a Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 6 Sep 1999 05:47:41 +0000 Subject: r266: * FHS complience. Patch from Johnie Ingram . 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/ a compatability symlink to /usr/share/doc/. Note that currently if something exists in /usr/doc/ 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. --- dh_installexamples | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'dh_installexamples') 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"); + } +} -- cgit v1.2.3