X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_installwm;h=a0f5f704481b30a0b6815baeac06dd7e6e81b044;hb=fb8f18f4a98669c3b85e1bd7920fbabfc00b886e;hp=1989056d0296cbc0da9cb777d5c8c997beaf12a9;hpb=a155491c23c692bb7cd38d7df19c1e41c701236b;p=debhelper.git diff --git a/dh_installwm b/dh_installwm index 1989056..a0f5f70 100755 --- a/dh_installwm +++ b/dh_installwm @@ -11,23 +11,25 @@ use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS -B [S>] [B<-n>] [B<--priority=>I] [S>] +B [S>] [B<-n>] [B<--priority=>I] [S ...>] =head1 DESCRIPTION -dh_installwm is a debhelper program that is responsible for -generating the postinst and postrm commands that register a window manager +B is a debhelper program that is responsible for +generating the F and F commands that register a window manager with L. The window manager's man page is also -registered as a slave symlink (in v6 mode and up), and is assumed to be -located in /usr/share/man/man1/.1.gz. +registered as a slave symlink (in v6 mode and up), if it is found in +F in the package build directory. -Any window manager programs specified as parameters will be registered in -the first package dh_installwm is told to act on. By default, this is the -first binary package in debian/control, but if you use -p, -i, or -a flags, -it will be the first package specified by those flags. +=head1 FILES -Files named debian/package.wm can list other window manager programs to -register. +=over 4 + +=item debian/I.wm + +List window manager programs to register. + +=back =head1 OPTIONS @@ -41,21 +43,20 @@ calculating the correct value. =item B<-n>, B<--noscripts> -Do not modify postinst/postrm scripts. Turns this command into a no-op. +Do not modify F/F scripts. Turns this command into a no-op. -=item I +=item I ... -The commands used to run the window manager or window managers you want to -register. +Window manager programs to register. + +=back =head1 NOTES -Note that this command is not idempotent. "dh_clean -k" should be called +Note that this command is not idempotent. L should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. -=back - =cut init(); @@ -66,14 +67,14 @@ if (! defined $dh{PRIORITY}) { if (@ARGV) { # This is here for backwards compatibility. If the filename doesn't - # include a path, assume it's in /usr/X11R6/bin. + # include a path, assume it's in /usr/bin. if ($ARGV[0] !~ m:/:) { - $ARGV[0]="/usr/X11R6/bin/$ARGV[0]"; + $ARGV[0]="/usr/bin/$ARGV[0]"; } } foreach my $package (@{$dh{DOPACKAGES}}) { -# my $tmp=tmpdir($package); + my $tmp=tmpdir($package); my $file=pkgfile($package,"wm"); my @wm; @@ -86,9 +87,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } if (! $dh{NOSCRIPTS}) { - foreach (@wm) { - autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",); - autoscript($package,"prerm","prerm-wm","s:#WM#:$_:"); +WM: foreach my $wm (@wm) { + autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:"); + + my $wmman; + if (! compat(5)) { + foreach my $ext (".1", ".1x") { + $wmman="/usr/share/man/man1/".basename($wm).$ext; + if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") { + autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:;s:#WMMAN#:$wmman.gz:;s/#PRIORITY#/$dh{PRIORITY}/",); + next WM; + } + } + } + autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:;s/#PRIORITY#/$dh{PRIORITY}/",); } } }