]> git.donarmstrong.com Git - debhelper.git/blob - dh_installexamples
r266: * FHS complience. Patch from Johnie Ingram <johnie@netgod.net>.
[debhelper.git] / dh_installexamples
1 #!/usr/bin/perl -w
2 #
3 # Reads debian/examples, installs all files listed there into
4 # /usr/share/doc/$PACKAGE/examples
5
6 BEGIN { push @INC, "debian", "/usr/share/debhelper" }
7 use Dh_Lib;
8 init();
9
10 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
11         $TMP=tmpdir($PACKAGE);
12         $file=pkgfile($PACKAGE,"examples");
13         
14         undef @examples;
15         
16         if ($file) {
17                 @examples=filearray($file);
18         }       
19
20         if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
21                 push @examples, @ARGV;
22         }
23
24         if (@examples) {
25                 if (! -d "$TMP/usr/share/doc/$PACKAGE/examples") {
26                         doit("install","-d","$TMP/usr/share/doc/$PACKAGE/examples");
27                 }
28                 
29                 doit("cp","-a",@examples,"$TMP/usr/share/doc/$PACKAGE/examples");
30         }
31 }