summaryrefslogtreecommitdiff
path: root/dh_installexamples
blob: bf0bbe4ac6d3d88cf13f19e1f0c46efca5c865d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -w
#
# Reads debian/examples, installs all files listed there into
# /usr/share/doc/$PACKAGE/examples

use Debian::Debhelper::Dh_Lib;
init();

foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
	$TMP=tmpdir($PACKAGE);
	$file=pkgfile($PACKAGE,"examples");
	
	undef @examples;
	
	if ($file) {
		@examples=filearray($file);
	}	

	if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
		push @examples, @ARGV;
	}

	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");
	}
}