summaryrefslogtreecommitdiff
path: root/dh_installmodules
blob: 1e111e5abc5810ff7c91470ded46413387bbfcd0 (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("install","-m","0644",$file,"$TMP/etc/modutils/$PACKAGE");
		}
		
		if (! $dh{NOSCRIPTS}) {
			autoscript($PACKAGE,"postinst","postinst-modules","s/#PACKAGE#/$PACKAGE/");
			autoscript($PACKAGE,"postrm","postrm-modules","s/#PACKAGE#/$PACKAGE/");
		}
	}
}