summaryrefslogtreecommitdiff
path: root/dh_installmodules
blob: 264ae9c0afdfa29322f9a88288e1bcfceab5fe8c (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
#!/usr/bin/perl -w
#
# Register modules with modutils.

BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
use Dh_Lib;
init();

foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
	$TMP=tmpdir($PACKAGE);
	$file=pkgfile($PACKAGE,"modules");

	if (! -e $TMP) {
		doit("install","-d",$TMP);
	}

	if ($file) {
		if (! -e "$TMP/etc/modutils") {
			doit("install","-d","$TMP/etc/modutils");
			doit("cp","-m0644",$file,"$TMP/etc/modutils/$PACKAGE");
		}
		
		if (! $dh{NOSCRIPTS}) {
			autoscript($PACKAGE,"postinst","postinst-modules","s/#PACKAGE#/$PACKAGE/");
			autoscript($PACKAGE,"postrm","postrm-modules","s/#PACKAGE#/$PACKAGE/");
		}
	}
}