]> git.donarmstrong.com Git - debhelper.git/blob - dh_installwm
r420: big monsta changes
[debhelper.git] / dh_installwm
1 #!/usr/bin/perl -w
2 #
3 # Add to postinst and prerm to register a window manager.
4
5 use strict;
6 use Debian::Debhelper::Dh_Lib;
7 init();
8
9 if (! defined $dh{PRIORITY}) {
10         $dh{PRIORITY}=20;
11 }
12
13 if (@ARGV) {
14         # This is here for backwards compatability. If the filename doesn't
15         # include a path, assume it's in /usr/X11R6/bin.
16         if ($ARGV[0] !~ m:/:) {
17                 $ARGV[0]="/usr/X11R6/bin/$ARGV[0]";
18         }
19 }
20
21 foreach my $package (@{$dh{DOPACKAGES}}) {
22 #       my $tmp=tmpdir($package);
23         my $file=pkgfile($package,"wm");
24
25         my @wm;
26         if ($file) {
27                 @wm=filearray($file, '.');
28         }
29
30         if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
31                 push @wm, @ARGV;
32         }
33
34         if (@wm && ! $dh{NOSCRIPTS}) {
35                 foreach (@wm) {
36                         autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",);
37                         autoscript($package,"prerm","prerm-wm","s:#WM#:$_:");
38                 }
39         }
40 }
41