]> git.donarmstrong.com Git - debhelper.git/blob - dh_installexamples
r420: big monsta changes
[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 use strict;
7 use Debian::Debhelper::Dh_Lib;
8 init();
9
10 foreach my $package (@{$dh{DOPACKAGES}}) {
11         my $tmp=tmpdir($package);
12         my $file=pkgfile($package,"examples");
13         
14         my @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 }